pub struct SlackContainerBlock {
pub block_id: Option<SlackBlockId>,
pub title: Option<SlackBlockPlainTextOnly>,
pub rich_text_title: Option<SlackRichTextInlineContent>,
pub subtitle: Option<SlackBlockText>,
pub child_blocks: Vec<SlackBlock>,
pub width: Option<SlackContainerWidth>,
pub icon: Option<SlackCardImageElement>,
pub is_collapsible: Option<bool>,
pub default_collapsed: Option<bool>,
pub has_header_divider: Option<bool>,
}Expand description
- https://docs.slack.dev/reference/block-kit/blocks/container-block
- One of
title/rich_text_titleis required;rich_text_titlewins when - both are set.
child_blocksholds at most 10 blocks. The docs list - `actions, context, divider, file, header, image, input, rich_text, section,
- table, video` as supported children while the live validator accepts
- `divider, image, section, contact_card, callout, canvas_table, actions,
- video, header, context, table, layout`; neither set is enforced here.
Fields§
§block_id: Option<SlackBlockId>§title: Option<SlackBlockPlainTextOnly>§rich_text_title: Option<SlackRichTextInlineContent>§subtitle: Option<SlackBlockText>§child_blocks: Vec<SlackBlock>§width: Option<SlackContainerWidth>§icon: Option<SlackCardImageElement>§is_collapsible: Option<bool>§default_collapsed: Option<bool>§has_header_divider: Option<bool>Implementations§
Source§impl SlackContainerBlock
impl SlackContainerBlock
Sourcepub fn new(child_blocks: Vec<SlackBlock>) -> Self
pub fn new(child_blocks: Vec<SlackBlock>) -> Self
Creates a new SlackContainerBlock from its required fields. Option fields start as None, and fields with #[default] take their default.
Sourcepub fn block_id(&mut self, value: SlackBlockId) -> &mut Self
pub fn block_id(&mut self, value: SlackBlockId) -> &mut Self
Sets block_id to Some(value).
Sourcepub fn reset_block_id(&mut self) -> &mut Self
pub fn reset_block_id(&mut self) -> &mut Self
Sets block_id to None.
Sourcepub fn mopt_block_id(&mut self, value: Option<SlackBlockId>) -> &mut Self
pub fn mopt_block_id(&mut self, value: Option<SlackBlockId>) -> &mut Self
Sets block_id to the given Option.
Sourcepub fn with_block_id(self, value: SlackBlockId) -> Self
pub fn with_block_id(self, value: SlackBlockId) -> Self
Returns self with block_id set to Some(value).
Sourcepub fn without_block_id(self) -> Self
pub fn without_block_id(self) -> Self
Returns self with block_id set to None.
Sourcepub fn opt_block_id(self, value: Option<SlackBlockId>) -> Self
pub fn opt_block_id(self, value: Option<SlackBlockId>) -> Self
Returns self with block_id set to the given Option.
Sourcepub fn title(&mut self, value: SlackBlockPlainTextOnly) -> &mut Self
pub fn title(&mut self, value: SlackBlockPlainTextOnly) -> &mut Self
Sets title to Some(value).
Sourcepub fn reset_title(&mut self) -> &mut Self
pub fn reset_title(&mut self) -> &mut Self
Sets title to None.
Sourcepub fn mopt_title(
&mut self,
value: Option<SlackBlockPlainTextOnly>,
) -> &mut Self
pub fn mopt_title( &mut self, value: Option<SlackBlockPlainTextOnly>, ) -> &mut Self
Sets title to the given Option.
Sourcepub fn with_title(self, value: SlackBlockPlainTextOnly) -> Self
pub fn with_title(self, value: SlackBlockPlainTextOnly) -> Self
Returns self with title set to Some(value).
Sourcepub fn without_title(self) -> Self
pub fn without_title(self) -> Self
Returns self with title set to None.
Sourcepub fn opt_title(self, value: Option<SlackBlockPlainTextOnly>) -> Self
pub fn opt_title(self, value: Option<SlackBlockPlainTextOnly>) -> Self
Returns self with title set to the given Option.
Sourcepub fn rich_text_title(
&mut self,
value: SlackRichTextInlineContent,
) -> &mut Self
pub fn rich_text_title( &mut self, value: SlackRichTextInlineContent, ) -> &mut Self
Sets rich_text_title to Some(value).
Sourcepub fn reset_rich_text_title(&mut self) -> &mut Self
pub fn reset_rich_text_title(&mut self) -> &mut Self
Sets rich_text_title to None.
Sourcepub fn mopt_rich_text_title(
&mut self,
value: Option<SlackRichTextInlineContent>,
) -> &mut Self
pub fn mopt_rich_text_title( &mut self, value: Option<SlackRichTextInlineContent>, ) -> &mut Self
Sets rich_text_title to the given Option.
Sourcepub fn with_rich_text_title(self, value: SlackRichTextInlineContent) -> Self
pub fn with_rich_text_title(self, value: SlackRichTextInlineContent) -> Self
Returns self with rich_text_title set to Some(value).
Sourcepub fn without_rich_text_title(self) -> Self
pub fn without_rich_text_title(self) -> Self
Returns self with rich_text_title set to None.
Sourcepub fn opt_rich_text_title(
self,
value: Option<SlackRichTextInlineContent>,
) -> Self
pub fn opt_rich_text_title( self, value: Option<SlackRichTextInlineContent>, ) -> Self
Returns self with rich_text_title set to the given Option.
Sourcepub fn subtitle(&mut self, value: SlackBlockText) -> &mut Self
pub fn subtitle(&mut self, value: SlackBlockText) -> &mut Self
Sets subtitle to Some(value).
Sourcepub fn reset_subtitle(&mut self) -> &mut Self
pub fn reset_subtitle(&mut self) -> &mut Self
Sets subtitle to None.
Sourcepub fn mopt_subtitle(&mut self, value: Option<SlackBlockText>) -> &mut Self
pub fn mopt_subtitle(&mut self, value: Option<SlackBlockText>) -> &mut Self
Sets subtitle to the given Option.
Sourcepub fn with_subtitle(self, value: SlackBlockText) -> Self
pub fn with_subtitle(self, value: SlackBlockText) -> Self
Returns self with subtitle set to Some(value).
Sourcepub fn without_subtitle(self) -> Self
pub fn without_subtitle(self) -> Self
Returns self with subtitle set to None.
Sourcepub fn opt_subtitle(self, value: Option<SlackBlockText>) -> Self
pub fn opt_subtitle(self, value: Option<SlackBlockText>) -> Self
Returns self with subtitle set to the given Option.
Sourcepub fn child_blocks(&mut self, value: Vec<SlackBlock>) -> &mut Self
pub fn child_blocks(&mut self, value: Vec<SlackBlock>) -> &mut Self
Sets child_blocks to value.
Sourcepub fn with_child_blocks(self, value: Vec<SlackBlock>) -> Self
pub fn with_child_blocks(self, value: Vec<SlackBlock>) -> Self
Returns self with child_blocks set to value.
Sourcepub fn width(&mut self, value: SlackContainerWidth) -> &mut Self
pub fn width(&mut self, value: SlackContainerWidth) -> &mut Self
Sets width to Some(value).
Sourcepub fn reset_width(&mut self) -> &mut Self
pub fn reset_width(&mut self) -> &mut Self
Sets width to None.
Sourcepub fn mopt_width(&mut self, value: Option<SlackContainerWidth>) -> &mut Self
pub fn mopt_width(&mut self, value: Option<SlackContainerWidth>) -> &mut Self
Sets width to the given Option.
Sourcepub fn with_width(self, value: SlackContainerWidth) -> Self
pub fn with_width(self, value: SlackContainerWidth) -> Self
Returns self with width set to Some(value).
Sourcepub fn without_width(self) -> Self
pub fn without_width(self) -> Self
Returns self with width set to None.
Sourcepub fn opt_width(self, value: Option<SlackContainerWidth>) -> Self
pub fn opt_width(self, value: Option<SlackContainerWidth>) -> Self
Returns self with width set to the given Option.
Sourcepub fn icon(&mut self, value: SlackCardImageElement) -> &mut Self
pub fn icon(&mut self, value: SlackCardImageElement) -> &mut Self
Sets icon to Some(value).
Sourcepub fn reset_icon(&mut self) -> &mut Self
pub fn reset_icon(&mut self) -> &mut Self
Sets icon to None.
Sourcepub fn mopt_icon(&mut self, value: Option<SlackCardImageElement>) -> &mut Self
pub fn mopt_icon(&mut self, value: Option<SlackCardImageElement>) -> &mut Self
Sets icon to the given Option.
Sourcepub fn with_icon(self, value: SlackCardImageElement) -> Self
pub fn with_icon(self, value: SlackCardImageElement) -> Self
Returns self with icon set to Some(value).
Sourcepub fn without_icon(self) -> Self
pub fn without_icon(self) -> Self
Returns self with icon set to None.
Sourcepub fn opt_icon(self, value: Option<SlackCardImageElement>) -> Self
pub fn opt_icon(self, value: Option<SlackCardImageElement>) -> Self
Returns self with icon set to the given Option.
Sourcepub fn is_collapsible(&mut self, value: bool) -> &mut Self
pub fn is_collapsible(&mut self, value: bool) -> &mut Self
Sets is_collapsible to Some(value).
Sourcepub fn reset_is_collapsible(&mut self) -> &mut Self
pub fn reset_is_collapsible(&mut self) -> &mut Self
Sets is_collapsible to None.
Sourcepub fn mopt_is_collapsible(&mut self, value: Option<bool>) -> &mut Self
pub fn mopt_is_collapsible(&mut self, value: Option<bool>) -> &mut Self
Sets is_collapsible to the given Option.
Sourcepub fn with_is_collapsible(self, value: bool) -> Self
pub fn with_is_collapsible(self, value: bool) -> Self
Returns self with is_collapsible set to Some(value).
Sourcepub fn without_is_collapsible(self) -> Self
pub fn without_is_collapsible(self) -> Self
Returns self with is_collapsible set to None.
Sourcepub fn opt_is_collapsible(self, value: Option<bool>) -> Self
pub fn opt_is_collapsible(self, value: Option<bool>) -> Self
Returns self with is_collapsible set to the given Option.
Sourcepub fn default_collapsed(&mut self, value: bool) -> &mut Self
pub fn default_collapsed(&mut self, value: bool) -> &mut Self
Sets default_collapsed to Some(value).
Sourcepub fn reset_default_collapsed(&mut self) -> &mut Self
pub fn reset_default_collapsed(&mut self) -> &mut Self
Sets default_collapsed to None.
Sourcepub fn mopt_default_collapsed(&mut self, value: Option<bool>) -> &mut Self
pub fn mopt_default_collapsed(&mut self, value: Option<bool>) -> &mut Self
Sets default_collapsed to the given Option.
Sourcepub fn with_default_collapsed(self, value: bool) -> Self
pub fn with_default_collapsed(self, value: bool) -> Self
Returns self with default_collapsed set to Some(value).
Sourcepub fn without_default_collapsed(self) -> Self
pub fn without_default_collapsed(self) -> Self
Returns self with default_collapsed set to None.
Sourcepub fn opt_default_collapsed(self, value: Option<bool>) -> Self
pub fn opt_default_collapsed(self, value: Option<bool>) -> Self
Returns self with default_collapsed set to the given Option.
Sourcepub fn has_header_divider(&mut self, value: bool) -> &mut Self
pub fn has_header_divider(&mut self, value: bool) -> &mut Self
Sets has_header_divider to Some(value).
Sourcepub fn reset_has_header_divider(&mut self) -> &mut Self
pub fn reset_has_header_divider(&mut self) -> &mut Self
Sets has_header_divider to None.
Sourcepub fn mopt_has_header_divider(&mut self, value: Option<bool>) -> &mut Self
pub fn mopt_has_header_divider(&mut self, value: Option<bool>) -> &mut Self
Sets has_header_divider to the given Option.
Sourcepub fn with_has_header_divider(self, value: bool) -> Self
pub fn with_has_header_divider(self, value: bool) -> Self
Returns self with has_header_divider set to Some(value).
Sourcepub fn without_has_header_divider(self) -> Self
pub fn without_has_header_divider(self) -> Self
Returns self with has_header_divider set to None.
Sourcepub fn opt_has_header_divider(self, value: Option<bool>) -> Self
pub fn opt_has_header_divider(self, value: Option<bool>) -> Self
Returns self with has_header_divider set to the given Option.