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: FileDescriptorThe readable end of the pipe
write: FileDescriptorThe writable end of the pipe
Implementations§
Auto Trait Implementations§
impl Freeze for Pipe
impl RefUnwindSafe for Pipe
impl Send for Pipe
impl Sync for Pipe
impl Unpin for Pipe
impl UnwindSafe for Pipe
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more