#[non_exhaustive]pub struct CommandDataOption {
pub name: CompactString,
pub value: CommandOptionValue,
}Expand description
An option filled in by the user: its name and its value (by option type).
discord.js counterpart: CommandInteractionOption.
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: CompactStringThe option’s name.
value: CommandOptionValueThe value, or the options of a subcommand or group.
Implementations§
Source§impl CommandDataOption
impl CommandDataOption
Sourcepub fn new(name: impl Into<CompactString>, value: CommandOptionValue) -> Self
pub fn new(name: impl Into<CompactString>, value: CommandOptionValue) -> Self
Creates an option (for tests and mock servers).
discord.js counterpart: CommandInteractionOption.
Trait Implementations§
Source§impl Clone for CommandDataOption
impl Clone for CommandDataOption
Source§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) -> 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
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 UnsafeUnpin 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