Function slack_blocks::blox::actions_block [−][src]
pub fn actions_block() -> ActionsBuilderInit<'static>
This is supported on crate feature
blox
only.Expand description
blocks::Actions
- <actions_block>
Build a blocks::Actions
Attribute | Type | Optional | Available as child |
---|---|---|---|
element | impl Into< blocks::actions::SupportedElement > | ❌ | ✅ |
block_id | String or &str | ✅ | ❌ |
Example
use slack_blocks::{blocks::Actions, blox::*, elems::Button, text}; let xml = blox! { <actions_block> <button action_id="foo">"Foo"</button> <button action_id="bar">"Bar"</button> </actions_block> }; let equivalent = Actions::builder().element(Button::builder().action_id("foo") .text("Foo") .build()) .element(Button::builder().action_id("bar") .text("Bar") .build()) .build(); assert_eq!(xml, equivalent);