Skip to main content

CommandAnyhow

Trait CommandAnyhow 

Source
pub trait CommandAnyhow {
    // Required methods
    fn spawn_anyhow(&mut self) -> Result<Child>;
    fn output_anyhow(&mut self) -> Result<Output>;
    fn status_anyhow(&mut self) -> Result<ExitStatus>;
    fn anyhow_context(&self) -> String;
}
Expand description

Extend std::process::Command with anyhow methods

Required Methods§

Source

fn spawn_anyhow(&mut self) -> Result<Child>

Wrap Command::spawn, providing the command as error context

Source

fn output_anyhow(&mut self) -> Result<Output>

Wrap Command::output, providing the command as error context

Source

fn status_anyhow(&mut self) -> Result<ExitStatus>

Wrap Command::status, providing the command as error context

Source

fn anyhow_context(&self) -> String

Describe the command for error contexts

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl CommandAnyhow for Command

Implementors§