Trait UpDuct

Source
pub trait UpDuct {
    // Required methods
    fn run_with(
        &self,
        stdout_fn: fn(&Expression) -> Expression,
    ) -> Result<Output>;
    fn run_with_path(&self, path: &Utf8Path) -> Result<Output>;
    fn run_with_inherit(&self) -> Result<Output>;
}
Expand description

Trait to wrap running commands with Duct.

Required Methods§

Source

fn run_with(&self, stdout_fn: fn(&Expression) -> Expression) -> Result<Output>

Run with the stdout sent to wherever stdout_fn points to.

You should normally use this instead of the .run() function, to make sure you don’t accidentally write stdout to liv’s stdout, as this pollutes stdout, and may cause liv commands to fail for users.

Source

fn run_with_path(&self, path: &Utf8Path) -> Result<Output>

Run with the stdout sent to path path.

Alternative to the .run_with() function as this takes a path argument.

Source

fn run_with_inherit(&self) -> Result<Output>

Run with the stdout inherited from the parent process.

Implementations on Foreign Types§

Source§

impl UpDuct for Expression

Source§

fn run_with(&self, stdout_fn: fn(&Expression) -> Expression) -> Result<Output>

Run with the stdout sent to wherever stdout_fn points to.

Source§

fn run_with_path(&self, path: &Utf8Path) -> Result<Output>

Run with the stdout sent to wherever stdout_fn points to.

Source§

fn run_with_inherit(&self) -> Result<Output>

Run with the stdout inherited from the parent process.

Implementors§