use thiserror::Error; use tokio::sync::{mpsc, oneshot}; /// Network Errors #[derive(Error, Debug, Clone, PartialEq, Eq)] pub enum NetworkError { /// Indicates that the sender has been dropped. #[error("sender has been dropped")] ChannelClosed, } impl From> for NetworkError { fn from(_: mpsc::error::SendError) -> Self { Self::ChannelClosed } } impl From for NetworkError { fn from(_: oneshot::error::RecvError) -> Self { Self::ChannelClosed } }