pub struct CommandDataOption {
pub name: String,
pub value: Option<Value>,
pub kind: CommandOptionType,
pub options: Vec<CommandDataOption, Global>,
pub resolved: Option<CommandDataOptionValue>,
pub focused: bool,
}
Expand description
A set of a parameter and a value from the user.
All options have names and an option can either be a parameter and input value
or it can denote a sub-command or group, in which case it will contain a
top-level key and another vector of options
.
Their resolved objects can be found on CommandData::resolved
.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.name: String
The name of the parameter.
value: Option<Value>
The given value.
kind: CommandOptionType
The value type.
options: Vec<CommandDataOption, Global>
The nested options.
Note: It is only present if the option is a group or a subcommand.
resolved: Option<CommandDataOptionValue>
The resolved object of the given value
, if there is one.
focused: bool
For Autocomplete
Interactions this will be true
if
this option is currently focused by the user.
Trait Implementations§
source§impl Clone for CommandDataOption
impl Clone for CommandDataOption
source§fn clone(&self) -> CommandDataOption
fn clone(&self) -> CommandDataOption
Returns a copy 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 CommandDataOption
impl Debug for CommandDataOption
source§impl<'de> Deserialize<'de> for CommandDataOption
impl<'de> Deserialize<'de> for CommandDataOption
source§fn deserialize<D>(
deserializer: D
) -> Result<CommandDataOption, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<CommandDataOption, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for CommandDataOption
impl Serialize for CommandDataOption
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for CommandDataOption
impl Send for CommandDataOption
impl Sync for CommandDataOption
impl Unpin for CommandDataOption
impl UnwindSafe for CommandDataOption
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