pub enum Error<E: Error> {
Backend(E),
PrivateChannelMissingRecipient(Box<Channel>),
ThreadMissingParent(Box<CachedChannel>),
CurrentUserMissing,
MemberRoleMissing {
user_id: Id<UserMarker>,
role_id: Id<RoleMarker>,
},
MemberBadTimeoutTimestamp(Box<CachedMember>),
PermissionsChannelMissing(Id<ChannelMarker>),
PermissionsGuildMissing(Id<GuildMarker>),
PermissionsMemberMissing {
user_id: Id<UserMarker>,
guild_id: Id<GuildMarker>,
},
PermissionsGuildEveryoneRoleMissing(Id<GuildMarker>),
PermissionsChannelNotInGuild(Box<CachedChannel>),
}Expand description
The errors the cache might return
Variants§
Backend(E)
An error was returned by the backend
PrivateChannelMissingRecipient(Box<Channel>)
The DM channel doesn’t have any recipients other than the bot itself
ThreadMissingParent(Box<CachedChannel>)
The thread doesn’t have a parent ID
CurrentUserMissing
The current user isn’t in the cache
MemberRoleMissing
One of the roles of the member to cache isn’t in the cache
MemberBadTimeoutTimestamp(Box<CachedMember>)
The member’s communication disabled until timestamp isn’t valid
PermissionsChannelMissing(Id<ChannelMarker>)
The channel to calculate permissions for isn’t in the cache
PermissionsGuildMissing(Id<GuildMarker>)
The guild to calculate permissions for isn’t in the cache
PermissionsMemberMissing
The member to calculate permissions for isn’t in the cache
PermissionsGuildEveryoneRoleMissing(Id<GuildMarker>)
The everyone role in the guild to calculate permissions for isn’t in the cache
PermissionsChannelNotInGuild(Box<CachedChannel>)
The given channel to calculate permissions for doesn’t have a guild ID
Trait Implementations§
Source§impl<E: Error> Error for Error<E>
impl<E: Error> Error for Error<E>
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<E> Freeze for Error<E>where
E: Freeze,
impl<E> RefUnwindSafe for Error<E>where
E: RefUnwindSafe,
impl<E> Send for Error<E>
impl<E> Sync for Error<E>where
E: Sync,
impl<E> Unpin for Error<E>where
E: Unpin,
impl<E> UnwindSafe for Error<E>where
E: UnwindSafe,
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