Enum unshare::Fd[][src]

pub enum Fd {
    ReadPipe,
    WritePipe,
    Inherit,
    ReadNull,
    WriteNull,
    Fd(Closing),
}

An enumeration that is used to configure non-stdio file descriptors. It differs from stdio one because we must differentiate from readable and writable file descriptors for things open by the library

The enumeration members might be non-stable, it's better to use one of the constructors to create an instance

Variants

This fd is a reading end of a pipe

This fd is a writing end of a pipe

This fd is inherited from parent (current) process

This fd is redirected from /dev/null

This fd is redirected to /dev/null

This is fd passed by application (and closed by unshare)

Methods

impl Fd
[src]

Create a pipe so that child can read from it

Create a pipe so that child can write to it

Inherit the child descriptor from parent

Not very useful for custom file descriptors better use from_file()

Create a readable pipe that always has end of file condition

Create a writable pipe that ignores all the input

A simpler helper method for from_raw_fd, that does dup of file descriptor, so is actually safe to use (but can fail)

A simpler helper method for from_raw_fd, that consumes file

Auto Trait Implementations

impl Send for Fd

impl Sync for Fd