Skip to main content

CommandFdInjectionExt

Trait CommandFdInjectionExt 

Source
pub trait CommandFdInjectionExt {
    // Required method
    fn inject_fds(
        &mut self,
        open_files: impl Iterator<Item = (ShellFd, OpenFile)>,
    ) -> Result<(), Error>;
}
Available on Unix only.
Expand description

Extension trait for injecting file descriptors into commands.

Required Methods§

Source

fn inject_fds( &mut self, open_files: impl Iterator<Item = (ShellFd, OpenFile)>, ) -> Result<(), Error>

Injects the given open files as file descriptors into the command.

§Arguments
  • open_files - A mapping of child file descriptors to open files.
§Errors
  • An error if a file’s descriptor cannot be duplicated.
  • crate::error::ErrorKind::ChildCreationFailure if the descriptor mappings cannot be applied to the command, for example because two files map to the same child descriptor.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl CommandFdInjectionExt for Command

Source§

fn inject_fds( &mut self, open_files: impl Iterator<Item = (ShellFd, OpenFile)>, ) -> Result<(), Error>

Implementors§