Enum twilight_http::routing::Path

source ·
#[non_exhaustive]
pub enum Path {
Show 84 variants ApplicationCommand(u64), ApplicationCommandId(u64), ApplicationGuildCommand(u64), ApplicationGuildCommandId(u64), ApplicationsMe, ChannelsId(u64), ChannelsIdFollowers(u64), ChannelsIdInvites(u64), ChannelsIdMessages(u64), ChannelsIdMessagesBulkDelete(u64), ChannelsIdMessagesId(Method, u64), ChannelsIdMessagesIdCrosspost(u64), ChannelsIdMessagesIdReactions(u64), ChannelsIdMessagesIdReactionsUserIdType(u64), ChannelsIdMessagesIdThreads(u64), ChannelsIdPermissionsOverwriteId(u64), ChannelsIdPins(u64), ChannelsIdPinsMessageId(u64), ChannelsIdRecipients(u64), ChannelsIdThreadMembers(u64), ChannelsIdThreadMembersId(u64), ChannelsIdThreads(u64), ChannelsIdTyping(u64), ChannelsIdWebhooks(u64), Gateway, GatewayBot, Guilds, GuildsId(u64), GuildsIdAuditLogs(u64), GuildsIdAutoModerationRules(u64), GuildsIdAutoModerationRulesId(u64), GuildsIdBans(u64), GuildsIdBansId(u64), GuildsIdBansUserId(u64), GuildsIdChannels(u64), GuildsIdEmojis(u64), GuildsIdEmojisId(u64), GuildsIdIntegrations(u64), GuildsIdIntegrationsId(u64), GuildsIdIntegrationsIdSync(u64), GuildsIdInvites(u64), GuildsIdMembers(u64), GuildsIdMembersId(u64), GuildsIdMembersIdRolesId(u64), GuildsIdMembersMeNick(u64), GuildsIdMembersSearch(u64), GuildsIdMfa(u64), GuildsIdOnboarding(u64), GuildsIdPreview(u64), GuildsIdPrune(u64), GuildsIdRegions(u64), GuildsIdRoles(u64), GuildsIdRolesId(u64), GuildsIdScheduledEvents(u64), GuildsIdScheduledEventsId(u64), GuildsIdScheduledEventsIdUsers(u64), GuildsIdStickers(u64), GuildsIdTemplates(u64), GuildsIdTemplatesCode(u64, String), GuildsIdThreads(u64), GuildsIdVanityUrl(u64), GuildsIdVoiceStates(u64), GuildsIdWebhooks(u64), GuildsIdWelcomeScreen(u64), GuildsIdWidget(u64), GuildsIdWidgetJson(u64), GuildsTemplatesCode(String), InteractionCallback(u64), InvitesCode, OauthApplicationsMe, OauthMe, StageInstances, StickerPacks, Stickers, UsersId, UsersIdChannels, UsersIdConnections, UsersIdGuilds, UsersIdGuildsId, UsersIdGuildsIdMember, VoiceRegions, WebhooksId(u64), WebhooksIdToken(u64, String), WebhooksIdTokenMessagesId(u64, String),
}
Expand description

An enum representing a path, most useful for ratelimiting implementations.

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.
§

ApplicationCommand(u64)

Operating on global commands.

§

ApplicationCommandId(u64)

Operating on a specific command.

§

ApplicationGuildCommand(u64)

Operating on commands in a guild.

§

ApplicationGuildCommandId(u64)

Operating on a specific command in a guild.

§

ApplicationsMe

Operating on current user application,

§

ChannelsId(u64)

Operating on a channel.

§

ChannelsIdFollowers(u64)

Operating on a channel’s followers.

§

ChannelsIdInvites(u64)

Operating on a channel’s invites.

§

ChannelsIdMessages(u64)

Operating on a channel’s messages.

§

ChannelsIdMessagesBulkDelete(u64)

Operating on a channel’s messages by bulk deleting.

§

ChannelsIdMessagesId(Method, u64)

Operating on an individual channel’s message.

§

ChannelsIdMessagesIdCrosspost(u64)

Crossposting an individual channel’s message.

§

ChannelsIdMessagesIdReactions(u64)

Operating on an individual channel’s message’s reactions.

§

ChannelsIdMessagesIdReactionsUserIdType(u64)

Operating on an individual channel’s message’s reactions while specifying the user ID and emoji type.

§

ChannelsIdMessagesIdThreads(u64)

Operating on an individual channel’s message’s threads.

§

ChannelsIdPermissionsOverwriteId(u64)

Operating on a channel’s permission overwrites by ID.

§

ChannelsIdPins(u64)

Operating on a channel’s pins.

§

ChannelsIdPinsMessageId(u64)

Operating on a channel’s individual pinned message.

§

ChannelsIdRecipients(u64)

Operating on a group DM’s recipients.

§

ChannelsIdThreadMembers(u64)

Operating on a thread’s members.

§

ChannelsIdThreadMembersId(u64)

Operating on a thread’s member.

§

ChannelsIdThreads(u64)

Operating on a channel’s threads.

§

ChannelsIdTyping(u64)

Operating on a channel’s typing indicator.

§

ChannelsIdWebhooks(u64)

Operating on a channel’s webhooks.

§

Gateway

Operating with the gateway information.

§

GatewayBot

Operating with the gateway information tailored to the current user.

§

Guilds

Operating on the guild resource.

§

GuildsId(u64)

Operating on one of user’s guilds.

§

GuildsIdAuditLogs(u64)

Operating on a ban from one of the user’s guilds.

§

GuildsIdAutoModerationRules(u64)

Operating on a guild’s auto moderation rules.

§

GuildsIdAutoModerationRulesId(u64)

Operating on an auto moderation rule from one of the user’s guilds.

§

GuildsIdBans(u64)

Operating on one of the user’s guilds’ bans.

§

GuildsIdBansId(u64)

Operating on a ban from one of the user’s guilds.

§

GuildsIdBansUserId(u64)

Operating on specific member’s ban from one of the user’s guilds.

§

GuildsIdChannels(u64)

Operating on one of the user’s guilds’ channels.

§

GuildsIdEmojis(u64)

Operating on one of the user’s guilds’ emojis.

§

GuildsIdEmojisId(u64)

Operating on an emoji from one of the user’s guilds.

§

GuildsIdIntegrations(u64)

Operating on one of the user’s guilds’ integrations.

§

GuildsIdIntegrationsId(u64)

Operating on an integration from one of the user’s guilds.

§

GuildsIdIntegrationsIdSync(u64)

Operating on an integration from one of the user’s guilds by synchronizing it.

§

GuildsIdInvites(u64)

Operating on one of the user’s guilds’ invites.

§

GuildsIdMembers(u64)

Operating on one of the user’s guilds’ members.

§

GuildsIdMembersId(u64)

Operating on a member from one of the user’s guilds.

§

GuildsIdMembersIdRolesId(u64)

Operating on a role of a member from one of the user’s guilds.

§

GuildsIdMembersMeNick(u64)

Operating on the user’s nickname in one of the user’s guilds.

§

GuildsIdMembersSearch(u64)

Operating on one of the user’s guilds’ members by searching.

§

GuildsIdMfa(u64)

Operating on one of the user’s guilds’ MFA level.

§

GuildsIdOnboarding(u64)

Operating on one of the user’s guilds’ onboarding.

§

GuildsIdPreview(u64)

Operating on one of the user’s guilds’ by previewing it.

§

GuildsIdPrune(u64)

Operating on one of the user’s guilds’ by pruning members.

§

GuildsIdRegions(u64)

Operating on the voice regions of one of the user’s guilds.

§

GuildsIdRoles(u64)

Operating on the roles of one of the user’s guilds.

§

GuildsIdRolesId(u64)

Operating on a role of one of the user’s guilds.

§

GuildsIdScheduledEvents(u64)

Operating on the guild’s scheduled events.

§

GuildsIdScheduledEventsId(u64)

Operating on a particular guild’s scheduled events.

§

GuildsIdScheduledEventsIdUsers(u64)

Operating on a particular guild’s scheduled event users.

§

GuildsIdStickers(u64)

Operating on one of the user’s guilds’ stickers.

§

GuildsIdTemplates(u64)

Operating on one of the user’s guilds’ templates.

§

GuildsIdTemplatesCode(u64, String)

Operating on a template from one of the user’s guilds.

§

GuildsIdThreads(u64)

Operating on one of the user’s guilds’ threads.

§

GuildsIdVanityUrl(u64)

Operating on one of the user’s guilds’ vanity URL.

§

GuildsIdVoiceStates(u64)

Operating on one of the user’s guilds’ voice states.

§

GuildsIdWebhooks(u64)

Operating on one of the user’s guilds’ webhooks.

§

GuildsIdWelcomeScreen(u64)

Operating on one of the user’s guilds’ welcome screen.

§

GuildsIdWidget(u64)

Operating on one of the user’s guild’s widget settings.

§

GuildsIdWidgetJson(u64)

Operating on one of the user’s guild’s widget.

§

GuildsTemplatesCode(String)

Operating on a guild template.

§

InteractionCallback(u64)

Operating on an interaction’s callback.

This path is not bound to the application’s global rate limit.

§

InvitesCode

Operating on an invite.

§

OauthApplicationsMe

Operating on the user’s application information.

§

OauthMe

Operating on the current authorization’s information.

§

StageInstances

Operating on stage instances.

§

StickerPacks

Operating on sticker packs.

§

Stickers

Operating on a sticker.

§

UsersId

Operating on a sticker.

§

UsersIdChannels

Operating on the user’s private channels.

§

UsersIdConnections

Operating on the user’s connections.

§

UsersIdGuilds

Operating on the state of a guild that the user is in.

§

UsersIdGuildsId

Operating on the state of a guild that the user is in.

§

UsersIdGuildsIdMember

Operating on the state of a guild that the user, as a member, is in.

§

VoiceRegions

Operating on the voice regions available to the current user.

§

WebhooksId(u64)

Operating on a webhook as a bot.

§

WebhooksIdToken(u64, String)

Operating on a webhook as a webhook.

When used with interactions, this path is not bound to the application’s global rate limit.

§

WebhooksIdTokenMessagesId(u64, String)

Operating on a message created by a webhook.

When used with interactions, this path is not bound to the application’s global rate limit.

Trait Implementations§

source§

impl Clone for Path

source§

fn clone(&self) -> Path

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Path

source§

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

Formats the value using the given formatter. Read more
source§

impl FromStr for Path

source§

fn from_str(s: &str) -> Result<Path, <Path as FromStr>::Err>

Parses a string into a path.

The string may start with a slash (/), which will be ignored.

§Examples
use std::str::FromStr;
use twilight_http_ratelimiting::Path;

assert_eq!(Path::VoiceRegions, Path::from_str("/voice/regions")?);
assert_eq!(
    Path::ChannelsIdMessages(123),
    Path::from_str("channels/123/messages")?,
);
§

type Err = PathParseError

The associated error which can be returned from parsing.
source§

impl Hash for Path

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Path

source§

fn eq(&self, other: &Path) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<(Method, &str)> for Path

§

type Error = PathParseError

The type returned in the event of a conversion error.
source§

fn try_from( _: (Method, &str) ) -> Result<Path, <Path as TryFrom<(Method, &str)>>::Error>

Performs the conversion.
source§

impl Eq for Path

source§

impl StructuralPartialEq for Path

Auto Trait Implementations§

§

impl Freeze for Path

§

impl RefUnwindSafe for Path

§

impl Send for Path

§

impl Sync for Path

§

impl Unpin for Path

§

impl UnwindSafe for Path

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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