postage/stream/errors.rs
1use thiserror::Error;
2
3/// An error type returned by `Stream::try_recv`, when the stream has no messages, or is closed.
4#[derive(Debug, Error, PartialEq, Eq)]
5pub enum TryRecvError {
6 /// The stream may produce an item at a later time
7 #[error("TryRecvError::Pending")]
8 Pending,
9 /// The stream is closed, and will never produce an item
10 #[error("TryRecvError::Closed")]
11 Closed,
12}