Struct command_error::OutputContext
source · pub struct OutputContext<O> { /* private fields */ }Expand description
Context around Command Output.
This contains additional information about the command that was run (via a CommandDisplay
object) and can be used to construct error messages (for use in methods like
CommandExt::output_checked_as).
Implementations§
source§impl<O> OutputContext<O>where
O: OutputLike + 'static,
impl<O> OutputContext<O>where
O: OutputLike + 'static,
sourcepub fn into_output(self) -> O
pub fn into_output(self) -> O
Get the OutputLike data contained in this context object.
sourcepub fn output(&self) -> &O
pub fn output(&self) -> &O
Get a reference to the OutputLike data contained in this context object.
sourcepub fn status(&self) -> ExitStatus
pub fn status(&self) -> ExitStatus
Get the command’s ExitStatus.
sourcepub fn command(&self) -> &dyn CommandDisplay
pub fn command(&self) -> &dyn CommandDisplay
Get a reference to the command contained in this context object, for use in error messages or diagnostics.
sourcepub fn error(self) -> Error
pub fn error(self) -> Error
Construct an error that indicates this command failed, containing information about the command and its output.
See CommandExt for examples of the error format.
Auto Trait Implementations§
impl<O> Freeze for OutputContext<O>where
O: Freeze,
impl<O> !RefUnwindSafe for OutputContext<O>
impl<O> !Send for OutputContext<O>
impl<O> !Sync for OutputContext<O>
impl<O> Unpin for OutputContext<O>where
O: Unpin,
impl<O> !UnwindSafe for OutputContext<O>
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