#[non_exhaustive]pub struct WebhookEvent {
pub timestamp: Timestamp,
pub data: WebhookEventData,
}Expand description
The event body of a webhook event: when it happened and its data.
discord.js counterpart: APIWebhookEvent (discord-api-types).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.timestamp: TimestampWhen the event occurred. Discord sends it without an offset; it is read as UTC.
data: WebhookEventDataThe event’s data, by type.
Implementations§
Source§impl WebhookEvent
impl WebhookEvent
Sourcepub fn kind(&self) -> WebhookEventType
pub fn kind(&self) -> WebhookEventType
Returns the event’s type.
discord.js counterpart: ApplicationWebhookEventType (discord-api-types).
Trait Implementations§
Source§impl Clone for WebhookEvent
impl Clone for WebhookEvent
Source§impl Debug for WebhookEvent
impl Debug for WebhookEvent
Source§impl<'de> Deserialize<'de> for WebhookEvent
impl<'de> Deserialize<'de> for WebhookEvent
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for WebhookEvent
impl PartialEq for WebhookEvent
Source§impl Serialize for WebhookEvent
impl Serialize for WebhookEvent
impl StructuralPartialEq for WebhookEvent
Auto Trait Implementations§
impl Forget for WebhookEvent
impl Freeze for WebhookEvent
impl Move for WebhookEvent
impl RefUnwindSafe for WebhookEvent
impl Send for WebhookEvent
impl Sync for WebhookEvent
impl Unpin for WebhookEvent
impl UnsafeUnpin for WebhookEvent
impl UnwindSafe for WebhookEvent
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