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§
Sourcefn inject_fds(
&mut self,
open_files: impl Iterator<Item = (ShellFd, OpenFile)>,
) -> Result<(), Error>
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::ChildCreationFailureif 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".