Enum twitch_api::eventsub::Message
source · [−]#[non_exhaustive]
pub enum Message<E: EventSubscription + Clone> {
VerificationRequest(VerificationRequest),
Revocation(),
Notification(<E as EventSubscription>::Payload),
}
Available on crate feature
eventsub
only.Expand description
Subscription message/payload. Received on events and other messages.
Use Event::parse_http
to construct
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.
VerificationRequest(VerificationRequest)
Webhook Callback Verification
Revocation()
Notification(<E as EventSubscription>::Payload)
A notification holding some event data.
Implementations
sourceimpl<E: EventSubscription + Clone> Message<E>
impl<E: EventSubscription + Clone> Message<E>
sourcepub fn is_verification_request(&self) -> bool
pub fn is_verification_request(&self) -> bool
Returns true
if the message is VerificationRequest
.
sourcepub fn is_revocation(&self) -> bool
pub fn is_revocation(&self) -> bool
Returns true
if the message is Revocation
.
sourcepub fn is_notification(&self) -> bool
pub fn is_notification(&self) -> bool
Returns true
if the message is Notification
.
Trait Implementations
sourceimpl<'de, E: EventSubscription + Clone> Deserialize<'de> for Message<E>where
E: EventSubscription,
impl<'de, E: EventSubscription + Clone> Deserialize<'de> for Message<E>where
E: EventSubscription,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<E: PartialEq + EventSubscription + Clone> PartialEq<Message<E>> for Message<E>
impl<E: PartialEq + EventSubscription + Clone> PartialEq<Message<E>> for Message<E>
sourceimpl<E: EventSubscription + Clone> Serialize for Message<E>where
E: EventSubscription,
impl<E: EventSubscription + Clone> Serialize for Message<E>where
E: EventSubscription,
impl<E: EventSubscription + Clone> StructuralPartialEq for Message<E>
Auto Trait Implementations
impl<E> RefUnwindSafe for Message<E>where
<E as EventSubscription>::Payload: RefUnwindSafe,
impl<E> Send for Message<E>where
<E as EventSubscription>::Payload: Send,
impl<E> Sync for Message<E>where
<E as EventSubscription>::Payload: Sync,
impl<E> Unpin for Message<E>where
<E as EventSubscription>::Payload: Unpin,
impl<E> UnwindSafe for Message<E>where
<E as EventSubscription>::Payload: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more