#[non_exhaustive]pub struct SelectMenu {
pub kind: ComponentType,
pub custom_id: Option<String>,
pub options: Vec<SelectMenuOption>,
pub channel_types: Vec<ChannelType>,
pub placeholder: Option<String>,
pub min_values: Option<u8>,
pub max_values: Option<u8>,
pub disabled: bool,
}
Expand description
A select menu component.
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.kind: ComponentType
The component type, which may either be ComponentType::StringSelect
,
ComponentType::UserSelect
, ComponentType::RoleSelect
,
ComponentType::MentionableSelect
, or ComponentType::ChannelSelect
.
custom_id: Option<String>
An identifier defined by the developer for the select menu.
options: Vec<SelectMenuOption>
The options of this select menu.
Required for ComponentType::StringSelect
and unavailable for all others.
channel_types: Vec<ChannelType>
List of channel types to include in the ComponentType::ChannelSelect
.
placeholder: Option<String>
The placeholder shown when nothing is selected.
min_values: Option<u8>
The minimum number of selections allowed.
max_values: Option<u8>
The maximum number of selections allowed.
disabled: bool
Whether select menu is disabled.
Trait Implementations§
Source§impl Clone for SelectMenu
impl Clone for SelectMenu
Source§fn clone(&self) -> SelectMenu
fn clone(&self) -> SelectMenu
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 SelectMenu
impl Debug for SelectMenu
Source§impl<'de> Deserialize<'de> for SelectMenu
impl<'de> Deserialize<'de> for SelectMenu
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
Source§impl From<SelectMenu> for ActionRowComponent
impl From<SelectMenu> for ActionRowComponent
Source§fn from(component: SelectMenu) -> Self
fn from(component: SelectMenu) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SelectMenu
impl RefUnwindSafe for SelectMenu
impl Send for SelectMenu
impl Sync for SelectMenu
impl Unpin for SelectMenu
impl UnwindSafe for SelectMenu
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