1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
use thiserror::Error;

/// An error type returned by `Stream::try_recv`, when the stream has no messages, or is closed.
#[derive(Debug, Error)]
pub enum TryRecvError {
    /// The stream may produce an item at a later time
    #[error("TryRecvError::Pending")]
    Pending,
    /// The stream is closed, and will never produce an item
    #[error("TryRecvError::Rejected")]
    Rejected,
}