diff --git a/src/channel.rs b/src/channel.rs index 18e59ba..df78080 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -1,6 +1,8 @@ //! Channels which can be used by the `ChannelReporter` and `ChannelEventListener`. use crate::Disconnect; +use std::fmt::Formatter; +use std::{any, fmt}; // --- Event channel variants @@ -32,7 +34,13 @@ impl EventReceiver { #[derive(PartialEq, Eq, Clone, Copy)] pub struct EventSendError(pub T); -#[derive(PartialEq, Eq, Clone, Copy)] +impl fmt::Debug for EventSendError { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_fmt(format_args!("EventSendError({})", any::type_name::())) + } +} + +#[derive(Debug, PartialEq, Eq, Clone, Copy)] pub struct EventRecvError; // --- Disconnect channel variants diff --git a/src/reporter/channel_reporter.rs b/src/reporter/channel_reporter.rs index 855c6a9..0716f68 100644 --- a/src/reporter/channel_reporter.rs +++ b/src/reporter/channel_reporter.rs @@ -61,6 +61,7 @@ impl Reporter for ChannelReporter { } } +#[derive(Debug)] pub enum ReporterError { SendError(crate::EventSendError), DisconnectError(crate::DisconnectRecvError),