Enum slack_blocks::BlockElement[][src]

pub enum BlockElement<'a> {
Show variants Button(Button<'a>), Checkboxes(Checkboxes<'a>), Image(Image<'a>), DatePicker(DatePicker<'a>), Overflow(Overflow<'a>), RadioButtons(Radio<'a>), TextInput(TextInput<'a>), SelectPublicChannel(PublicChannel<'a>), SelectConversation(Conversation<'a>), SelectUser(User<'a>), SelectExternal(External<'a>), SelectStatic(Static<'a>), MultiSelectStatic(Static<'a>), MultiSelectUser(User<'a>), MultiSelectExternal(External<'a>), MultiSelectConversation(Conversation<'a>), MultiSelectPublicChannel(PublicChannel<'a>),
}
Expand description

Block Elements - interactive components

slack api docs 🔗

Block elements can be used inside of section, context, and actions layout blocks 🔗. Inputs can only be used inside of input blocks.

Our overview of app surfaces that support Block Kit 🔗 shows you where those blocks might be relevant.

Finally, our handling user interactivity guide 🔗 will help you prepare your app to allow for the use of the interactive components listed below.

Variants

Button(Button<'a>)
Checkboxes(Checkboxes<'a>)
Image(Image<'a>)
DatePicker(DatePicker<'a>)
Overflow(Overflow<'a>)
RadioButtons(Radio<'a>)
TextInput(TextInput<'a>)
SelectPublicChannel(PublicChannel<'a>)
SelectConversation(Conversation<'a>)
SelectUser(User<'a>)
SelectExternal(External<'a>)
SelectStatic(Static<'a>)
MultiSelectStatic(Static<'a>)
MultiSelectUser(User<'a>)
MultiSelectExternal(External<'a>)
MultiSelectConversation(Conversation<'a>)
MultiSelectPublicChannel(PublicChannel<'a>)

Implementations

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

pub fn validate(&self) -> Result<(), ValidationErrors>[src]

Validate that this block element agrees with Slack’s model requirements.

use slack_blocks::elems::{BlockElement, Button};

let text = std::iter::repeat('a').take(76).collect::<String>();
let btn = Button::from_text_and_action_id(text, "");

let elem = BlockElement::from(btn);

assert!(matches!(elem.validate(), Err(_)))

Trait Implementations

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

fn clone(&self) -> BlockElement<'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 BlockElement<'a>[src]

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

Formats the value using the given formatter. Read more

impl<'de, 'a> Deserialize<'de> for BlockElement<'a>[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

fn from(src: Radio<'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 BlockElement<'a>[src]

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

impl<'a> Hash for BlockElement<'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<BlockElement<'a>> for BlockElement<'a>[src]

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

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

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

This method tests for !=.

impl<'a> Serialize for BlockElement<'a>[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl<'a> TryFrom<BlockElement<'a>> for Actions<'a>[src]

type Error = ()

The type returned in the event of a conversion error.

fn try_from(element: BlockElement<'a>) -> Result<Self, Self::Error>[src]

Performs the conversion.

impl<'a> TryFrom<BlockElement<'a>> for SupportedElement<'a>[src]

type Error = ()

The type returned in the event of a conversion error.

fn try_from(el: BlockElement<'a>) -> Result<Self, Self::Error>[src]

Performs the conversion.

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for BlockElement<'a>

impl<'a> Send for BlockElement<'a>

impl<'a> Sync for BlockElement<'a>

impl<'a> Unpin for BlockElement<'a>

impl<'a> UnwindSafe for BlockElement<'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.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]