messages 0.1.2

A midground between channels and actors.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use thiserror::Error;

/// Errors that can occur while sending the message.
#[derive(Debug, Error)]
pub enum SendError {
    #[error("Mailbox stopped accepting messages")]
    ReceiverDisconnected,
}

/// Errors that can occur while receiving the message.
#[derive(Debug, Error)]
pub enum ReceiveError {
    #[error("All the senders have disconnected")]
    AllSendersDisconnected,
    #[error("Mailbox received stop request and no longer accepts incoming messages")]
    Stopped,
}