Enum unshare::Stdio
[−]
[src]
pub enum Stdio { Pipe, Inherit, Null, Fd(Closing), }
An enumeration that is used to configure stdio file descritors
The enumeration members might be non-stable, it's better to use one of the constructors to create an instance
Variants
Pipe
Inherit
Null
Fd(Closing)
Methods
impl Stdio
[src]
fn piped() -> Stdio
Pipe is created for child process
fn inherit() -> Stdio
The child inherits file descriptor from the parent process
fn null() -> Stdio
Stream is attached to /dev/null
fn to_fd(self, write: bool) -> Fd
Converts stdio definition to file descriptor definition (mostly needed internally)
fn dup_file<F: AsRawFd>(file: &F) -> Result<Stdio>
A simpler helper method for from_raw_fd
, that does dup of file
descriptor, so is actually safe to use (but can fail)
fn from_file<F: IntoRawFd>(file: F) -> Stdio
A simpler helper method for from_raw_fd
, that consumes file
Note: we assume that file descriptor already has the CLOEXEC
flag. This is by default for all files opened by rust.
Trait Implementations
impl FromRawFd for Stdio
[src]
unsafe fn from_raw_fd(fd: RawFd) -> Stdio
Constructs a new instances of Self
from the given raw file descriptor. Read more