#[non_exhaustive]pub enum CommandOptionType {
SubCommand,
SubCommandGroup,
String,
Integer,
Boolean,
User,
Channel,
Role,
Mentionable,
Number,
Attachment,
Unknown(u8),
}Expand description
discord.js counterpart: ApplicationCommandOptionType.
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.
SubCommand
SubCommandGroup
String
Integer
Boolean
User
Channel
Role
Mentionable
Number
Attachment
Unknown(u8)
A value that this version of the library does not know about.
Discord may add new values at any time. They are preserved here so that no
information is lost and deserialization never fails because of them. Prefer
CommandOptionType::from over constructing this variant directly.
Implementations§
Source§impl CommandOptionType
impl CommandOptionType
Sourcepub const fn value(self) -> u8
pub const fn value(self) -> u8
Returns the raw integer value Discord uses for this variant.
discord.js counterpart: the enum’s numeric value in discord-api-types.
Sourcepub const fn is_unknown(self) -> bool
pub const fn is_unknown(self) -> bool
Returns true if this is a value the library does not know about.
discord.js counterpart: none (discord.js passes unknown numbers through).
Sourcepub const fn from_value(value: u8) -> Self
pub const fn from_value(value: u8) -> Self
Converts a raw value into the matching variant, or Self::Unknown.
discord.js counterpart: none (discord.js passes unknown numbers through).
Trait Implementations§
Source§impl Clone for CommandOptionType
impl Clone for CommandOptionType
impl Copy for CommandOptionType
Source§impl Debug for CommandOptionType
impl Debug for CommandOptionType
Source§impl<'de> Deserialize<'de> for CommandOptionType
impl<'de> Deserialize<'de> for CommandOptionType
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CommandOptionType
Source§impl From<CommandOptionType> for u8
impl From<CommandOptionType> for u8
Source§fn from(value: CommandOptionType) -> Self
fn from(value: CommandOptionType) -> Self
Converts to this type from the input type.
Source§impl From<u8> for CommandOptionType
impl From<u8> for CommandOptionType
Source§impl Hash for CommandOptionType
impl Hash for CommandOptionType
Source§impl Ord for CommandOptionType
impl Ord for CommandOptionType
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for CommandOptionType
impl PartialEq for CommandOptionType
Source§impl PartialOrd for CommandOptionType
impl PartialOrd for CommandOptionType
Auto Trait Implementations§
impl Freeze for CommandOptionType
impl RefUnwindSafe for CommandOptionType
impl Send for CommandOptionType
impl Sync for CommandOptionType
impl Unpin for CommandOptionType
impl UnsafeUnpin for CommandOptionType
impl UnwindSafe for CommandOptionType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more