Enum slack_blocks::elems::Select[][src]

pub enum Select<'a> {
    Static(Static<'a>),
    External(External<'a>),
    User(User<'a>),
    Conversation(Conversation<'a>),
    PublicChannel(PublicChannel<'a>),
}
👎 Deprecated since 0.16.6:

enum doesn’t really provide value as wrapper type and is confusing. use select types directly and slack_blocks::BlockElement instead.

Expand description

Select Menu Element

A select menu, just as with a standard HTML <select> tag, creates a drop down menu with a list of options for a user to choose.

The select menu also includes type-ahead functionality, where a user can type a part or all of an option string to filter the list.

To use interactive components, you will need to make some changes to prepare your app. Read our guide to enabling interactivity 🔗.

Variants

Static(Static<'a>)
👎 Deprecated since 0.16.6:

enum doesn’t really provide value as wrapper type and is confusing. use select types directly and slack_blocks::BlockElement instead.

Static

External(External<'a>)
👎 Deprecated since 0.16.6:

enum doesn’t really provide value as wrapper type and is confusing. use select types directly and slack_blocks::BlockElement instead.

External

User(User<'a>)
👎 Deprecated since 0.16.6:

enum doesn’t really provide value as wrapper type and is confusing. use select types directly and slack_blocks::BlockElement instead.

User

Conversation(Conversation<'a>)
👎 Deprecated since 0.16.6:

enum doesn’t really provide value as wrapper type and is confusing. use select types directly and slack_blocks::BlockElement instead.

Conversation

PublicChannel(PublicChannel<'a>)
👎 Deprecated since 0.16.6:

enum doesn’t really provide value as wrapper type and is confusing. use select types directly and slack_blocks::BlockElement instead.

PublicChannel

Implementations

impl<'a> Select<'a>[src]

pub fn from_placeholder_and_action_id(
    placeholder: impl Into<Plain>,
    action_id: impl Into<Cow<'a, str>>
) -> SelectBuilder<'a>
[src]

Construct a Select block elem from required parts

Arguments

  • placeholder: A plain_text [text object 🔗] that defines the placeholder text shown on the menu. Maximum length for the text in this field is 150 characters.
  • action_id: An identifier for the action triggered when a menu option is selected. You can use this when you receive an interaction payload to identify the source of the action. Should be unique among all other action_ids in the containing block. Maximum length for this field is 255 characters.

Example

use slack_blocks::{blocks, blocks::Actions, elems, compose::text};

let fields = vec![
    text::Plain::from("Left column"),
    text::Plain::from("Right column"),
];

let select = elems::Select::from_placeholder_and_action_id("Pick a channel!", "1234")
                                                    .choose_from_public_channels();

let block = Actions::builder().element(select).build();

// < send `block` to slack API >

Trait Implementations

impl<'a> Clone for Select<'a>[src]

fn clone(&self) -> Select<'a>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for Select<'a>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'a> From<Conversation<'a>> for Select<'a>[src]

fn from(src: Conversation<'a>) -> Self[src]

Performs the conversion.

impl<'a> From<External<'a>> for Select<'a>[src]

fn from(src: External<'a>) -> Self[src]

Performs the conversion.

impl<'a> From<PublicChannel<'a>> for Select<'a>[src]

fn from(src: PublicChannel<'a>) -> Self[src]

Performs the conversion.

impl<'a> From<Select<'a>> for BlockElement<'a>[src]

fn from(src: Select<'a>) -> Self[src]

Performs the conversion.

impl<'a> From<Static<'a>> for Select<'a>[src]

fn from(src: Static<'a>) -> Self[src]

Performs the conversion.

impl<'a> From<User<'a>> for Select<'a>[src]

fn from(src: User<'a>) -> Self[src]

Performs the conversion.

impl<'a> Hash for Select<'a>[src]

fn hash<__H: Hasher>(&self, state: &mut __H)[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl<'a> PartialEq<Select<'a>> for Select<'a>[src]

fn eq(&self, other: &Select<'a>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Select<'a>) -> bool[src]

This method tests for !=.

impl<'a> StructuralPartialEq for Select<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Select<'a>

impl<'a> Send for Select<'a>

impl<'a> Sync for Select<'a>

impl<'a> Unpin for Select<'a>

impl<'a> UnwindSafe for Select<'a>

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.