Enum slack_blocks::Block [−][src]
pub enum Block<'a> { Section(Section<'a>), Divider, Image(Image<'a>), Actions(Actions<'a>), Context(Context<'a>), Input(Input<'a>), Header(Header<'a>), File(File<'a>), }
Expand description
Layout Blocks
Blocks are a series of components that can be combined to create visually rich and compellingly interactive messages.
Read our guide to building block layouts 🔗 to learn where and how to use each of these components.
You can include up to 50 blocks in each message, and 100 blocks in modals or home tabs.
Variants
Section(Section<'a>)
Divider Block
A content divider, like an <hr>
,
to split up different blocks inside of a message.
The divider block is nice and neat, requiring no fields.
Image(Image<'a>)
Actions(Actions<'a>)
Context(Context<'a>)
Input(Input<'a>)
Header(Header<'a>)
File(File<'a>)
Implementations
This is supported on crate feature validation
only.
This is supported on crate feature
validation
only.Validate that this block agrees with Slack’s model requirements.
use slack_blocks::{blocks, blocks::Image}; let long_string = std::iter::repeat('a').take(2001).collect::<String>(); let img = Image::builder().src("foo.com").alt(long_string).build(); assert!(matches!(img.validate(), Err(_)), "validation should fail!")
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[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
Auto Trait Implementations
impl<'a> RefUnwindSafe for Block<'a>
impl<'a> UnwindSafe for Block<'a>