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 NotificationPayload
s
Use Payload::parse
to construct
Variants
VerificationRequest(VerificationRequest)
Webhook Callback Verification
Tuple Fields of VerificationRequest
ChannelUpdateV1(NotificationPayload<ChannelUpdateV1>)
Channel Update V1 Event
Tuple Fields of ChannelUpdateV1
ChannelFollowV1(NotificationPayload<ChannelFollowV1>)
Channel Follow V1 Event
Tuple Fields of ChannelFollowV1
ChannelSubscribeV1(NotificationPayload<ChannelSubscribeV1>)
Channel Subscribe V1 Event
Tuple Fields of ChannelSubscribeV1
ChannelCheerV1(NotificationPayload<ChannelCheerV1>)
Channel Cheer V1 Event
Tuple Fields of ChannelCheerV1
ChannelBanV1(NotificationPayload<ChannelBanV1>)
Channel Ban V1 Event
Tuple Fields of ChannelBanV1
ChannelUnbanV1(NotificationPayload<ChannelUnbanV1>)
Channel Unban V1 Event
Tuple Fields of ChannelUnbanV1
ChannelPointsCustomRewardAddV1(NotificationPayload<ChannelPointsCustomRewardAddV1>)
Channel Points Custom Reward Add V1 Event
Tuple Fields of ChannelPointsCustomRewardAddV1
ChannelPointsCustomRewardUpdateV1(NotificationPayload<ChannelPointsCustomRewardUpdateV1>)
Channel Points Custom Reward Update V1 Event
Tuple Fields of ChannelPointsCustomRewardUpdateV1
ChannelPointsCustomRewardRemoveV1(NotificationPayload<ChannelPointsCustomRewardRemoveV1>)
Channel Points Custom Reward Remove V1 Event
Tuple Fields of ChannelPointsCustomRewardRemoveV1
ChannelPointsCustomRewardRedemptionAddV1(NotificationPayload<ChannelPointsCustomRewardRedemptionAddV1>)
Channel Points Custom Reward Redemption Add V1 Event
Tuple Fields of ChannelPointsCustomRewardRedemptionAddV1
ChannelPointsCustomRewardRedemptionUpdateV1(NotificationPayload<ChannelPointsCustomRewardRedemptionUpdateV1>)
Channel Points Custom Reward Redemption Update V1 Event
Tuple Fields of ChannelPointsCustomRewardRedemptionUpdateV1
ChannelPollBeginV1(NotificationPayload<ChannelPollBeginV1>)
Channel Poll Begin V1 Event
Tuple Fields of ChannelPollBeginV1
ChannelPollProgressV1(NotificationPayload<ChannelPollProgressV1>)
Channel Poll Progress V1 Event
Tuple Fields of ChannelPollProgressV1
ChannelPollEndV1(NotificationPayload<ChannelPollEndV1>)
Channel Poll End V1 Event
Tuple Fields of ChannelPollEndV1
ChannelPredictionBeginV1(NotificationPayload<ChannelPredictionBeginV1>)
Channel Prediction Begin V1 Event
Tuple Fields of ChannelPredictionBeginV1
ChannelPredictionProgressV1(NotificationPayload<ChannelPredictionProgressV1>)
Channel Prediction Progress V1 Event
Tuple Fields of ChannelPredictionProgressV1
ChannelPredictionLockV1(NotificationPayload<ChannelPredictionLockV1>)
Channel Prediction Lock V1 Event
Tuple Fields of ChannelPredictionLockV1
ChannelPredictionEndV1(NotificationPayload<ChannelPredictionEndV1>)
Channel Prediction End V1 Event
Tuple Fields of ChannelPredictionEndV1
ChannelGoalBeginV1(NotificationPayload<ChannelGoalBeginV1>)
Channel Goal Begin V1 Event
Tuple Fields of ChannelGoalBeginV1
ChannelGoalProgressV1(NotificationPayload<ChannelGoalProgressV1>)
Channel Goal Progress V1 Event
Tuple Fields of ChannelGoalProgressV1
ChannelGoalEndV1(NotificationPayload<ChannelGoalEndV1>)
Channel Goal End V1 Event
Tuple Fields of ChannelGoalEndV1
ChannelHypeTrainBeginV1(NotificationPayload<ChannelHypeTrainBeginV1>)
Channel Hype Train Begin V1 Event
Tuple Fields of ChannelHypeTrainBeginV1
ChannelHypeTrainProgressV1(NotificationPayload<ChannelHypeTrainProgressV1>)
Channel Hype Train Progress V1 Event
Tuple Fields of ChannelHypeTrainProgressV1
ChannelHypeTrainEndV1(NotificationPayload<ChannelHypeTrainEndV1>)
Channel Hype Train End V1 Event
Tuple Fields of ChannelHypeTrainEndV1
StreamOnlineV1(NotificationPayload<StreamOnlineV1>)
StreamOnline V1 Event
Tuple Fields of StreamOnlineV1
StreamOfflineV1(NotificationPayload<StreamOfflineV1>)
StreamOffline V1 Event
Tuple Fields of StreamOfflineV1
UserUpdateV1(NotificationPayload<UserUpdateV1>)
User Update V1 Event
Tuple Fields of UserUpdateV1
UserAuthorizationGrantV1(NotificationPayload<UserAuthorizationGrantV1>)
User Authorization Grant V1 Event
Tuple Fields of UserAuthorizationGrantV1
UserAuthorizationRevokeV1(NotificationPayload<UserAuthorizationRevokeV1>)
User Authorization Revoke V1 Event
Tuple Fields of UserAuthorizationRevokeV1
ChannelRaidV1(NotificationPayload<ChannelRaidV1>)
Channel Raid V1 Event
Tuple Fields of ChannelRaidV1
ChannelSubscriptionEndV1(NotificationPayload<ChannelSubscriptionEndV1>)
Channel Subscription End V1 Event
Tuple Fields of ChannelSubscriptionEndV1
ChannelSubscriptionGiftV1(NotificationPayload<ChannelSubscriptionGiftV1>)
Channel Subscription Gift V1 Event
Tuple Fields of ChannelSubscriptionGiftV1
ChannelSubscriptionMessageV1(NotificationPayload<ChannelSubscriptionMessageV1>)
Channel Subscription Message V1 Event
Tuple Fields of ChannelSubscriptionMessageV1
Implementations
Parse string slice as a Payload
pub fn parse_http<B>(request: &Request<B>) -> Result<Payload, PayloadParseError> where
B: AsRef<[u8]>,
pub fn parse_http<B>(request: &Request<B>) -> Result<Payload, PayloadParseError> where
B: AsRef<[u8]>,
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
Auto Trait Implementations
impl RefUnwindSafe for Payload
impl UnwindSafe for Payload
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
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