stream-channel

Crates.iostream-channel
lib.rsstream-channel
version0.1.0
sourcesrc
created_at2021-11-22 02:08:27.807049
updated_at2021-11-22 02:08:27.807049
descriptionstream in channel
homepage
repositoryhttps://github.com/gipsyh/stream-channel
max_upload_size
id485516
size4,000
Yuheng Su (gipsyh)

documentation

README

stream-channel

byte stream between threads

example

let (mut l, mut r) = StreamChannel::new();
let send = vec![1, 2, 3, 4];
l.write(&send).unwrap();
l.flush().unwrap();
let mut recv = vec![0; 2];
r.read_exact(recv.as_mut()).unwrap();
assert_eq!(recv, vec![1, 2]);
r.read_exact(recv.as_mut()).unwrap();
assert_eq!(recv, vec![3, 4]);
Commit count: 0

cargo fmt