pub struct CardBlock { /* private fields */ }Expand description
A compact card with an image, text, and up to three buttons.
Slack reference. Provide at least one of a hero image, title, actions, or body. An image icon and a Slack icon cannot be combined.
Implementations§
Source§impl CardBlock
impl CardBlock
Sourcepub fn builder() -> CardBlockBuilder
pub fn builder() -> CardBlockBuilder
Starts a builder with the documented model defaults.
Sourcepub fn into_builder(self) -> CardBlockBuilder
pub fn into_builder(self) -> CardBlockBuilder
Moves every field into an editable builder, preserving explicit omissions.
Sourcepub fn hero_image(&self) -> Option<&ImageElement>
pub fn hero_image(&self) -> Option<&ImageElement>
Borrows or copies hero_image. Sets the image displayed prominently at the top of the card.
Sourcepub fn icon(&self) -> Option<&ImageElement>
pub fn icon(&self) -> Option<&ImageElement>
Borrows or copies icon. Sets the image displayed beside the title.
Sourcepub fn subtitle(&self) -> Option<&Text>
pub fn subtitle(&self) -> Option<&Text>
Borrows or copies subtitle. Sets the supporting text shown below the title.
Sourcepub fn body(&self) -> Option<&Text>
pub fn body(&self) -> Option<&Text>
Borrows or copies body. Sets the main body text of the card.
Sourcepub fn actions(&self) -> Option<&[ButtonElement]>
pub fn actions(&self) -> Option<&[ButtonElement]>
Borrows or copies actions. Adds up to three buttons in serialization order. Slack controls their visual placement: buttons are right-aligned with primary last; a danger button precedes the other button in a two-button group, or sits at the card’s far left with three buttons.
Sourcepub fn slack_icon(&self) -> Option<&SlackIcon>
pub fn slack_icon(&self) -> Option<&SlackIcon>
Borrows or copies slack_icon. Sets a Slack-provided icon displayed beside the title. Cannot be combined with an image icon.
Sourcepub fn subtext(&self) -> Option<&Text>
pub fn subtext(&self) -> Option<&Text>
Borrows or copies subtext. Sets the small print shown at the bottom of the card.
Sourcepub fn block_id(&self) -> Option<&str>
pub fn block_id(&self) -> Option<&str>
Borrows or copies block_id. Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
Sourcepub fn extensions(&self) -> &Map<String, Value>
pub fn extensions(&self) -> &Map<String, Value>
Borrows checked, unmodeled JSON extension fields.