use thiserror::Error;
#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq, Hash)]
pub enum TrySendCheckedError<M> {
Full(M),
Closed(M),
NotAccepted(M),
}
#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq, Hash)]
pub enum SendCheckedError<M> {
Closed(M),
NotAccepted(M),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Error)]
pub enum TrySendError<M> {
#[error("Couldn't send message because Channel is closed")]
Closed(M),
#[error("Couldn't send message because Channel is full")]
Full(M),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Error)]
pub struct SendError<M>(pub M);
#[derive(Debug, thiserror::Error, Clone, Copy, PartialEq, Eq)]
pub enum RequestError<M, E> {
NoReply(E),
Closed(M),
}
#[derive(Debug, Error, Clone, Copy, PartialEq, Eq)]
pub enum TryRequestError<M, E> {
NoReply(E),
Closed(M),
Full(M),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Error)]
pub enum RecvError {
#[error("Couldn't receive because the process has been halted")]
Halted,
#[error("Couldn't receive becuase the channel is closed and empty")]
ClosedAndEmpty,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Error)]
pub enum TryRecvError {
#[error("Couldn't receive because the process has been halted")]
Halted,
#[error("Couldn't receive because the channel is empty")]
Empty,
#[error("Couldn't receive becuase the channel is closed and empty")]
ClosedAndEmpty,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Error)]
#[error("Process has been halted")]
pub struct Halted;