#[derive(PartialEq, Debug)]
pub struct ChannelSendError<T>(pub T);
#[derive(PartialEq, Debug, Copy, Clone)]
pub enum TryReceiveError {
Empty,
Closed,
}
impl TryReceiveError {
pub fn is_empty(self) -> bool {
match self {
Self::Empty => true,
_ => false,
}
}
pub fn is_closed(self) -> bool {
match self {
Self::Closed => true,
_ => false,
}
}
}
#[derive(PartialEq, Debug)]
pub enum TrySendError<T> {
Full(T),
Closed(T),
}
impl<T> TrySendError<T> {
pub fn into_inner(self) -> T {
match self {
Self::Closed(inner) => inner,
Self::Full(inner) => inner,
}
}
pub fn is_full(&self) -> bool {
match self {
Self::Full(_) => true,
_ => false,
}
}
pub fn is_closed(&self) -> bool {
match self {
Self::Closed(_) => true,
_ => false,
}
}
}