pub enum CommandOptionValue {
Attachment(Id<AttachmentMarker>),
Boolean(bool),
Channel(Id<ChannelMarker>),
Focused(String, CommandOptionType),
Integer(i64),
Mentionable(Id<GenericMarker>),
Number(f64),
Role(Id<RoleMarker>),
String(String),
SubCommand(Vec<CommandDataOption>),
SubCommandGroup(Vec<CommandDataOption>),
User(Id<UserMarker>),
}Expand description
Combined value and value type for a CommandDataOption.
Variants§
Attachment(Id<AttachmentMarker>)
Attachment option.
Boolean(bool)
Boolean option.
Channel(Id<ChannelMarker>)
Channel option.
Focused(String, CommandOptionType)
Focused option.
Since Discord does not validate focused fields, they are sent as strings. This means that you will not necessarily get a valid number from number options.
See Discord Docs/Autocomplete.
The actual CommandOptionType is available through the second tuple value.
Integer(i64)
Integer option.
Mentionable(Id<GenericMarker>)
Mentionable option.
Number(f64)
Number option.
Role(Id<RoleMarker>)
Role option.
String(String)
String option.
SubCommand(Vec<CommandDataOption>)
Subcommand option.
SubCommandGroup(Vec<CommandDataOption>)
Subcommand group option.
User(Id<UserMarker>)
User option.
Implementations§
Source§impl CommandOptionValue
impl CommandOptionValue
pub const fn kind(&self) -> CommandOptionType
Trait Implementations§
Source§impl Clone for CommandOptionValue
impl Clone for CommandOptionValue
Source§impl Debug for CommandOptionValue
impl Debug for CommandOptionValue
Source§impl From<(String, CommandOptionType)> for CommandOptionValue
impl From<(String, CommandOptionType)> for CommandOptionValue
Source§fn from((value, kind): (String, CommandOptionType)) -> Self
fn from((value, kind): (String, CommandOptionType)) -> Self
Converts to this type from the input type.
Source§impl From<Id<AttachmentMarker>> for CommandOptionValue
impl From<Id<AttachmentMarker>> for CommandOptionValue
Source§fn from(value: Id<AttachmentMarker>) -> Self
fn from(value: Id<AttachmentMarker>) -> Self
Converts to this type from the input type.
Source§impl From<Id<ChannelMarker>> for CommandOptionValue
impl From<Id<ChannelMarker>> for CommandOptionValue
Source§fn from(value: Id<ChannelMarker>) -> Self
fn from(value: Id<ChannelMarker>) -> Self
Converts to this type from the input type.
Source§impl From<Id<GenericMarker>> for CommandOptionValue
impl From<Id<GenericMarker>> for CommandOptionValue
Source§fn from(value: Id<GenericMarker>) -> Self
fn from(value: Id<GenericMarker>) -> Self
Converts to this type from the input type.
Source§impl From<Id<RoleMarker>> for CommandOptionValue
impl From<Id<RoleMarker>> for CommandOptionValue
Source§fn from(value: Id<RoleMarker>) -> Self
fn from(value: Id<RoleMarker>) -> Self
Converts to this type from the input type.
Source§impl From<Id<UserMarker>> for CommandOptionValue
impl From<Id<UserMarker>> for CommandOptionValue
Source§fn from(value: Id<UserMarker>) -> Self
fn from(value: Id<UserMarker>) -> Self
Converts to this type from the input type.
Source§impl From<String> for CommandOptionValue
impl From<String> for CommandOptionValue
Source§impl From<bool> for CommandOptionValue
impl From<bool> for CommandOptionValue
Source§impl From<f64> for CommandOptionValue
impl From<f64> for CommandOptionValue
Source§impl From<i64> for CommandOptionValue
impl From<i64> for CommandOptionValue
Source§impl PartialEq for CommandOptionValue
impl PartialEq for CommandOptionValue
impl StructuralPartialEq for CommandOptionValue
Source§impl TryFrom<CommandOptionValue> for Id<AttachmentMarker>
impl TryFrom<CommandOptionValue> for Id<AttachmentMarker>
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
Source§impl TryFrom<CommandOptionValue> for bool
impl TryFrom<CommandOptionValue> for bool
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
Source§impl TryFrom<CommandOptionValue> for Id<ChannelMarker>
impl TryFrom<CommandOptionValue> for Id<ChannelMarker>
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
Source§impl TryFrom<CommandOptionValue> for (String, CommandOptionType)
impl TryFrom<CommandOptionValue> for (String, CommandOptionType)
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
Source§impl TryFrom<CommandOptionValue> for i64
impl TryFrom<CommandOptionValue> for i64
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
Source§impl TryFrom<CommandOptionValue> for Id<GenericMarker>
impl TryFrom<CommandOptionValue> for Id<GenericMarker>
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
Source§impl TryFrom<CommandOptionValue> for f64
impl TryFrom<CommandOptionValue> for f64
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
Source§impl TryFrom<CommandOptionValue> for Id<RoleMarker>
impl TryFrom<CommandOptionValue> for Id<RoleMarker>
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
Source§impl TryFrom<CommandOptionValue> for String
impl TryFrom<CommandOptionValue> for String
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
Source§impl TryFrom<CommandOptionValue> for Id<UserMarker>
impl TryFrom<CommandOptionValue> for Id<UserMarker>
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Forget for CommandOptionValue
impl Freeze for CommandOptionValuewhere
PhantomData<fn(AttachmentMarker) -> AttachmentMarker>: Freeze,
NonZero<u64>: Freeze,
PhantomData<fn(ChannelMarker) -> ChannelMarker>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<fn(GenericMarker) -> GenericMarker>: Freeze,
PhantomData<fn(RoleMarker) -> RoleMarker>: Freeze,
PhantomData<CommandDataOption>: Freeze,
PhantomData<fn(UserMarker) -> UserMarker>: Freeze,
impl Move for CommandOptionValue
impl RefUnwindSafe for CommandOptionValue
impl Send for CommandOptionValue
impl Sync for CommandOptionValue
impl Unpin for CommandOptionValue
impl UnsafeUnpin for CommandOptionValuewhere
PhantomData<fn(AttachmentMarker) -> AttachmentMarker>: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
PhantomData<fn(ChannelMarker) -> ChannelMarker>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<fn(GenericMarker) -> GenericMarker>: UnsafeUnpin,
PhantomData<fn(RoleMarker) -> RoleMarker>: UnsafeUnpin,
PhantomData<CommandDataOption>: UnsafeUnpin,
PhantomData<fn(UserMarker) -> UserMarker>: UnsafeUnpin,
impl UnwindSafe for CommandOptionValue
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