futures_bounded/
lib.rs

1mod map;
2mod set;
3
4pub use map::{FuturesMap, PushError};
5pub use set::FuturesSet;
6use std::fmt;
7use std::fmt::Formatter;
8use std::time::Duration;
9
10/// A future failed to complete within the given timeout.
11#[derive(Debug)]
12pub struct Timeout {
13    limit: Duration,
14}
15
16impl Timeout {
17    fn new(duration: Duration) -> Self {
18        Self { limit: duration }
19    }
20}
21
22impl fmt::Display for Timeout {
23    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
24        write!(f, "future failed to complete within {:?}", self.limit)
25    }
26}
27
28impl std::error::Error for Timeout {}