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>), }
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>)
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>)
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>)
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>)
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>)
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]
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]
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> From<Conversation<'a>> for Select<'a>
[src]
impl<'a> From<Conversation<'a>> for Select<'a>
[src]fn from(src: Conversation<'a>) -> Self
[src]
fn from(src: Conversation<'a>) -> Self
[src]Performs the conversion.
impl<'a> From<PublicChannel<'a>> for Select<'a>
[src]
impl<'a> From<PublicChannel<'a>> for Select<'a>
[src]fn from(src: PublicChannel<'a>) -> Self
[src]
fn from(src: PublicChannel<'a>) -> Self
[src]Performs the conversion.
impl<'a> From<Select<'a>> for BlockElement<'a>
[src]
impl<'a> From<Select<'a>> for BlockElement<'a>
[src]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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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