pub struct Redirects { /* private fields */ }
Expand description
Contains a stack or redirects that can be processed in order to setup the file descriptors for a new process.
Implementations§
Source§impl Redirects
impl Redirects
Sourcepub fn process(&self, jobs: &mut Jobs) -> Result<HashSet<FileDesc>, Error>
pub fn process(&self, jobs: &mut Jobs) -> Result<HashSet<FileDesc>, Error>
Process the stack in order and setup all the requested file descriptors. Returns a Set containing all the file descriptors setup (to avoid closing them on process start).
Sourcepub fn set_in_internal_fd(
&mut self,
dest_fd: FileDesc,
source_fd: FileDesc,
push_back: bool,
)
pub fn set_in_internal_fd( &mut self, dest_fd: FileDesc, source_fd: FileDesc, push_back: bool, )
Push a fd to fd redirect onto the stack. This is for internally managed source FDs (for pipes etc). If push_back is true then push to the end else put on the front (useful for pipes).
Sourcepub fn set_out_internal_fd(
&mut self,
dest_fd: FileDesc,
source_fd: FileDesc,
push_back: bool,
)
pub fn set_out_internal_fd( &mut self, dest_fd: FileDesc, source_fd: FileDesc, push_back: bool, )
Push a fd to fd redirect onto the stack. This is for internally managed source FDs (for pipes etc). If push_back is true then push to the end else put on the front (useful for pipes).
Sourcepub fn set_in_fd(&mut self, dest_fd: FileDesc, source_fd: Arg, push_back: bool)
pub fn set_in_fd(&mut self, dest_fd: FileDesc, source_fd: Arg, push_back: bool)
Push a fd to fd redirect onto the stack. If push_back is true then push to the end else put on the front (useful for pipes).
Sourcepub fn set_out_fd(&mut self, dest_fd: FileDesc, source_fd: Arg, push_back: bool)
pub fn set_out_fd(&mut self, dest_fd: FileDesc, source_fd: Arg, push_back: bool)
Push a fd to fd redirect onto the stack. If push_back is true then push to the end else put on the front (useful for pipes).
Sourcepub fn set_in_out_fd(&mut self, dest_fd: FileDesc, source_fd: Arg)
pub fn set_in_out_fd(&mut self, dest_fd: FileDesc, source_fd: Arg)
Push a fd to fd redirect onto the stack.
Sourcepub fn set_in_out_path(&mut self, dest_fd: FileDesc, path: Arg)
pub fn set_in_out_path(&mut self, dest_fd: FileDesc, path: Arg)
Push an input file path to the redirect stack for fd.
Sourcepub fn set_in_path(&mut self, dest_fd: FileDesc, path: Arg)
pub fn set_in_path(&mut self, dest_fd: FileDesc, path: Arg)
Push an input file path to the redirect stack for fd.
Sourcepub fn set_in_direct(&mut self, dest_fd: FileDesc, data: Arg)
pub fn set_in_direct(&mut self, dest_fd: FileDesc, data: Arg)
Push input data to the redirect stack for fd.
Sourcepub fn set_out_path(&mut self, dest_fd: FileDesc, path: Arg, overwrite: bool)
pub fn set_out_path(&mut self, dest_fd: FileDesc, path: Arg, overwrite: bool)
Push an output file path to the redirect stack for fd.