Crates.io | framed_pipe |
lib.rs | framed_pipe |
version | 0.1.0 |
source | src |
created_at | 2023-08-24 19:35:37.54427 |
updated_at | 2023-08-24 19:35:37.54427 |
description | mpsc based pipe for frames |
homepage | |
repository | https://github.com/jon-zu/framed_pipe |
max_upload_size | |
id | 954131 |
size | 13,735 |
MPSC-based Pipe to read/write frames, somewhat like a message box over bytes
let (tx, mut rx) = framed_pipe(n * 2, 4);
let echo_data = vec![vec![0xFF; n], vec![1, 2], vec![], vec![0x0; n / 2]];
for _ in 0..100 {
for data in echo_data.iter() {
tx.clone().try_send(data).expect("send");
}
for data in echo_data.iter() {
let rx_data = rx.next().await.unwrap().expect("rx");
assert_eq!(&rx_data, data.as_slice());
}
}