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§
Sourcefn pipe(&mut self, piped_command: &mut Command) -> Result<Output, Error>
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
orwait
fail - when there is an issue with the stdout / stdin pipe (std::io::ErrorKind::BrokenPipe)
Sourcefn pipe_to_file(
&mut self,
piped_command: &mut Command,
file: File,
) -> Result<(), Error>
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
orwait
fail - when there is an issue with the stdout / stdin pipe (std::io::ErrorKind::BrokenPipe)