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
sourceimpl CommandOptionValue
impl CommandOptionValue
pub const fn kind(&self) -> CommandOptionType
Trait Implementations
sourceimpl Clone for CommandOptionValue
impl Clone for CommandOptionValue
sourcefn clone(&self) -> CommandOptionValue
fn clone(&self) -> CommandOptionValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for CommandOptionValue
impl Debug for CommandOptionValue
sourceimpl PartialEq<CommandOptionValue> for CommandOptionValue
impl PartialEq<CommandOptionValue> for CommandOptionValue
sourcefn eq(&self, other: &CommandOptionValue) -> bool
fn eq(&self, other: &CommandOptionValue) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl StructuralPartialEq for CommandOptionValue
Auto Trait Implementations
impl RefUnwindSafe for CommandOptionValue
impl Send for CommandOptionValue
impl Sync for CommandOptionValue
impl Unpin for CommandOptionValue
impl UnwindSafe for CommandOptionValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more