pub enum PipeSetup {
    Inherit,
    Pipe,
    Null,
    Redirect(Target),
    Temp,
    FileDescr(c_int),
    FileName(StringMode),
    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(StringMode)

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

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.