[−][src]Struct block_kit::block_element::multi_select_menu::MultiStaticSelectMenuElement
initial_options
: Set an array of option objects that exactly match one or more op the options
with in options
or option_groups
Example:
use block_kit::block_element::multi_select_menu::MultiStaticSelectMenuElement; use block_kit::composition::option::OptionObject; use block_kit::composition::option_group::OptionGroup; use block_kit::composition::text::PlainText; let multi = MultiStaticSelectMenuElement::new(PlainText::new("placeholder"), "ac") .option_groups(vec![ OptionGroup::new( PlainText::new("label1"), vec![ OptionObject::new(PlainText::new("t1"), "v1"), OptionObject::new(PlainText::new("t2"), "v2"), ], ), OptionGroup::new( PlainText::new("label2"), vec![ OptionObject::new(PlainText::new("t3"), "v3"), OptionObject::new(PlainText::new("t4"), "v4"), ], ), ]); // Setting initial_options across the groups causes error. // Ok let multi = multi.initial_options(vec![ OptionObject::new(PlainText::new("t1"), "v1"), OptionObject::new(PlainText::new("t2"), "v2"), ]); // Error - different group // let multi = multi.initial_options(vec![ // OptionObject::new(PlainText::new("t1"), "v1"), // OptionObject::new(PlainText::new("t3"), "v3"), // ]);
Methods
impl MultiStaticSelectMenuElement
[src]
pub fn new(
placeholder: impl Into<PlainText>,
action_id: impl Into<String>
) -> Self
[src]
placeholder: impl Into<PlainText>,
action_id: impl Into<String>
) -> Self
pub fn options(self, options: Vec<OptionObject>) -> Self
[src]
pub fn option_groups(self, option_groups: Vec<OptionGroup>) -> Self
[src]
pub fn initial_options(self, initial_options: Vec<OptionObject>) -> Self
[src]
pub fn confirm(self, confirm: ConfirmationDialog) -> Self
[src]
Trait Implementations
impl Debug for MultiStaticSelectMenuElement
[src]
impl Serialize for MultiStaticSelectMenuElement
[src]
Auto Trait Implementations
impl RefUnwindSafe for MultiStaticSelectMenuElement
impl Send for MultiStaticSelectMenuElement
impl Sync for MultiStaticSelectMenuElement
impl Unpin for MultiStaticSelectMenuElement
impl UnwindSafe for MultiStaticSelectMenuElement
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,