Skip to main content

ntex_util/channel/
mod.rs

1//! Asynchronous communication primitives.
2//!
3//! These channels are primarily intended for local, single-threaded ntex
4//! tasks. Individual modules document their ownership and backpressure
5//! behavior.
6
7mod cell;
8
9pub mod bstream;
10pub mod condition;
11pub mod inplace;
12pub mod mpsc;
13pub mod oneshot;
14pub mod pool;
15
16/// Error returned when a channel is canceled before producing a value.
17#[derive(Clone, Copy, PartialEq, Eq, Debug)]
18pub struct Canceled;
19
20impl std::fmt::Display for Canceled {
21    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22        std::write!(f, "oneshot canceled")
23    }
24}
25
26impl std::error::Error for Canceled {}