Enum slack_blocks::blocks::Block [−][src]
pub enum Block<'a> { Section(Section<'a>), Divider, Image(Image<'a>), Actions(Actions<'a>), Context(Context<'a>), Input(Input<'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>)
File(File<'a>)
Implementations
impl<'a> Block<'a>
[src]
impl<'a> Block<'a>
[src]pub fn validate(&self) -> Result<(), ValidationErrors>
[src]
pub fn validate(&self) -> Result<(), ValidationErrors>
[src]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
impl<'de, 'a> Deserialize<'de> for Block<'a>
[src]
impl<'de, 'a> Deserialize<'de> for Block<'a>
[src]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> Send for Block<'a>
impl<'a> Sync for Block<'a>
impl<'a> Unpin for Block<'a>
impl<'a> UnwindSafe for Block<'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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,