Skip to main content

Module channel

Module channel 

Source
Expand description

Transport for communication over futures channels.

Useful for testing and debugging.

§Example

let (mut left, mut right) = transports();

left.send("Hello World!").await.unwrap();
right.send(123).await.unwrap();

use dnet::Receive;
assert_eq!(right.receive().await.unwrap(), "Hello World!");
assert_eq!(left.receive().await.unwrap(), 123);

Structs§

ChannelTransport
Channel transport.

Enums§

Error
Channel transport error.

Functions§

transports
Create two connected transports over two unbounded channels.