2 releases
0.1.1 | Sep 13, 2023 |
---|---|
0.1.0 | Jan 2, 2023 |
#1894 in Asynchronous
32 downloads per month
Used in mezzenger-utils
19KB
358 lines
mezzenger-channel
Transport for communication over futures channels.
https://crates.io/crates/mezzenger-channel
usage
Add dependencies to Cargo.toml
:
[dependencies]
# ...
mezzenger = "0.1.3"
mezzenger-channel = "0.1.0"
Example code:
let (mut left, mut right) = transports();
left.send("Hello World!").await.unwrap();
right.send(123).await.unwrap();
use mezzenger::Receive;
assert_eq!(right.receive().await.unwrap(), "Hello World!");
assert_eq!(left.receive().await.unwrap(), 123);
see also
lib.rs
:
Transport for communication over futures channels.
Useful for testing and debugging.
See repository for more info.
Example
let (mut left, mut right) = transports();
left.send("Hello World!").await.unwrap();
right.send(123).await.unwrap();
use mezzenger::Receive;
assert_eq!(right.receive().await.unwrap(), "Hello World!");
assert_eq!(left.receive().await.unwrap(), 123);
Dependencies
~1–1.6MB
~33K SLoC