Enum twilight_model::application::command::CommandOption
source · [−]pub enum CommandOption {
SubCommand(OptionsCommandOptionData),
SubCommandGroup(OptionsCommandOptionData),
String(ChoiceCommandOptionData),
Integer(NumberCommandOptionData),
Boolean(BaseCommandOptionData),
User(BaseCommandOptionData),
Channel(ChannelCommandOptionData),
Role(BaseCommandOptionData),
Mentionable(BaseCommandOptionData),
Number(NumberCommandOptionData),
Attachment(BaseCommandOptionData),
}
Expand description
Option for a Command
.
It can also be nested under another CommandOption
of type SubCommand
or SubCommandGroup
.
Choices and options are mutually exclusive.
Variants
SubCommand(OptionsCommandOptionData)
SubCommandGroup(OptionsCommandOptionData)
String(ChoiceCommandOptionData)
Integer(NumberCommandOptionData)
Boolean(BaseCommandOptionData)
User(BaseCommandOptionData)
Channel(ChannelCommandOptionData)
Role(BaseCommandOptionData)
Mentionable(BaseCommandOptionData)
Number(NumberCommandOptionData)
Attachment(BaseCommandOptionData)
Implementations
sourceimpl CommandOption
impl CommandOption
pub const fn kind(&self) -> CommandOptionType
sourcepub const fn is_autocomplete(&self) -> bool
pub const fn is_autocomplete(&self) -> bool
Whether the command supports autocomplete.
pub const fn is_required(&self) -> bool
Trait Implementations
sourceimpl Clone for CommandOption
impl Clone for CommandOption
sourcefn clone(&self) -> CommandOption
fn clone(&self) -> CommandOption
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 CommandOption
impl Debug for CommandOption
sourceimpl<'de> Deserialize<'de> for CommandOption
impl<'de> Deserialize<'de> for CommandOption
sourcefn 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
sourceimpl PartialEq<CommandOption> for CommandOption
impl PartialEq<CommandOption> for CommandOption
sourcefn eq(&self, other: &CommandOption) -> bool
fn eq(&self, other: &CommandOption) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CommandOption) -> bool
fn ne(&self, other: &CommandOption) -> bool
This method tests for !=
.
sourceimpl Serialize for CommandOption
impl Serialize for CommandOption
impl StructuralPartialEq for CommandOption
Auto Trait Implementations
impl RefUnwindSafe for CommandOption
impl Send for CommandOption
impl Sync for CommandOption
impl Unpin for CommandOption
impl UnwindSafe for CommandOption
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