Struct filedescriptor::Pipe
source · [−]pub struct Pipe {
pub read: FileDescriptor,
pub write: FileDescriptor,
}
Expand description
Represents the readable and writable ends of a pair of descriptors connected via a kernel pipe.
use filedescriptor::{Pipe, Error};
use std::io::{Read,Write};
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