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§fn clone(&self) -> CommandOptionValue
fn clone(&self) -> CommandOptionValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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
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 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 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 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 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 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.
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 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 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 i64
impl TryFrom<CommandOptionValue> for i64
Source§type Error = CommandOptionValue
type Error = CommandOptionValue
The type returned in the event of a conversion error.
impl StructuralPartialEq for CommandOptionValue
Auto Trait Implementations§
impl Freeze for CommandOptionValue
impl RefUnwindSafe for CommandOptionValue
impl Send for CommandOptionValue
impl Sync for CommandOptionValue
impl Unpin for CommandOptionValue
impl UnsafeUnpin for CommandOptionValue
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