Enum twilight_http::api_error::ErrorCode[][src]

#[non_exhaustive]
pub enum ErrorCode {
Show variants GeneralError, UnknownAccount, UnknownApplication, UnknownChannel, UnknownGuild, UnknownIntegration, UnknownInvite, UnknownMember, UnknownMessage, UnknownPermissionOverwrite, UnknownProvider, UnknownRole, UnknownToken, UnknownUser, UnknownEmoji, UnknownWebhook, UnknownBan, UnknownSKU, UnknownStoreListing, UnknownEntitlement, UnknownBuild, UnknownLobby, UnknownBranch, UnknownRedistributable, UnknownGuildTemplate, UnknownInteraction, BotsCannotUseEndpoint, OnlyBotsCanUseEndpoint, AnnouncementRateLimitReached, ChannelRateLimitReached, MaximumGuildsReached, MaximumFriendsReached, MaximumPinsReached, MaximumRolesReached, MaximumWebhooksReached, MaximumReactionsReached, MaximumGuildChannelsReached, MaximumAttachmentsReached, MaximumInvitesReached, GuildTemplateAlreadyExist, MaximumNonGuildBansReached, Unauthorized, AccountNeedsVerification, RequestEntityTooLarge, FeatureTemporarilyDisabled, UserBannedFromGuild, MessageAlreadyCrossposted, Missingaccess, InvalidAccountType, InvalidDMChannelAction, GuildWidgetDisabled, MessageNotAuthoredByUser, EmptyMessage, CannotSendMessageToUser, CannotSendMessagesInVoiceChannel, VerificationLevelTooHigh, OAuthApplicationHasNoBot, OAuthApplicationLimitReached, InvalidOAuthSstate, PermissionsLacking, InvalidAuthenticationTokenProvided, NoteTooLong, InvalidMessageDeleteRange, MessagePinnedInWrongChannel, InviteCodeInvalidOrTaken, InvalidActionOnSystemMessage, CannotExecuteActionOnChannelType, InvalidOAuthAccessToken, InvalidWebhookToken, InvalidRecipient, MessageTooOldToBulkDelete, InvalidFormBodyOrContentType, InviteAcceptedToGuildBotNotIn, InvalidApiVersion, CommunityGuildRequired, InvalidStickerSent, TwoFactorRequired, ReactionBlocked, ApiResourceOverloaded, Other(u64),
}

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.
GeneralError
Expand description

General error (such as a malformed request body, amongst other things)

UnknownAccount
Expand description

Unknown account

UnknownApplication
Expand description

Unknown application

UnknownChannel
Expand description

Unknown channel

UnknownGuild
Expand description

Unknown guild

UnknownIntegration
Expand description

Unknown integration

UnknownInvite
Expand description

Unknown invite

UnknownMember
Expand description

Unknown member

UnknownMessage
Expand description

Unknown message

UnknownPermissionOverwrite
Expand description

Unknown permission overwrite

UnknownProvider
Expand description

Unknown provider

UnknownRole
Expand description

Unknown role

UnknownToken
Expand description

Unknown token

UnknownUser
Expand description

Unknown user

UnknownEmoji
Expand description

Unknown emoji

UnknownWebhook
Expand description

Unknown webhook

UnknownBan
Expand description

Unknown ban

UnknownSKU
Expand description

Unknown SKU

UnknownStoreListing
Expand description

Unknown Store Listing

UnknownEntitlement
Expand description

Unknown entitlement

UnknownBuild
Expand description

Unknown build

UnknownLobby
Expand description

Unknown lobby

UnknownBranch
Expand description

Unknown branch

UnknownRedistributable
Expand description

Unknown redistributable

UnknownGuildTemplate
Expand description

Unknown guild template

UnknownInteraction
Expand description

Unknown interaction

BotsCannotUseEndpoint
Expand description

Bots cannot use this endpoint

OnlyBotsCanUseEndpoint
Expand description

Only bots can use this endpoint

AnnouncementRateLimitReached
Expand description

Message cannot be edited due to announcement rate limits

ChannelRateLimitReached
Expand description

The channel you are writing has hit the write rate limit

MaximumGuildsReached
Expand description

Maximum number of guilds reached (100)

MaximumFriendsReached
Expand description

Maximum number of friends reached (1000)

MaximumPinsReached
Expand description

Maximum number of pins reached for the channel (50)

MaximumRolesReached
Expand description

Maximum number of guild roles reached (250)

MaximumWebhooksReached
Expand description

Maximum number of webhooks reached (10)

MaximumReactionsReached
Expand description

Maximum number of reactions reached (20)

MaximumGuildChannelsReached
Expand description

Maximum number of guild channels reached (500)

MaximumAttachmentsReached
Expand description

Maximum number of attachments in a message reached (10)

MaximumInvitesReached
Expand description

Maximum number of invites reached (1000)

GuildTemplateAlreadyExist
Expand description

Guild already has a template

MaximumNonGuildBansReached
Expand description

Maximum number of bans for non-guild members have been exceeded

Unauthorized
Expand description

Unauthorized. Provide a valid token and try again

AccountNeedsVerification
Expand description

You need to verify your account in order to perform this action

RequestEntityTooLarge
Expand description

Request entity too large. Try sending something smaller in size

FeatureTemporarilyDisabled
Expand description

This feature has been temporarily disabled server-side

UserBannedFromGuild
Expand description

The user is banned from this guild

MessageAlreadyCrossposted
Expand description

This message has already been crossposted

Missingaccess
Expand description

Missing access

InvalidAccountType
Expand description

Invalid account type

InvalidDMChannelAction
Expand description

Cannot execute action on a DM channel

GuildWidgetDisabled
Expand description

Guild widget disabled

MessageNotAuthoredByUser
Expand description

Cannot edit a message authored by another user

EmptyMessage
Expand description

Cannot send an empty message

CannotSendMessageToUser
Expand description

Cannot send messages to this user

CannotSendMessagesInVoiceChannel
Expand description

Cannot send messages in a voice channel

VerificationLevelTooHigh
Expand description

Channel verification level is too high for you to gain access

OAuthApplicationHasNoBot
Expand description

OAuth2 application does not have a bot

OAuthApplicationLimitReached
Expand description

OAuth2 application limit reached

InvalidOAuthSstate
Expand description

Invalid OAuth2 state

PermissionsLacking
Expand description

You lack permissions to perform that action

InvalidAuthenticationTokenProvided
Expand description

Invalid authentication token provided

NoteTooLong
Expand description

Note was too long

InvalidMessageDeleteRange
Expand description

Provided too few or too many messages to delete. Must provide at least 2 and fewer than 100 messages to delete

MessagePinnedInWrongChannel
Expand description

A message can only be pinned to the channel it was sent in

InviteCodeInvalidOrTaken
Expand description

Invite code was either invalid or taken

InvalidActionOnSystemMessage
Expand description

Cannot execute action on a system message

CannotExecuteActionOnChannelType
Expand description

Cannot execute action on this channel type

InvalidOAuthAccessToken
Expand description

Invalid OAuth2 access token provided

InvalidWebhookToken
Expand description

Invalid webhook token provided

InvalidRecipient
Expand description

Invalid recipient(s)

MessageTooOldToBulkDelete
Expand description

A message provided was too old to bulk delete

InvalidFormBodyOrContentType
Expand description

Invalid form body (returned for both application/json and multipart/form-data bodies), or invalid Content-Type provided

InviteAcceptedToGuildBotNotIn
Expand description

An invite was accepted to a guild the application’s bot is not in

InvalidApiVersion
Expand description

Invalid API version provided

CommunityGuildRequired
Expand description

Cannot delete a channel required for Community guilds

InvalidStickerSent
Expand description

Invalid sticker sent

TwoFactorRequired
Expand description

Two factor is required for this operation.

ReactionBlocked
Expand description

Reaction was blocked

ApiResourceOverloaded
Expand description

API resource is currently overloaded. Try again a little later

Other(u64)
Expand description

A status code that Twilight doesn’t have registered.

Please report the number if you see this variant!

Implementations

impl ErrorCode[src]

pub fn num(&self) -> u64[src]

Trait Implementations

impl Clone for ErrorCode[src]

fn clone(&self) -> ErrorCode[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 ErrorCode[src]

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

Formats the value using the given formatter. Read more

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

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

Deserialize this value from the given Serde deserializer. Read more

impl Display for ErrorCode[src]

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

Formats the value using the given formatter. Read more

impl From<u64> for ErrorCode[src]

fn from(int: u64) -> Self[src]

Performs the conversion.

impl PartialEq<ErrorCode> for ErrorCode[src]

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

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

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

This method tests for !=.

impl Serialize for ErrorCode[src]

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>[src]

Serialize this value into the given Serde serializer. Read more

impl Copy for ErrorCode[src]

impl Eq for ErrorCode[src]

impl StructuralEq for ErrorCode[src]

impl StructuralPartialEq for ErrorCode[src]

Auto Trait Implementations

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

pub fn equivalent(&self, key: &K) -> bool[src]

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

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, U> Into<U> for T where
    U: From<T>, 
[src]

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

Performs the conversion.

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> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. 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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]