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

This is supported on crate feature validation only.

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::builder().text(text).action_id("").build();

let elem = BlockElement::from(btn.clone());

assert_eq!(elem.validate(), btn.validate())

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

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

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

This is supported on crate feature blox only.

Identity function

The resulting type after obtaining ownership.

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

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

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.