Crates.io | dup |
lib.rs | dup |
version | 0.1.0 |
source | src |
created_at | 2017-08-22 04:48:07.928736 |
updated_at | 2017-08-22 04:48:07.928736 |
description | A RW pipe for the given 'fd' |
homepage | https://github.com/younisshah/dup |
repository | |
max_upload_size | |
id | 28508 |
size | 3,718 |
dup::Dup::new(fd)
returns a RW pipe for the given fd
.
In your Cargo.toml
file add under [dependencies]
section
[dependencies]
dup = "0.1.0"
let mut rw = dup::Dup::new(1);
thread::spawn(|| {
println!("Hello World");
});
let mut reader = BufReader::new(rw.0);
let mut s = String::new();
reader.read_to_string(&mut s);
rw.1.write(s.as_bytes());
MIT