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

pub enum Payload {
Show 34 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>), ChannelPollBeginV1(NotificationPayload<ChannelPollBeginV1>), ChannelPollProgressV1(NotificationPayload<ChannelPollProgressV1>), ChannelPollEndV1(NotificationPayload<ChannelPollEndV1>), ChannelPredictionBeginV1(NotificationPayload<ChannelPredictionBeginV1>), ChannelPredictionProgressV1(NotificationPayload<ChannelPredictionProgressV1>), ChannelPredictionLockV1(NotificationPayload<ChannelPredictionLockV1>), ChannelPredictionEndV1(NotificationPayload<ChannelPredictionEndV1>), ChannelGoalBeginV1(NotificationPayload<ChannelGoalBeginV1>), ChannelGoalProgressV1(NotificationPayload<ChannelGoalProgressV1>), ChannelGoalEndV1(NotificationPayload<ChannelGoalEndV1>), ChannelHypeTrainBeginV1(NotificationPayload<ChannelHypeTrainBeginV1>), ChannelHypeTrainProgressV1(NotificationPayload<ChannelHypeTrainProgressV1>), ChannelHypeTrainEndV1(NotificationPayload<ChannelHypeTrainEndV1>), StreamOnlineV1(NotificationPayload<StreamOnlineV1>), StreamOfflineV1(NotificationPayload<StreamOfflineV1>), UserUpdateV1(NotificationPayload<UserUpdateV1>), UserAuthorizationGrantV1(NotificationPayload<UserAuthorizationGrantV1>), UserAuthorizationRevokeV1(NotificationPayload<UserAuthorizationRevokeV1>), ChannelRaidV1(NotificationPayload<ChannelRaidV1>), ChannelSubscriptionEndV1(NotificationPayload<ChannelSubscriptionEndV1>), ChannelSubscriptionGiftV1(NotificationPayload<ChannelSubscriptionGiftV1>), ChannelSubscriptionMessageV1(NotificationPayload<ChannelSubscriptionMessageV1>),
}
Expand description

Subscription payload. Received on events. Enumerates all possible NotificationPayloads

Use Payload::parse to construct

Variants

VerificationRequest(VerificationRequest)

Webhook Callback Verification

Tuple Fields of VerificationRequest

0: VerificationRequest

Channel Update V1 Event

Tuple Fields of ChannelUpdateV1

0: NotificationPayload<ChannelUpdateV1>

Channel Follow V1 Event

Tuple Fields of ChannelFollowV1

0: NotificationPayload<ChannelFollowV1>

Channel Subscribe V1 Event

Tuple Fields of ChannelSubscribeV1

0: NotificationPayload<ChannelSubscribeV1>

Channel Cheer V1 Event

Tuple Fields of ChannelCheerV1

0: NotificationPayload<ChannelCheerV1>

Channel Ban V1 Event

Tuple Fields of ChannelBanV1

0: NotificationPayload<ChannelBanV1>

Channel Unban V1 Event

Tuple Fields of ChannelUnbanV1

0: NotificationPayload<ChannelUnbanV1>
ChannelPointsCustomRewardAddV1(NotificationPayload<ChannelPointsCustomRewardAddV1>)

Channel Points Custom Reward Add V1 Event

Tuple Fields of ChannelPointsCustomRewardAddV1

0: NotificationPayload<ChannelPointsCustomRewardAddV1>
ChannelPointsCustomRewardUpdateV1(NotificationPayload<ChannelPointsCustomRewardUpdateV1>)

Channel Points Custom Reward Update V1 Event

Tuple Fields of ChannelPointsCustomRewardUpdateV1

0: NotificationPayload<ChannelPointsCustomRewardUpdateV1>
ChannelPointsCustomRewardRemoveV1(NotificationPayload<ChannelPointsCustomRewardRemoveV1>)

Channel Points Custom Reward Remove V1 Event

Tuple Fields of ChannelPointsCustomRewardRemoveV1

0: NotificationPayload<ChannelPointsCustomRewardRemoveV1>
ChannelPointsCustomRewardRedemptionAddV1(NotificationPayload<ChannelPointsCustomRewardRedemptionAddV1>)

Channel Points Custom Reward Redemption Add V1 Event

Tuple Fields of ChannelPointsCustomRewardRedemptionAddV1

0: NotificationPayload<ChannelPointsCustomRewardRedemptionAddV1>
ChannelPointsCustomRewardRedemptionUpdateV1(NotificationPayload<ChannelPointsCustomRewardRedemptionUpdateV1>)

Channel Points Custom Reward Redemption Update V1 Event

Tuple Fields of ChannelPointsCustomRewardRedemptionUpdateV1

0: NotificationPayload<ChannelPointsCustomRewardRedemptionUpdateV1>

Channel Poll Begin V1 Event

Tuple Fields of ChannelPollBeginV1

0: NotificationPayload<ChannelPollBeginV1>

Channel Poll Progress V1 Event

Tuple Fields of ChannelPollProgressV1

0: NotificationPayload<ChannelPollProgressV1>

Channel Poll End V1 Event

Tuple Fields of ChannelPollEndV1

0: NotificationPayload<ChannelPollEndV1>

Channel Prediction Begin V1 Event

Tuple Fields of ChannelPredictionBeginV1

0: NotificationPayload<ChannelPredictionBeginV1>
ChannelPredictionProgressV1(NotificationPayload<ChannelPredictionProgressV1>)

Channel Prediction Progress V1 Event

Tuple Fields of ChannelPredictionProgressV1

0: NotificationPayload<ChannelPredictionProgressV1>

Channel Prediction Lock V1 Event

Tuple Fields of ChannelPredictionLockV1

0: NotificationPayload<ChannelPredictionLockV1>

Channel Prediction End V1 Event

Tuple Fields of ChannelPredictionEndV1

0: NotificationPayload<ChannelPredictionEndV1>

Channel Goal Begin V1 Event

Tuple Fields of ChannelGoalBeginV1

0: NotificationPayload<ChannelGoalBeginV1>

Channel Goal Progress V1 Event

Tuple Fields of ChannelGoalProgressV1

0: NotificationPayload<ChannelGoalProgressV1>

Channel Goal End V1 Event

Tuple Fields of ChannelGoalEndV1

0: NotificationPayload<ChannelGoalEndV1>

Channel Hype Train Begin V1 Event

Tuple Fields of ChannelHypeTrainBeginV1

0: NotificationPayload<ChannelHypeTrainBeginV1>
ChannelHypeTrainProgressV1(NotificationPayload<ChannelHypeTrainProgressV1>)

Channel Hype Train Progress V1 Event

Tuple Fields of ChannelHypeTrainProgressV1

0: NotificationPayload<ChannelHypeTrainProgressV1>

Channel Hype Train End V1 Event

Tuple Fields of ChannelHypeTrainEndV1

0: NotificationPayload<ChannelHypeTrainEndV1>

StreamOnline V1 Event

Tuple Fields of StreamOnlineV1

0: NotificationPayload<StreamOnlineV1>

StreamOffline V1 Event

Tuple Fields of StreamOfflineV1

0: NotificationPayload<StreamOfflineV1>

User Update V1 Event

Tuple Fields of UserUpdateV1

0: NotificationPayload<UserUpdateV1>

User Authorization Grant V1 Event

Tuple Fields of UserAuthorizationGrantV1

0: NotificationPayload<UserAuthorizationGrantV1>

User Authorization Revoke V1 Event

Tuple Fields of UserAuthorizationRevokeV1

0: NotificationPayload<UserAuthorizationRevokeV1>

Channel Raid V1 Event

Tuple Fields of ChannelRaidV1

0: NotificationPayload<ChannelRaidV1>

Channel Subscription End V1 Event

Tuple Fields of ChannelSubscriptionEndV1

0: NotificationPayload<ChannelSubscriptionEndV1>

Channel Subscription Gift V1 Event

Tuple Fields of ChannelSubscriptionGiftV1

0: NotificationPayload<ChannelSubscriptionGiftV1>
ChannelSubscriptionMessageV1(NotificationPayload<ChannelSubscriptionMessageV1>)

Channel Subscription Message V1 Event

Tuple Fields of ChannelSubscriptionMessageV1

0: NotificationPayload<ChannelSubscriptionMessageV1>

Implementations

Parse string slice as a Payload

Parse http post request as a Payload.

If your Request<B> is of another type that doesn’t implement AsRef<[u8]>, try converting it with Request::map

use http::Request;
use twitch_api2::eventsub::Payload;
// Example of a request with a body that doesn't implement `AsRef<[u8]>`
let original_request: Request<Body> = http::Request::new(Body::new());
// Convert to a request with a body of `Vec<u8>`, which does implement `AsRef<[u8]>`
let converted_request: Request<Vec<u8>> = original_request.map(|r| r.to_bytes().to_owned());
Payload::parse_http(&converted_request)?

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

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

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

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

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

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

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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

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

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