Crate pipe [−] [src]
Synchronous in-memory pipe
Example
use std::thread::spawn; use std::io::{Read, Write}; let (mut read, mut write) = pipe::pipe(); let message = "Hello, world!"; spawn(move || write.write_all(message.as_bytes()).unwrap()); let mut s = String::new(); read.read_to_string(&mut s).unwrap(); assert_eq!(&s, message);
Structs
PipeReader |
The |
PipeWriter |
The |
Functions
pipe |
Creates a synchronous memory pipe |