1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
//! Communication primitives

mod cell;
pub mod condition;
pub mod mpsc;
pub mod oneshot;
pub mod pool;

/// Error returned from a `Receiver` when the corresponding
/// `Sender` is dropped.
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct Canceled;

impl std::fmt::Display for Canceled {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        std::write!(f, "oneshot canceled")
    }
}

impl std::error::Error for Canceled {}