Skip to main content

SlackContainerBlock

Struct SlackContainerBlock 

Source
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_title is required; rich_text_title wins when
  • both are set. child_blocks holds 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

Source

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.

Source

pub fn block_id(&mut self, value: SlackBlockId) -> &mut Self

Sets block_id to Some(value).

Source

pub fn reset_block_id(&mut self) -> &mut Self

Sets block_id to None.

Source

pub fn mopt_block_id(&mut self, value: Option<SlackBlockId>) -> &mut Self

Sets block_id to the given Option.

Source

pub fn with_block_id(self, value: SlackBlockId) -> Self

Returns self with block_id set to Some(value).

Source

pub fn without_block_id(self) -> Self

Returns self with block_id set to None.

Source

pub fn opt_block_id(self, value: Option<SlackBlockId>) -> Self

Returns self with block_id set to the given Option.

Source

pub fn title(&mut self, value: SlackBlockPlainTextOnly) -> &mut Self

Sets title to Some(value).

Source

pub fn reset_title(&mut self) -> &mut Self

Sets title to None.

Source

pub fn mopt_title( &mut self, value: Option<SlackBlockPlainTextOnly>, ) -> &mut Self

Sets title to the given Option.

Source

pub fn with_title(self, value: SlackBlockPlainTextOnly) -> Self

Returns self with title set to Some(value).

Source

pub fn without_title(self) -> Self

Returns self with title set to None.

Source

pub fn opt_title(self, value: Option<SlackBlockPlainTextOnly>) -> Self

Returns self with title set to the given Option.

Source

pub fn rich_text_title( &mut self, value: SlackRichTextInlineContent, ) -> &mut Self

Sets rich_text_title to Some(value).

Source

pub fn reset_rich_text_title(&mut self) -> &mut Self

Sets rich_text_title to None.

Source

pub fn mopt_rich_text_title( &mut self, value: Option<SlackRichTextInlineContent>, ) -> &mut Self

Sets rich_text_title to the given Option.

Source

pub fn with_rich_text_title(self, value: SlackRichTextInlineContent) -> Self

Returns self with rich_text_title set to Some(value).

Source

pub fn without_rich_text_title(self) -> Self

Returns self with rich_text_title set to None.

Source

pub fn opt_rich_text_title( self, value: Option<SlackRichTextInlineContent>, ) -> Self

Returns self with rich_text_title set to the given Option.

Source

pub fn subtitle(&mut self, value: SlackBlockText) -> &mut Self

Sets subtitle to Some(value).

Source

pub fn reset_subtitle(&mut self) -> &mut Self

Sets subtitle to None.

Source

pub fn mopt_subtitle(&mut self, value: Option<SlackBlockText>) -> &mut Self

Sets subtitle to the given Option.

Source

pub fn with_subtitle(self, value: SlackBlockText) -> Self

Returns self with subtitle set to Some(value).

Source

pub fn without_subtitle(self) -> Self

Returns self with subtitle set to None.

Source

pub fn opt_subtitle(self, value: Option<SlackBlockText>) -> Self

Returns self with subtitle set to the given Option.

Source

pub fn child_blocks(&mut self, value: Vec<SlackBlock>) -> &mut Self

Sets child_blocks to value.

Source

pub fn with_child_blocks(self, value: Vec<SlackBlock>) -> Self

Returns self with child_blocks set to value.

Source

pub fn width(&mut self, value: SlackContainerWidth) -> &mut Self

Sets width to Some(value).

Source

pub fn reset_width(&mut self) -> &mut Self

Sets width to None.

Source

pub fn mopt_width(&mut self, value: Option<SlackContainerWidth>) -> &mut Self

Sets width to the given Option.

Source

pub fn with_width(self, value: SlackContainerWidth) -> Self

Returns self with width set to Some(value).

Source

pub fn without_width(self) -> Self

Returns self with width set to None.

Source

pub fn opt_width(self, value: Option<SlackContainerWidth>) -> Self

Returns self with width set to the given Option.

Source

pub fn icon(&mut self, value: SlackCardImageElement) -> &mut Self

Sets icon to Some(value).

Source

pub fn reset_icon(&mut self) -> &mut Self

Sets icon to None.

Source

pub fn mopt_icon(&mut self, value: Option<SlackCardImageElement>) -> &mut Self

Sets icon to the given Option.

Source

pub fn with_icon(self, value: SlackCardImageElement) -> Self

Returns self with icon set to Some(value).

Source

pub fn without_icon(self) -> Self

Returns self with icon set to None.

Source

pub fn opt_icon(self, value: Option<SlackCardImageElement>) -> Self

Returns self with icon set to the given Option.

Source

pub fn is_collapsible(&mut self, value: bool) -> &mut Self

Sets is_collapsible to Some(value).

Source

pub fn reset_is_collapsible(&mut self) -> &mut Self

Sets is_collapsible to None.

Source

pub fn mopt_is_collapsible(&mut self, value: Option<bool>) -> &mut Self

Sets is_collapsible to the given Option.

Source

pub fn with_is_collapsible(self, value: bool) -> Self

Returns self with is_collapsible set to Some(value).

Source

pub fn without_is_collapsible(self) -> Self

Returns self with is_collapsible set to None.

Source

pub fn opt_is_collapsible(self, value: Option<bool>) -> Self

Returns self with is_collapsible set to the given Option.

Source

pub fn default_collapsed(&mut self, value: bool) -> &mut Self

Sets default_collapsed to Some(value).

Source

pub fn reset_default_collapsed(&mut self) -> &mut Self

Sets default_collapsed to None.

Source

pub fn mopt_default_collapsed(&mut self, value: Option<bool>) -> &mut Self

Sets default_collapsed to the given Option.

Source

pub fn with_default_collapsed(self, value: bool) -> Self

Returns self with default_collapsed set to Some(value).

Source

pub fn without_default_collapsed(self) -> Self

Returns self with default_collapsed set to None.

Source

pub fn opt_default_collapsed(self, value: Option<bool>) -> Self

Returns self with default_collapsed set to the given Option.

Source

pub fn has_header_divider(&mut self, value: bool) -> &mut Self

Sets has_header_divider to Some(value).

Source

pub fn reset_has_header_divider(&mut self) -> &mut Self

Sets has_header_divider to None.

Source

pub fn mopt_has_header_divider(&mut self, value: Option<bool>) -> &mut Self

Sets has_header_divider to the given Option.

Source

pub fn with_has_header_divider(self, value: bool) -> Self

Returns self with has_header_divider set to Some(value).

Source

pub fn without_has_header_divider(self) -> Self

Returns self with has_header_divider set to None.

Source

pub fn opt_has_header_divider(self, value: Option<bool>) -> Self

Returns self with has_header_divider set to the given Option.

Trait Implementations§

Source§

impl Clone for SlackContainerBlock

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SlackContainerBlock

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SlackContainerBlock

Source§

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

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<SlackContainerBlock> for SlackBlock

Source§

fn from(block: SlackContainerBlock) -> Self

Converts to this type from the input type.
Source§

impl From<SlackContainerBlockInit> for SlackContainerBlock

Source§

fn from(value: SlackContainerBlockInit) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for SlackContainerBlock

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SlackContainerBlock

Source§

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

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SlackContainerBlock

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more