framed_pipe

Crates.ioframed_pipe
lib.rsframed_pipe
version0.1.0
sourcesrc
created_at2023-08-24 19:35:37.54427
updated_at2023-08-24 19:35:37.54427
descriptionmpsc based pipe for frames
homepage
repositoryhttps://github.com/jon-zu/framed_pipe
max_upload_size
id954131
size13,735
Jonas Zunker (jon-zu)

documentation

README

Framed Pipe

MPSC-based Pipe to read/write frames, somewhat like a message box over bytes

Example

    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());
        }
    }
Commit count: 3

cargo fmt