pub struct CreateSelectMenuOption { /* private fields */ }
Expand description
A builder for creating an option of a select menu component in a message
Implementations§
Source§impl CreateSelectMenuOption
impl CreateSelectMenuOption
Sourcepub fn new(label: impl Into<String>, value: impl Into<String>) -> Self
pub fn new(label: impl Into<String>, value: impl Into<String>) -> Self
Creates a select menu option with the given label and value, leaving all other fields empty.
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Sets the label of this option, replacing the current value as set in Self::new
.
Sourcepub fn value(self, value: impl Into<String>) -> Self
pub fn value(self, value: impl Into<String>) -> Self
Sets the value of this option, replacing the current value as set in Self::new
.
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Sets the description shown on this option.
Sourcepub fn emoji(self, emoji: impl Into<ReactionType>) -> Self
pub fn emoji(self, emoji: impl Into<ReactionType>) -> Self
Sets emoji of the option.
Sourcepub fn default_selection(self, default: bool) -> Self
pub fn default_selection(self, default: bool) -> Self
Sets this option as selected by default.
Trait Implementations§
Source§impl Clone for CreateSelectMenuOption
impl Clone for CreateSelectMenuOption
Source§fn clone(&self) -> CreateSelectMenuOption
fn clone(&self) -> CreateSelectMenuOption
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 CreateSelectMenuOption
impl Debug for CreateSelectMenuOption
Source§impl PartialEq for CreateSelectMenuOption
impl PartialEq for CreateSelectMenuOption
Source§impl Serialize for CreateSelectMenuOption
impl Serialize for CreateSelectMenuOption
impl StructuralPartialEq for CreateSelectMenuOption
Auto Trait Implementations§
impl Freeze for CreateSelectMenuOption
impl RefUnwindSafe for CreateSelectMenuOption
impl Send for CreateSelectMenuOption
impl Sync for CreateSelectMenuOption
impl Unpin for CreateSelectMenuOption
impl UnwindSafe for CreateSelectMenuOption
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