pub trait Event:
Copy
+ Send
+ Sync
+ 'static
+ Sealed {
type Payload: Send + Sync + 'static;
const NAME: &'static str;
const INTENTS: Intents;
}Expand description
A typed event that can be passed to Client::on.
Implemented by the zero-sized event types on Events; sealed, so the set of events is
controlled by this crate.
discord.js counterpart: a member of Events (each one a type here).
Required Associated Constants§
Sourceconst INTENTS: Intents
const INTENTS: Intents
The gateway intents
Discord sends this event under: the client receives it if it requests any of them (for
MessageCreate guild messages come with GUILD_MESSAGES, direct messages with
DIRECT_MESSAGES). Empty for events sent without an intent, such as
InteractionCreate or the client’s own lifecycle events. The client warns at login
about handlers whose events none of its intents cover (D-271).
Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".