Skip to main content

EventHandler

Trait EventHandler 

Source
pub trait EventHandler: Sized {
    type Error: From<Error> + Clone + Debug + Send + Sync + 'static;

Show 38 methods // Provided methods fn event<'life0, 'async_trait>( &'life0 self, context: Context, event: EventV1, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn authenticated<'life0, 'async_trait>( &'life0 self, context: Context, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn logout<'life0, 'async_trait>( &'life0 self, context: Context, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn pong<'life0, 'async_trait>( &'life0 self, context: Context, data: Ping, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn ready<'life0, 'async_trait>( &'life0 self, context: Context, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn message<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn message_update<'life0, 'async_trait>( &'life0 self, context: Context, before: Message, after: Message, partial: PartialMessage, clear: Vec<FieldsMessage>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn message_delete<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn message_react<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, user_id: String, emoji_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn message_unreact<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, user_id: String, emoji_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn message_remove_reaction<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, emoji_id: String, reactants: IndexSet<String>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn message_append<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, embeds: Vec<Embed>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn user_update<'life0, 'async_trait>( &'life0 self, context: Context, before: User, after: User, partial: PartialUser, clear: Vec<FieldsUser>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn bulk_message_delete<'life0, 'async_trait>( &'life0 self, context: Context, channel_id: String, message_ids: Vec<String>, found: Vec<Message>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn channel_create<'life0, 'async_trait>( &'life0 self, context: Context, channel: Channel, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn channel_update<'life0, 'async_trait>( &'life0 self, context: Context, before: Channel, after: Channel, partial: PartialChannel, clear: Vec<FieldsChannel>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn channel_delete<'life0, 'async_trait>( &'life0 self, context: Context, channel: Channel, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn channel_group_user_join<'life0, 'async_trait>( &'life0 self, context: Context, channel: Channel, user_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn channel_group_user_leave<'life0, 'async_trait>( &'life0 self, context: Context, channel: Channel, user_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn server_create<'life0, 'async_trait>( &'life0 self, context: Context, server: Server, channels: Vec<Channel>, emojis: Vec<Emoji>, voice_states: Vec<ChannelVoiceState>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn server_delete<'life0, 'async_trait>( &'life0 self, context: Context, server: Server, channels: Vec<Channel>, voice_states: Vec<ChannelVoiceState>, emojis: Vec<Emoji>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn server_update<'life0, 'async_trait>( &'life0 self, context: Context, before: Server, after: Server, partial: PartialServer, clear: Vec<FieldsServer>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn typing_start<'life0, 'async_trait>( &'life0 self, context: Context, channel_id: String, user_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn typing_stop<'life0, 'async_trait>( &'life0 self, context: Context, channel_id: String, user_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn server_member_join<'life0, 'async_trait>( &'life0 self, context: Context, member: Member, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn server_member_leave<'life0, 'async_trait>( &'life0 self, context: Context, member: Member, reason: RemovalIntention, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn server_member_update<'life0, 'async_trait>( &'life0 self, context: Context, before: Member, after: Member, partial: PartialMember, clear: Vec<FieldsMember>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn server_role_create<'life0, 'async_trait>( &'life0 self, context: Context, server_id: String, role: Role, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn server_role_update<'life0, 'async_trait>( &'life0 self, context: Context, server_id: String, before: Role, after: Role, partial: PartialRole, clear: Vec<FieldsRole>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn server_role_delete<'life0, 'async_trait>( &'life0 self, context: Context, server_id: String, role: Role, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn server_role_ranks_update<'life0, 'async_trait>( &'life0 self, context: Context, server_id: String, before: Vec<Role>, after: Vec<Role>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn user_voice_state_update<'life0, 'async_trait>( &'life0 self, context: Context, before: UserVoiceState, after: UserVoiceState, partial: PartialUserVoiceState, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn user_voice_channel_join<'life0, 'async_trait>( &'life0 self, context: Context, channel_id: String, user_voice_state: UserVoiceState, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn user_voice_channel_move<'life0, 'async_trait>( &'life0 self, context: Context, user_id: String, from: String, to: String, before: UserVoiceState, after: UserVoiceState, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn user_voice_channel_leave<'life0, 'async_trait>( &'life0 self, context: Context, user_id: String, user_voice_state: UserVoiceState, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn emoji_create<'life0, 'async_trait>( &'life0 self, context: Context, emoji: Emoji, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn emoji_delete<'life0, 'async_trait>( &'life0 self, context: Context, emoji: Emoji, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn error<'life0, 'async_trait>( &'life0 self, context: Context, error: Self::Error, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... }
}

Required Associated Types§

Source

type Error: From<Error> + Clone + Debug + Send + Sync + 'static

Provided Methods§

Source

fn event<'life0, 'async_trait>( &'life0 self, context: Context, event: EventV1, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn authenticated<'life0, 'async_trait>( &'life0 self, context: Context, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn logout<'life0, 'async_trait>( &'life0 self, context: Context, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn pong<'life0, 'async_trait>( &'life0 self, context: Context, data: Ping, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn ready<'life0, 'async_trait>( &'life0 self, context: Context, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn message<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn message_update<'life0, 'async_trait>( &'life0 self, context: Context, before: Message, after: Message, partial: PartialMessage, clear: Vec<FieldsMessage>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn message_delete<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn message_react<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, user_id: String, emoji_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn message_unreact<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, user_id: String, emoji_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn message_remove_reaction<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, emoji_id: String, reactants: IndexSet<String>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn message_append<'life0, 'async_trait>( &'life0 self, context: Context, message: Message, embeds: Vec<Embed>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn user_update<'life0, 'async_trait>( &'life0 self, context: Context, before: User, after: User, partial: PartialUser, clear: Vec<FieldsUser>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn bulk_message_delete<'life0, 'async_trait>( &'life0 self, context: Context, channel_id: String, message_ids: Vec<String>, found: Vec<Message>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn channel_create<'life0, 'async_trait>( &'life0 self, context: Context, channel: Channel, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn channel_update<'life0, 'async_trait>( &'life0 self, context: Context, before: Channel, after: Channel, partial: PartialChannel, clear: Vec<FieldsChannel>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn channel_delete<'life0, 'async_trait>( &'life0 self, context: Context, channel: Channel, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn channel_group_user_join<'life0, 'async_trait>( &'life0 self, context: Context, channel: Channel, user_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn channel_group_user_leave<'life0, 'async_trait>( &'life0 self, context: Context, channel: Channel, user_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn server_create<'life0, 'async_trait>( &'life0 self, context: Context, server: Server, channels: Vec<Channel>, emojis: Vec<Emoji>, voice_states: Vec<ChannelVoiceState>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn server_delete<'life0, 'async_trait>( &'life0 self, context: Context, server: Server, channels: Vec<Channel>, voice_states: Vec<ChannelVoiceState>, emojis: Vec<Emoji>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn server_update<'life0, 'async_trait>( &'life0 self, context: Context, before: Server, after: Server, partial: PartialServer, clear: Vec<FieldsServer>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn typing_start<'life0, 'async_trait>( &'life0 self, context: Context, channel_id: String, user_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn typing_stop<'life0, 'async_trait>( &'life0 self, context: Context, channel_id: String, user_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn server_member_join<'life0, 'async_trait>( &'life0 self, context: Context, member: Member, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn server_member_leave<'life0, 'async_trait>( &'life0 self, context: Context, member: Member, reason: RemovalIntention, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn server_member_update<'life0, 'async_trait>( &'life0 self, context: Context, before: Member, after: Member, partial: PartialMember, clear: Vec<FieldsMember>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn server_role_create<'life0, 'async_trait>( &'life0 self, context: Context, server_id: String, role: Role, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn server_role_update<'life0, 'async_trait>( &'life0 self, context: Context, server_id: String, before: Role, after: Role, partial: PartialRole, clear: Vec<FieldsRole>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn server_role_delete<'life0, 'async_trait>( &'life0 self, context: Context, server_id: String, role: Role, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn server_role_ranks_update<'life0, 'async_trait>( &'life0 self, context: Context, server_id: String, before: Vec<Role>, after: Vec<Role>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn user_voice_state_update<'life0, 'async_trait>( &'life0 self, context: Context, before: UserVoiceState, after: UserVoiceState, partial: PartialUserVoiceState, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn user_voice_channel_join<'life0, 'async_trait>( &'life0 self, context: Context, channel_id: String, user_voice_state: UserVoiceState, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn user_voice_channel_move<'life0, 'async_trait>( &'life0 self, context: Context, user_id: String, from: String, to: String, before: UserVoiceState, after: UserVoiceState, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn user_voice_channel_leave<'life0, 'async_trait>( &'life0 self, context: Context, user_id: String, user_voice_state: UserVoiceState, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn emoji_create<'life0, 'async_trait>( &'life0 self, context: Context, emoji: Emoji, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn emoji_delete<'life0, 'async_trait>( &'life0 self, context: Context, emoji: Emoji, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn error<'life0, 'async_trait>( &'life0 self, context: Context, error: Self::Error, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§