pub struct CommandOutput { /* private fields */ }Expand description
What a child said and how it stopped.
Implementations§
Source§impl CommandOutput
impl CommandOutput
Sourcepub fn exited(
exit_code: i32,
stdout: impl Into<Vec<u8>>,
stderr: impl Into<Vec<u8>>,
) -> Self
pub fn exited( exit_code: i32, stdout: impl Into<Vec<u8>>, stderr: impl Into<Vec<u8>>, ) -> Self
A completed run, for a test double or for the real runner.
Sourcepub fn with_truncation(self, stdout: bool, stderr: bool) -> Self
pub fn with_truncation(self, stdout: bool, stderr: bool) -> Self
Marks the captured streams as having been cut short.
Sourcepub fn completion(&self) -> Completion
pub fn completion(&self) -> Completion
How it stopped.
Sourcepub fn exit_code(&self) -> Option<i32>
pub fn exit_code(&self) -> Option<i32>
The exit code, when the process exited with one.
None covers both a killed child and a Unix child that died of a
signal, which have no code to report.
Sourcepub fn stdout_truncated(&self) -> bool
pub fn stdout_truncated(&self) -> bool
Whether stdout was longer than the limit.
Sourcepub fn stderr_truncated(&self) -> bool
pub fn stderr_truncated(&self) -> bool
Whether stderr was longer than the limit.
Sourcepub fn stdout_text(&self) -> String
pub fn stdout_text(&self) -> String
stdout decoded for a human, trimmed.
Goes through super::discovery::decode_console_output rather than
from_utf8_lossy, because the Windows console programs this adapter
runs answer in UTF-16 as often as in UTF-8.
Sourcepub fn stderr_text(&self) -> String
pub fn stderr_text(&self) -> String
stderr decoded for a human, trimmed.
Sourcepub fn diagnostic(&self) -> String
pub fn diagnostic(&self) -> String
The sentence an error carries: whichever stream said something.
Trait Implementations§
Source§impl Clone for CommandOutput
impl Clone for CommandOutput
Source§fn clone(&self) -> CommandOutput
fn clone(&self) -> CommandOutput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandOutput
impl Debug for CommandOutput
impl Eq for CommandOutput
Source§impl PartialEq for CommandOutput
impl PartialEq for CommandOutput
impl StructuralPartialEq for CommandOutput
Auto Trait Implementations§
impl Freeze for CommandOutput
impl RefUnwindSafe for CommandOutput
impl Send for CommandOutput
impl Sync for CommandOutput
impl Unpin for CommandOutput
impl UnsafeUnpin for CommandOutput
impl UnwindSafe for CommandOutput
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
Mutably borrows from an owned value. Read more