pub struct CompletedProcess {
output: Output,
}
Expand description
Represents the result of an executed process.
The various assert_
helper methods should preferably be used for
checking the contents of stdout/stderr.
Fields§
§output: Output
Implementations§
source§impl CompletedProcess
impl CompletedProcess
pub fn stdout_utf8(&self) -> String
pub fn invalid_stdout_utf8(&self) -> String
pub fn stderr_utf8(&self) -> String
pub fn status(&self) -> ExitStatus
sourcepub fn assert_stdout_equals<S: AsRef<str>>(&self, expected: S) -> &Self
pub fn assert_stdout_equals<S: AsRef<str>>(&self, expected: S) -> &Self
Checks that trimmed stdout
matches trimmed expected
.
sourcepub fn assert_stdout_not_contains<S: AsRef<str>>(&self, unexpected: S) -> &Self
pub fn assert_stdout_not_contains<S: AsRef<str>>(&self, unexpected: S) -> &Self
Checks that stdout
does not contain unexpected
.
sourcepub fn assert_stdout_not_contains_regex<S: AsRef<str>>(
&self,
unexpected: S,
) -> &Self
pub fn assert_stdout_not_contains_regex<S: AsRef<str>>( &self, unexpected: S, ) -> &Self
Checks that stdout
does not contain the regex pattern unexpected
.
sourcepub fn assert_stdout_contains<S: AsRef<str>>(&self, expected: S) -> &Self
pub fn assert_stdout_contains<S: AsRef<str>>(&self, expected: S) -> &Self
Checks that stdout
contains expected
.
sourcepub fn assert_stdout_contains_regex<S: AsRef<str>>(&self, expected: S) -> &Self
pub fn assert_stdout_contains_regex<S: AsRef<str>>(&self, expected: S) -> &Self
Checks that stdout
contains the regex pattern expected
.
sourcepub fn assert_stderr_equals<S: AsRef<str>>(&self, expected: S) -> &Self
pub fn assert_stderr_equals<S: AsRef<str>>(&self, expected: S) -> &Self
Checks that trimmed stderr
matches trimmed expected
.
sourcepub fn assert_stderr_contains<S: AsRef<str>>(&self, expected: S) -> &Self
pub fn assert_stderr_contains<S: AsRef<str>>(&self, expected: S) -> &Self
Checks that stderr
contains expected
.
sourcepub fn assert_stderr_contains_regex<S: AsRef<str>>(&self, expected: S) -> &Self
pub fn assert_stderr_contains_regex<S: AsRef<str>>(&self, expected: S) -> &Self
Checks that stderr
contains the regex pattern expected
.
sourcepub fn assert_stderr_not_contains<S: AsRef<str>>(&self, unexpected: S) -> &Self
pub fn assert_stderr_not_contains<S: AsRef<str>>(&self, unexpected: S) -> &Self
Checks that stderr
does not contain unexpected
.
sourcepub fn assert_stderr_not_contains_regex<S: AsRef<str>>(
&self,
unexpected: S,
) -> &Self
pub fn assert_stderr_not_contains_regex<S: AsRef<str>>( &self, unexpected: S, ) -> &Self
Checks that stderr
does not contain the regex pattern unexpected
.
pub fn assert_exit_code(&self, code: i32) -> &Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompletedProcess
impl RefUnwindSafe for CompletedProcess
impl Send for CompletedProcess
impl Sync for CompletedProcess
impl Unpin for CompletedProcess
impl UnwindSafe for CompletedProcess
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes