pending_requests/error.rs
1pub type Result<T> = std::result::Result<T, Error>;
2
3#[derive(thiserror::Error, Debug)]
4pub enum Error {
5 /// A request with the same key is already pending.
6 #[error("key already exists")]
7 KeyAlreadyExists,
8 /// No pending request was found for the given key.
9 #[error("key not found")]
10 KeyNotFound,
11 /// The request was not answered within its timeout.
12 #[error("request timed out")]
13 RequestTimeout,
14 /// The waiter was dropped before a response could be delivered.
15 #[error("receiver dropped")]
16 ReceiverDropped,
17 /// The pending request was canceled (explicitly or because the
18 /// owning `PendingRequests` was dropped) before a response arrived.
19 #[error("request canceled")]
20 Canceled,
21}