pub enum PipeSetup {
Inherit,
Pipe,
Null,
Redirect(Target),
Temp,
FileDescr(c_int),
FileName(String, Mode),
File(File),
}
Expand description
Setup a pipe.
Variants
Inherit
Inherit the stream from the parent process. This is the default for stderr and for stdin of the first process in the pipe chain.
Pipe
Open a pipe to the parent process or between processes. This is the default for stdout and for stdin of all but the first process in the pipe chain.
Null
Open a pipe to /dev/null
.
Redirect(Target)
Redirect this stream to the specified target stream. Only stdout and stderr can be redirected this way and only to each other. If a stream is redirected to itself it is equivalent to PipeSetup::Pipe.
Temp
Connect the stream to a temp file. If supported this is done via the
operating systems native temp file support using the O_TMPFILE
flag.
Such a file is written to the hard disk, but has no name and will be
deleted after the file handle to it is closed.
If the operating system or filesystem of /tmp
does not support the
O_TMPFILE
flag the same behaviour is emulated by opening a new file
using mkstemp()
and then immediately unlink()
ed.
FileDescr(c_int)
Connect the stream to the specified file descriptor. Note that error or not any passed file descriptor will be consumed (closed) by Chain::new().
FileName(String, Mode)
Connect the stream to the specified file using the specified mode.
File(File)
Connect the stream to the specified file. Note that error or not any passed file will be consumed (closed) by Chain::new().
Implementations
sourceimpl PipeSetup
impl PipeSetup
pub fn is_redirect(&self) -> bool
pub fn is_redirect_to(&self, target: Target) -> bool
pub fn is_inherit(&self) -> bool
pub fn is_pipe(&self) -> bool
pub fn is_null(&self) -> bool
pub fn is_temp(&self) -> bool
pub fn is_any_file(&self) -> bool
pub fn is_file(&self) -> bool
pub fn is_file_descr(&self) -> bool
pub fn is_file_name(&self) -> bool
Trait Implementations
sourceimpl IntoPipeSetup for PipeSetup
impl IntoPipeSetup for PipeSetup
fn into_pipe_setup(self, mode: Mode) -> PipeSetup
Auto Trait Implementations
impl RefUnwindSafe for PipeSetup
impl Send for PipeSetup
impl Sync for PipeSetup
impl Unpin for PipeSetup
impl UnwindSafe for PipeSetup
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more