Enum serenity::collector::CollectorError
source · [−]#[non_exhaustive]
pub enum CollectorError {
NoEventTypes,
InvalidEventIdFilters,
}
Expand description
An error that occured while working with a collector.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NoEventTypes
No event types were passed to add_event_type.
InvalidEventIdFilters
The combination of event types and ID filters used with EventCollectorBuilder is invalid and will never match any events.
For example, the following always errors because GuildCreate never has a related user ID:
assert!(matches!(
EventCollectorBuilder::new(&ctx)
.add_event_type(EventType::GuildCreate)
.add_user_id(UserId::default())
.await,
Err(SerenityError::Collector(CollectorError::InvalidEventIdFilters)),
));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Error
impl UnwindSafe for Error
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more