Skip to main content

CmdToFile

Trait CmdToFile 

Source
pub trait CmdToFile {
    // Required method
    fn to_file(
        &mut self,
        file: File,
        stderr_file: Option<File>,
    ) -> Result<(), CmdSpawnError>;
}

Required Methods§

Source

fn to_file( &mut self, file: File, stderr_file: Option<File>, ) -> Result<(), CmdSpawnError>

spawn, wait and stdout to file for the child process, optional stderr to stderr_file

§Errors

command.to_file(file, err_file) can result in CmdSpawnError:

  • CmdSpawnError::IO(std::io::Error) when spawn or wait fail
  • CmdSpawnError::Child(ChildError) when the child process exit with a failed status

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl CmdToFile for Command

Source§

fn to_file( &mut self, file: File, stderr_file: Option<File>, ) -> Result<(), CmdSpawnError>

Implementors§