[−][src]Struct unix_exec_piper::Pipe
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,