#[non_exhaustive]pub struct CommandDataOption {
pub name: String,
pub value: CommandDataOptionValue,
}
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: CommandDataOptionValue
The given value.
Implementations§
Source§impl CommandDataOption
impl CommandDataOption
pub fn kind(&self) -> CommandOptionType
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<'de>>(
deserializer: D,
) -> StdResult<Self, D::Error>
fn deserialize<D: Deserializer<'de>>( deserializer: D, ) -> StdResult<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CommandDataOption
impl PartialEq for CommandDataOption
Source§impl Serialize for CommandDataOption
impl Serialize for CommandDataOption
impl StructuralPartialEq for CommandDataOption
Auto Trait Implementations§
impl Freeze for CommandDataOption
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