[][src]Struct filedescriptor::Pipe

pub struct Pipe {
    pub read: FileDescriptor,
    pub write: FileDescriptor,
}

Represents the readable and writable ends of a pair of descriptors connected via a kernel pipe.

use filedescriptor::Pipe;
use std::io::{Read,Write};
use failure::Error;

let mut pipe = Pipe::new()?;
pipe.write.write(b"hello")?;
drop(pipe.write);

let mut s = String::new();
pipe.read.read_to_string(&mut s)?;
assert_eq!(s, "hello");

Fields

read: FileDescriptor

The readable end of the pipe

write: FileDescriptor

The writable end of the pipe

Methods

impl Pipe[src]

pub fn new() -> Fallible<Pipe>[src]

Auto Trait Implementations

impl Unpin for Pipe

impl Sync for Pipe

impl Send for Pipe

impl RefUnwindSafe for Pipe

impl UnwindSafe for Pipe

Blanket Implementations

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.

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

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

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