Enum ubend::PipeSetup [−][src]
pub enum PipeSetup { Inherit, Pipe, Null, Redirect(Target), Temp, FileDescr(c_int), FileName(String, Mode), File(File), }
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()].
Methods
impl PipeSetup
[src]
impl PipeSetup
pub fn is_redirect(&self) -> bool
[src]
pub fn is_redirect(&self) -> bool
pub fn is_redirect_to(&self, target: Target) -> bool
[src]
pub fn is_redirect_to(&self, target: Target) -> bool
pub fn is_inherit(&self) -> bool
[src]
pub fn is_inherit(&self) -> bool
pub fn is_pipe(&self) -> bool
[src]
pub fn is_pipe(&self) -> bool
pub fn is_null(&self) -> bool
[src]
pub fn is_null(&self) -> bool
pub fn is_temp(&self) -> bool
[src]
pub fn is_temp(&self) -> bool
pub fn is_any_file(&self) -> bool
[src]
pub fn is_any_file(&self) -> bool
pub fn is_file(&self) -> bool
[src]
pub fn is_file(&self) -> bool
pub fn is_file_descr(&self) -> bool
[src]
pub fn is_file_descr(&self) -> bool
pub fn is_file_name(&self) -> bool
[src]
pub fn is_file_name(&self) -> bool
impl PipeSetup
[src]
impl PipeSetup
pub fn into_pipe_setup(self, mode: Mode) -> PipeSetup
[src]
pub fn into_pipe_setup(self, mode: Mode) -> PipeSetup
Trait Implementations
impl Debug for PipeSetup
[src]
impl Debug for PipeSetup
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl IntoPipeSetup for PipeSetup
[src]
impl IntoPipeSetup for PipeSetup
fn into_pipe_setup(self, mode: Mode) -> PipeSetup
[src]
fn into_pipe_setup(self, mode: Mode) -> PipeSetup