Crate message_channel

Crate message_channel 

Source
Expand description

§message-channel

message-channel is a simple, thread-safe channel implementation for sending and receiving messages between threads.

This crate provides a Channel struct that can be used to create a pair of Sender and Receiver for message passing.

§Examples

use message_channel::Channel;

let (sender, receiver) = Channel::create();

sender.send(42);
let message = receiver.recv().unwrap();
assert_eq!(message, 42);

Structs§

Channel
Receiver
A receiver for receiving messages from the channel.
Sender
A sender for sending messages to the channel.

Enums§

ChannelError
Custom error type for the Channel.