pub enum Error {
PublishError(String),
SubscriptionError(String),
EventNotRegistered {
type_name: String,
},
SubscriptionNotFound {
id: Uuid,
},
HandlerError(String),
ShuttingDown,
ChannelSendError,
ChannelReceiveError,
SerializationError(String),
ConfigError(String),
Internal(String),
}Expand description
Main error type for tokio-events
Variants§
PublishError(String)
Event publishing failed
SubscriptionError(String)
Subscription failed
EventNotRegistered
Event not found in registry
SubscriptionNotFound
Subscription not found
HandlerError(String)
Event handler error
ShuttingDown
Event bus is shutting down
ChannelSendError
Channel send error
ChannelReceiveError
Channel receive error
SerializationError(String)
Serialization error
ConfigError(String)
Configuration error
Internal(String)
Generic internal error
Implementations§
Source§impl Error
impl Error
Sourcepub fn internal(msg: impl Into<String>) -> Self
pub fn internal(msg: impl Into<String>) -> Self
Create a new internal error with a custom message
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Check if this error indicates the system is shutting down
Sourcepub fn is_channel_error(&self) -> bool
pub fn is_channel_error(&self) -> bool
Check if this is a channel-related error
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more