#[non_exhaustive]pub struct SelectOption {
pub label: CompactString,
pub value: CompactString,
pub description: Option<CompactString>,
pub emoji: Option<PartialEmoji>,
pub default: bool,
}Expand description
discord.js counterpart: APISelectMenuOption / StringSelectMenuOptionBuilder.
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.label: CompactStringThe text shown to the user (max 100 characters).
value: CompactStringThe developer-defined value (max 100 characters).
description: Option<CompactString>An additional description (max 100 characters).
emoji: Option<PartialEmoji>The emoji.
default: boolWhether the option is selected by default.
Implementations§
Source§impl SelectOption
impl SelectOption
Sourcepub fn new(
label: impl Into<CompactString>,
value: impl Into<CompactString>,
) -> Self
pub fn new( label: impl Into<CompactString>, value: impl Into<CompactString>, ) -> Self
Creates an option.
discord.js counterpart: StringSelectMenuOptionBuilder (@discordjs/builders).
Trait Implementations§
Source§impl Clone for SelectOption
impl Clone for SelectOption
Source§impl Debug for SelectOption
impl Debug for SelectOption
Source§impl<'de> Deserialize<'de> for SelectOption
impl<'de> Deserialize<'de> for SelectOption
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SelectOption
Source§impl From<SelectOption> for GroupOption
impl From<SelectOption> for GroupOption
Source§fn from(option: SelectOption) -> Self
fn from(option: SelectOption) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SelectOption
impl PartialEq for SelectOption
Source§impl Serialize for SelectOption
impl Serialize for SelectOption
impl StructuralPartialEq for SelectOption
Auto Trait Implementations§
impl Forget for SelectOption
impl Freeze for SelectOption
impl Move for SelectOption
impl RefUnwindSafe for SelectOption
impl Send for SelectOption
impl Sync for SelectOption
impl Unpin for SelectOption
impl UnsafeUnpin for SelectOption
impl UnwindSafe for SelectOption
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