multistream_batch/channel.rs
1//! Batch implementations that use channels and threads to support simultaneously receiving items and awaiting on timeouts.
2//!
3//! These implementations are using `crossbeam_channel` to implement awaiting for items or timeout.
4
5pub mod buf_batch;
6pub mod multi_buf_batch;
7pub mod tx_buf_batch;
8
9use std::error::Error;
10use std::fmt;
11
12/// The error that is returned by channel based implementations when `Sender` end of
13/// the channel was dropped and no more outstanding items are left to be provided.
14#[derive(PartialEq, Eq, Clone, Copy, Debug)]
15pub struct EndOfStreamError;
16
17impl fmt::Display for EndOfStreamError {
18 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
19 write!(f, "no more items will be provided to this batch")
20 }
21}
22
23impl Error for EndOfStreamError {}