Trait CmdPipe

Source
pub trait CmdPipe {
    // Required methods
    fn pipe(&mut self, piped_command: &mut Command) -> Result<Output, Error>;
    fn pipe_to_file(
        &mut self,
        piped_command: &mut Command,
        file: File,
    ) -> Result<(), Error>;
}

Required Methods§

Source

fn pipe(&mut self, piped_command: &mut Command) -> Result<Output, Error>

Pipe stdout of self to stdin of piped_command

§Errors

command.pipe(cmd) can result in std::io::Error

  • when spawn or wait fail
  • when there is an issue with the stdout / stdin pipe (std::io::ErrorKind::BrokenPipe)
Source

fn pipe_to_file( &mut self, piped_command: &mut Command, file: File, ) -> Result<(), Error>

Pipe stdout of self to stdin of piped_command, and pipe stdout of piped_command to file

§Errors

command.pipe_to_file(cmd, file) can result in std::io::Error

  • when spawn or wait fail
  • when there is an issue with the stdout / stdin pipe (std::io::ErrorKind::BrokenPipe)

Implementations on Foreign Types§

Source§

impl CmdPipe for Command

Source§

fn pipe(&mut self, piped_command: &mut Command) -> Result<Output, Error>

Source§

fn pipe_to_file( &mut self, piped_command: &mut Command, file: File, ) -> Result<(), Error>

Implementors§