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(&self) -> Vec<u8> ⓘ
pub fn stdout_utf8(&self) -> String
pub fn invalid_stdout_utf8(&self) -> String
pub fn stderr(&self) -> Vec<u8> ⓘ
pub fn stderr_utf8(&self) -> String
pub fn invalid_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