#[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§
Source§impl<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§
Source§impl<'de, E> Deserialize<'de> for Message<E>where
E: EventSubscription + Clone,
impl<'de, E> Deserialize<'de> for Message<E>where
E: EventSubscription + Clone,
Source§fn 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
impl<E: EventSubscription + Clone> StructuralPartialEq for Message<E>
Auto Trait Implementations§
impl<E> Freeze for Message<E>
impl<E> RefUnwindSafe for Message<E>
impl<E> Send for Message<E>
impl<E> Sync for Message<E>
impl<E> Unpin for Message<E>
impl<E> UnwindSafe for Message<E>
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