#channel #bidirectional #symmetric #linear #handshake #time #send

bin+lib oneshot-handshake

A crate providing a symmetric one time use channel type

6 releases

0.1.5 Jun 27, 2024
0.1.4 Jun 18, 2024

#740 in Asynchronous

Download history 274/week @ 2024-06-14 131/week @ 2024-06-21 78/week @ 2024-06-28 46/week @ 2024-07-05

255 downloads per month

MIT license

21KB
311 lines

Handshake

Symmetric one time use channels.

Example

Allows each end of the handshake to send or receive information for bi-directional movement of data:

let (u, v) = oneshot_handshake::channel::<Box<str>>();
let combine = |x, y| format!("{} {}!", x, y);

'_task_a: {
    u.join("Handle Communication".into(), combine)
        .unwrap()
        .map(|s| println!("{}", s));
} // None

'_task_b: {
    v.join("Symmetrically".into(), combine)
        .unwrap()
        .map(|s| println!("{}", s));
} // Some(())

No runtime deps