oneshot-handshake

Crates.iooneshot-handshake
lib.rsoneshot-handshake
version0.1.5
sourcesrc
created_at2024-06-18 15:55:34.656103
updated_at2024-06-27 20:48:30.348354
descriptionA crate providing a symmetric one time use channel type.
homepage
repositoryhttps://github.com/Vi-Kitten/Handshake
max_upload_size
id1275610
size22,264
Kit (Vi-Kitten)

documentation

README

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(())
Commit count: 26

cargo fmt