Trait Request

Source
pub trait Request: Serialize {
    type Response: DeserializeOwned + PartialEq;

    const PATH: &'static str;
    const SCOPE: &'static [Scope];
    const OPT_SCOPE: &'static [Scope] = _;

    // Provided methods
    fn query(&self) -> Result<String, SerializeError> { ... }
    fn get_uri(&self) -> Result<Uri, InvalidUri> { ... }
    fn get_bare_uri() -> Result<Uri, InvalidUri> { ... }
}
Available on crate feature helix only.
Expand description

A request is a Twitch endpoint, see New Twitch API reference

Required Associated Constants§

Source

const PATH: &'static str

The path to the endpoint relative to the helix root. eg. channels for Get Channel Information

Source

const SCOPE: &'static [Scope]

Available on crate feature twitch_oauth2 only.

Scopes needed by this endpoint

Provided Associated Constants§

Source

const OPT_SCOPE: &'static [Scope] = _

Available on crate feature twitch_oauth2 only.

Optional scopes needed by this endpoint

Required Associated Types§

Source

type Response: DeserializeOwned + PartialEq

Response type. twitch’s response will deserialize to this.

Provided Methods§

Source

fn query(&self) -> Result<String, SerializeError>

Defines layout of the url parameters.

Source

fn get_uri(&self) -> Result<Uri, InvalidUri>

Returns full URI for the request, including query parameters.

Source

fn get_bare_uri() -> Result<Uri, InvalidUri>

Returns bare URI for the request, NOT including query parameters.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Request for GetBitsLeaderboardRequest

Source§

const PATH: &'static str = "bits/leaderboard"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = BitsLeaderboard

Source§

impl Request for GetCheermotesRequest

Source§

const PATH: &'static str = "bits/cheermotes"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Cheermote>

Source§

impl Request for GetChannelEditorsRequest

Source§

const PATH: &'static str = "channels/editors"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Editor>

Source§

impl Request for GetChannelInformationRequest

Source§

const PATH: &'static str = "channels"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Option<ChannelInformation>

Source§

impl Request for ModifyChannelInformationRequest

Source§

const PATH: &'static str = "channels"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = ModifyChannelInformation

Source§

impl Request for StartCommercialRequest

Source§

const PATH: &'static str = "channels/commercial"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<StartCommercial>

Source§

impl Request for GetChannelChatBadgesRequest

Source§

const PATH: &'static str = "chat/badges"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<BadgeSet>

Source§

impl Request for GetChannelEmotesRequest

Source§

const PATH: &'static str = "chat/emotes"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<ChannelEmote>

Source§

impl Request for GetEmoteSetsRequest

Source§

const PATH: &'static str = "chat/emotes/set"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Emote>

Source§

impl Request for GetGlobalChatBadgesRequest

Source§

const PATH: &'static str = "chat/badges/global"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<BadgeSet>

Source§

impl Request for GetGlobalEmotesRequest

Source§

const PATH: &'static str = "chat/emotes/global"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<GlobalEmote>

Source§

impl Request for UpdateChatSettingsRequest

Source§

const PATH: &'static str = "chat/settings"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = ChatSettings

Source§

impl Request for GetClipsRequest

Source§

const PATH: &'static str = "clips"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Clip>

Source§

impl Request for DeleteEventSubSubscriptionRequest

Available on crate feature eventsub only.
Source§

const PATH: &'static str = "eventsub/subscriptions"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = DeleteEventSubSubscription

Source§

impl Request for GetEventSubSubscriptionsRequest

Available on crate feature eventsub only.
Source§

const PATH: &'static str = "eventsub/subscriptions"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = EventSubSubscriptions

Source§

impl Request for GetGamesRequest

Source§

const PATH: &'static str = "games"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<TwitchCategory>

Source§

impl Request for GetTopGamesRequest

Source§

const PATH: &'static str = "games/top"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<TwitchCategory>

Source§

impl Request for GetCreatorGoalsRequest

Source§

const PATH: &'static str = "goals"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<CreatorGoal>

Source§

impl Request for GetHypeTrainEventsRequest

Source§

const PATH: &'static str = "hypetrain/events"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<HypeTrainEvent>

Source§

impl Request for GetBlockedTerms

Source§

const PATH: &'static str = "moderation/blocked_terms"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<BlockedTerm>

Source§

impl Request for AddBlockedTermRequest

Source§

const PATH: &'static str = "moderation/blocked_terms"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<BlockedTerm>

Source§

impl Request for BanUserRequest

Source§

const PATH: &'static str = "moderation/bans"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = BanUser

Source§

impl Request for CheckAutoModStatusRequest

Source§

const PATH: &'static str = "moderation/enforcements/status"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<CheckAutoModStatus>

Source§

impl Request for GetBannedUsersRequest

Source§

const PATH: &'static str = "moderation/banned"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<BannedUser>

Source§

impl Request for GetModeratorsRequest

Source§

const PATH: &'static str = "moderation/moderators"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Moderator>

Source§

impl Request for ManageHeldAutoModMessagesRequest

Source§

const PATH: &'static str = "moderation/automod/message"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = ManageHeldAutoModMessages

Source§

impl Request for RemoveBlockedTermRequest

Source§

const OPT_SCOPE: &'static [Scope]

Source§

const PATH: &'static str = "moderation/blocked_terms"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = RemoveBlockedTerm

Source§

impl Request for UnbanUserRequest

Source§

const PATH: &'static str = "moderation/bans"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = UnbanUserResponse

Source§

impl Request for CreateCustomRewardRequest

Source§

const PATH: &'static str = "channel_points/custom_rewards"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = CustomReward

Source§

impl Request for DeleteCustomRewardRequest

Source§

const PATH: &'static str = "channel_points/custom_rewards"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = DeleteCustomReward

Source§

impl Request for GetCustomRewardRedemptionRequest

Source§

const PATH: &'static str = "channel_points/custom_rewards/redemptions"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<CustomRewardRedemption>

Source§

impl Request for GetCustomRewardRequest

Source§

const PATH: &'static str = "channel_points/custom_rewards"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<CustomReward>

Source§

impl Request for UpdateCustomRewardRequest

Source§

const PATH: &'static str = "channel_points/custom_rewards"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = UpdateCustomReward

Source§

impl Request for UpdateRedemptionStatusRequest

Source§

const PATH: &'static str = "channel_points/custom_rewards/redemptions"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = UpdateRedemptionStatusInformation

Source§

impl Request for CreatePollRequest

Source§

const PATH: &'static str = "polls"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Poll

Source§

impl Request for EndPollRequest

Source§

const PATH: &'static str = "polls"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = EndPoll

Source§

impl Request for GetPollsRequest

Source§

const PATH: &'static str = "polls"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Poll>

Source§

impl Request for CreatePredictionRequest

Source§

const PATH: &'static str = "predictions"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Prediction

Source§

impl Request for EndPredictionRequest

Source§

const PATH: &'static str = "predictions"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = EndPrediction

Source§

impl Request for GetPredictionsRequest

Source§

const PATH: &'static str = "predictions"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Prediction>

Source§

impl Request for CreateChannelStreamScheduleSegmentRequest

Source§

const PATH: &'static str = "schedule/segment"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = ScheduledBroadcasts

Source§

impl Request for GetChannelStreamScheduleRequest

Source§

const PATH: &'static str = "schedule"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = ScheduledBroadcasts

Source§

impl Request for UpdateChannelStreamScheduleRequest

Source§

const PATH: &'static str = "schedule/settings"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = UpdateChannelStreamSchedule

Source§

impl Request for UpdateChannelStreamScheduleSegmentRequest

Source§

const PATH: &'static str = "schedule/segment"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = ScheduledBroadcasts

Source§

impl Request for SearchCategoriesRequest

Source§

const PATH: &'static str = "search/categories"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<TwitchCategory>

Source§

impl Request for SearchChannelsRequest

Source§

const PATH: &'static str = "search/channels"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Channel>

Source§

impl Request for GetFollowedStreamsRequest

Source§

const PATH: &'static str = "streams/followed"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Stream>

Source§

impl Request for GetStreamTagsRequest

Source§

const PATH: &'static str = "streams/tags"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<TwitchTag>

Source§

impl Request for GetStreamsRequest

Source§

const PATH: &'static str = "streams"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Stream>

Source§

impl Request for ReplaceStreamTagsRequest

Source§

const PATH: &'static str = "streams/tags"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = ReplaceStreamTags

Source§

impl Request for CheckUserSubscriptionRequest

Source§

const PATH: &'static str = "subscriptions/user"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = UserSubscription

Source§

impl Request for GetBroadcasterSubscriptionsEventsRequest

Source§

const PATH: &'static str = "subscriptions/events"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<BroadcasterSubscriptionEvent>

Source§

impl Request for GetBroadcasterSubscriptionsRequest

Source§

const PATH: &'static str = "subscriptions"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<BroadcasterSubscription>

Source§

impl Request for GetAllStreamTagsRequest

Source§

const PATH: &'static str = "tags/streams"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<TwitchTag>

Source§

impl Request for GetChannelTeamsRequest

Source§

const OPT_SCOPE: &'static [Scope]

Source§

const PATH: &'static str = "teams/channel"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<BroadcasterTeam>

Source§

impl Request for GetTeamsRequest

Source§

const OPT_SCOPE: &'static [Scope]

Source§

const PATH: &'static str = "teams"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Team>

Source§

impl Request for BlockUserRequest

Source§

const OPT_SCOPE: &'static [Scope]

Source§

const PATH: &'static str = "users/blocks"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = BlockUser

Source§

impl Request for GetUserBlockListRequest

Source§

const OPT_SCOPE: &'static [Scope]

Source§

const PATH: &'static str = "users/blocks"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<UserBlock>

Source§

impl Request for GetUsersFollowsRequest

Source§

const OPT_SCOPE: &'static [Scope]

Source§

const PATH: &'static str = "users/follows"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = UsersFollows

Source§

impl Request for GetUsersRequest

Source§

const OPT_SCOPE: &'static [Scope]

Source§

const PATH: &'static str = "users"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<User>

Source§

impl Request for UnblockUserRequest

Source§

const OPT_SCOPE: &'static [Scope]

Source§

const PATH: &'static str = "users/blocks"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = UnblockUser

Source§

impl Request for DeleteVideosRequest

Source§

const PATH: &'static str = "videos"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = DeleteVideo

Source§

impl Request for GetVideosRequest

Source§

const PATH: &'static str = "videos"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = Vec<Video>

Source§

impl<E: EventSubscription> Request for CreateEventSubSubscriptionRequest<E>

Available on crate feature eventsub only.
Source§

const PATH: &'static str = "eventsub/subscriptions"

Source§

const SCOPE: &'static [Scope]

Source§

type Response = CreateEventSubSubscription<E>