[][src]Struct block_kit::block_element::multi_select_menu::MultiStaticSelectMenuElement

pub struct MultiStaticSelectMenuElement { /* fields omitted */ }

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.