pub struct SelectMenuBuilder { /* private fields */ }Expand description
Create a SelectMenu with a builder.
Implementations§
Source§impl SelectMenuBuilder
impl SelectMenuBuilder
Sourcepub fn build(self) -> SelectMenu
pub fn build(self) -> SelectMenu
Consume this builder and return the configured SelectMenuOption
Sourcepub fn default_values(self, default_values: Vec<SelectDefaultValue>) -> Self
pub fn default_values(self, default_values: Vec<SelectDefaultValue>) -> Self
Set the default values for this select menu.
This is not available for SelectMenuType::Text.
Sourcepub const fn max_values(self, max_values: u8) -> Self
pub const fn max_values(self, max_values: u8) -> Self
Set the maximum number of options that can be chosen for this select menu.
Sourcepub const fn min_values(self, min_values: u8) -> Self
pub const fn min_values(self, min_values: u8) -> Self
Set the minimum number of options that can be chosen for this select menu.
Sourcepub fn placeholder(self, placeholder: String) -> Self
pub fn placeholder(self, placeholder: String) -> Self
Set the text to be shown when no options are selected.
Sourcepub const fn with_channel_types(
custom_id: String,
channel_types: Option<Vec<ChannelType>>,
) -> Self
pub const fn with_channel_types( custom_id: String, channel_types: Option<Vec<ChannelType>>, ) -> Self
Create a new builder for a select menu of SelectMenuType::Channel.
Sourcepub const fn with_kind(custom_id: String, kind: SelectMenuType) -> Self
pub const fn with_kind(custom_id: String, kind: SelectMenuType) -> Self
Create a new builder for a select menu of a given SelectMenuType.
Prefer Self::with_options for SelectMenuType::Text and
Self::with_channel_types for SelectMenuType::Channel.
Sourcepub const fn with_options(
custom_id: String,
options: Vec<SelectMenuOption>,
) -> Self
pub const fn with_options( custom_id: String, options: Vec<SelectMenuOption>, ) -> Self
Create a new builder for a select menu of SelectMenuType::Text.
Trait Implementations§
Source§impl Clone for SelectMenuBuilder
impl Clone for SelectMenuBuilder
Source§fn clone(&self) -> SelectMenuBuilder
fn clone(&self) -> SelectMenuBuilder
Returns a duplicate 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 SelectMenuBuilder
impl Debug for SelectMenuBuilder
Source§impl Hash for SelectMenuBuilder
impl Hash for SelectMenuBuilder
Source§impl PartialEq for SelectMenuBuilder
impl PartialEq for SelectMenuBuilder
impl Eq for SelectMenuBuilder
impl StructuralPartialEq for SelectMenuBuilder
Auto Trait Implementations§
impl Freeze for SelectMenuBuilder
impl RefUnwindSafe for SelectMenuBuilder
impl Send for SelectMenuBuilder
impl Sync for SelectMenuBuilder
impl Unpin for SelectMenuBuilder
impl UnwindSafe for SelectMenuBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.