openraft_rt/mpsc/send_error.rs
1use std::fmt;
2
3/// Error returned by the `Sender`.
4#[derive(PartialEq, Eq, Clone, Copy)]
5pub struct SendError<T>(pub T);
6
7impl<T> fmt::Debug for SendError<T> {
8 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9 f.debug_struct("SendError").finish_non_exhaustive()
10 }
11}
12
13impl<T> fmt::Display for SendError<T> {
14 fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
15 write!(fmt, "channel closed")
16 }
17}
18
19impl<T> std::error::Error for SendError<T> {}