TryRecvError
TryRecvError is an error type used by Rust’s channel primitives to signal the outcome of a non-blocking receive operation. It appears when attempting to retrieve a message without waiting, via the try_recv method on a channel’s receiver. The type is commonly found as std::sync::mpsc::TryRecvError in the standard library, and similar variants exist in other channel implementations such as crossbeam.
The TryRecvError enum has two variants: Empty and Disconnected. Empty indicates that no message is currently
In practice, try_recv returns a Result<T, TryRecvError>. A successful Ok(value) means a message was retrieved immediately.
Related concepts include TrySend and Recv, which cover non-blocking sends and blocking receives, respectively. TryRecvError is