[][src]Struct unix_exec_piper::Pipe

pub struct Pipe { /* fields omitted */ }

Abstraction over UNIX pipe for the specific case here with stdin/stdout redirection between processes. The typical flow is that a Pipe is created, the program is forked and that one process marks it's part of the Pipe as READ while the other process marks it's part of the Pipe as WRITE.

Each Pipe object will exists per address space, because we create a child process for each command to be executed.

Each pipe connects two processes. Each process has access to "pipe_to_current" and "pipe_to_next". First one is used as READ-end while the latter one is used as WRITE-end.

Implementations

impl Pipe[src]

pub fn new() -> Self[src]

pub fn as_read_end(&mut self)[src]

Marks and locks the Pipe in the current address space as read end.

pub fn as_write_end(&mut self)[src]

Marks and locks the Pipe in the current address space as write end.

pub fn parent_close_all(&mut self)[src]

A parent doesn't uses the pipes. It just creates the objects and make sure they are transferred into the childs (via fork(). After a child process started and got it's Pipe objects, the parent MUST close it's FDs in order to prevent deadlocks.

Trait Implementations

impl Debug for Pipe[src]

impl Drop for Pipe[src]

fn drop(&mut self)[src]

Makes sure all FD's are closed when Pipe is dropped.

Auto Trait Implementations

impl RefUnwindSafe for Pipe

impl Send for Pipe

impl Sync for Pipe

impl Unpin for Pipe

impl UnwindSafe for Pipe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.