#[non_exhaustive]pub struct BasicOption {
pub name: CompactString,
pub name_localizations: BTreeMap<Locale, CompactString>,
pub description: CompactString,
pub description_localizations: BTreeMap<Locale, CompactString>,
pub name_localized: Option<CompactString>,
pub description_localized: Option<CompactString>,
pub required: bool,
}Expand description
A boolean, user, role or mentionable option (they share this structure).
discord.js counterpart: APIApplicationCommandBasicOption (discord-api-types).
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 name (1-32 characters).
name_localizations: BTreeMap<Locale, CompactString>Translations of the name.
description: CompactStringThe description (1-100 characters).
description_localizations: BTreeMap<Locale, CompactString>Translations of the description.
name_localized: Option<CompactString>The name in the requester’s locale, from endpoints that do not return the full translations.
description_localized: Option<CompactString>The description in the requester’s locale (see name_localized).
required: boolWhether the option must be filled.
Implementations§
Source§impl BasicOption
impl BasicOption
Sourcepub fn new(
name: impl Into<CompactString>,
description: impl Into<CompactString>,
) -> Self
pub fn new( name: impl Into<CompactString>, description: impl Into<CompactString>, ) -> Self
Creates an optional boolean, user, role or mentionable option, named name and described by description, without translations.
Nothing is validated; djs-builders checks Discord’s rules.
discord.js counterpart: SlashCommandBooleanOption and its siblings (@discordjs/builders).
Trait Implementations§
Source§impl Clone for BasicOption
impl Clone for BasicOption
Source§impl Debug for BasicOption
impl Debug for BasicOption
impl Eq for BasicOption
Source§impl PartialEq for BasicOption
impl PartialEq for BasicOption
Source§impl Serialize for BasicOption
impl Serialize for BasicOption
impl StructuralPartialEq for BasicOption
Auto Trait Implementations§
impl Freeze for BasicOption
impl RefUnwindSafe for BasicOption
impl Send for BasicOption
impl Sync for BasicOption
impl Unpin for BasicOption
impl UnsafeUnpin for BasicOption
impl UnwindSafe for BasicOption
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