Enum twitch_api2::eventsub::Payload[][src]

pub enum Payload {
Show variants VerificationRequest(VerificationRequest), ChannelUpdateV1(NotificationPayload<ChannelUpdateV1>), ChannelFollowV1(NotificationPayload<ChannelFollowV1>), ChannelSubscribeV1(NotificationPayload<ChannelSubscribeV1>), ChannelCheerV1(NotificationPayload<ChannelCheerV1>), ChannelBanV1(NotificationPayload<ChannelBanV1>), ChannelUnbanV1(NotificationPayload<ChannelUnbanV1>), ChannelPointsCustomRewardAddV1(NotificationPayload<ChannelPointsCustomRewardAddV1>), ChannelPointsCustomRewardUpdateV1(NotificationPayload<ChannelPointsCustomRewardUpdateV1>), ChannelPointsCustomRewardRemoveV1(NotificationPayload<ChannelPointsCustomRewardRemoveV1>), ChannelPointsCustomRewardRedemptionAddV1(NotificationPayload<ChannelPointsCustomRewardRedemptionAddV1>), ChannelPointsCustomRewardRedemptionUpdateV1(NotificationPayload<ChannelPointsCustomRewardRedemptionUpdateV1>), ChannelHypeTrainBeginV1(NotificationPayload<ChannelHypeTrainBeginV1>), ChannelHypeTrainProgressV1(NotificationPayload<ChannelHypeTrainProgressV1>), ChannelHypeTrainEndV1(NotificationPayload<ChannelHypeTrainEndV1>), StreamOnlineV1(NotificationPayload<StreamOnlineV1>), StreamOfflineV1(NotificationPayload<StreamOfflineV1>), UserUpdateV1(NotificationPayload<UserUpdateV1>), UserAuthorizationRevokeV1(NotificationPayload<UserAuthorizationRevokeV1>), ChannelRaidV1(NotificationPayload<ChannelRaidV1>),
}
This is supported on crate feature eventsub only.

Subscription payload. Received on events. Enumerates all possible NotificationPayloads

Use Payload::parse to construct

Variants

VerificationRequest(VerificationRequest)

Webhook Callback Verification

Channel Update V1 Event

Channel Follow V1 Event

Channel Subscribe V1 Event

Channel Cheer V1 Event

Channel Ban V1 Event

Channel Unban V1 Event

ChannelPointsCustomRewardAddV1(NotificationPayload<ChannelPointsCustomRewardAddV1>)

Channel Points Custom Reward Add V1 Event

ChannelPointsCustomRewardUpdateV1(NotificationPayload<ChannelPointsCustomRewardUpdateV1>)

Channel Points Custom Reward Update V1 Event

ChannelPointsCustomRewardRemoveV1(NotificationPayload<ChannelPointsCustomRewardRemoveV1>)

Channel Points Custom Reward Remove V1 Event

ChannelPointsCustomRewardRedemptionAddV1(NotificationPayload<ChannelPointsCustomRewardRedemptionAddV1>)

Channel Points Custom Reward Redemption Add V1 Event

ChannelPointsCustomRewardRedemptionUpdateV1(NotificationPayload<ChannelPointsCustomRewardRedemptionUpdateV1>)

Channel Points Custom Reward Redemption Update V1 Event

Channel Hype Train Begin V1 Event

ChannelHypeTrainProgressV1(NotificationPayload<ChannelHypeTrainProgressV1>)

Channel Hype Train Progress V1 Event

Channel Hype Train End V1 Event

StreamOnline V1 Event

StreamOffline V1 Event

User Update V1 Event

User Authorization Revoke V1 Event

Channel Raid V1 Event

Implementations

impl Payload[src]

pub fn parse(source: &str) -> Result<Payload, PayloadParseError>[src]

Parse string slice as a Payload

pub fn parse_http(
    request: &Request<Vec<u8>>
) -> Result<Payload, PayloadParseError>
[src]

Parse http post request as a Payload.

pub fn verify_payload(request: &Request<Vec<u8>>, secret: &[u8]) -> bool[src]

This is supported on crate feature hmac only.

Verify that this payload is authentic using HMAC-SHA256.

HMAC key is secret, HMAC message is a concatenation of Twitch-Eventsub-Message-Id header, Twitch-Eventsub-Message-Timestamp header and the request body. HMAC signature is Twitch-Eventsub-Message-Signature header

Trait Implementations

impl Clone for Payload[src]

fn clone(&self) -> Payload[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Payload[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for Payload[src]

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>[src]

Deserialize this value from the given Serde deserializer. Read more

impl PartialEq<Payload> for Payload[src]

fn eq(&self, other: &Payload) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Payload) -> bool[src]

This method tests for !=.

impl Serialize for Payload[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl StructuralPartialEq for Payload[src]

Auto Trait Implementations

impl RefUnwindSafe for Payload

impl Send for Payload

impl Sync for Payload

impl Unpin for Payload

impl UnwindSafe for Payload

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> WithSubscriber for T[src]

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
    S: Into<Dispatch>, 
[src]

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

fn with_current_subscriber(self) -> WithDispatch<Self>[src]

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]