Crates.io | oneshot-handshake |
lib.rs | oneshot-handshake |
version | 0.1.5 |
source | src |
created_at | 2024-06-18 15:55:34.656103 |
updated_at | 2024-06-27 20:48:30.348354 |
description | A crate providing a symmetric one time use channel type. |
homepage | |
repository | https://github.com/Vi-Kitten/Handshake |
max_upload_size | |
id | 1275610 |
size | 22,264 |
Symmetric one time use channels.
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(())