Struct slack_blocks::blocks::actions::build::ActionsBuilder [−][src]
pub struct ActionsBuilder<'a, Elements> { /* fields omitted */ }
Expand description
Build an Actions block
Allows you to construct safely, with compile-time checks on required setter methods.
Required Methods
ActionsBuilder::build()
is only available if these methods have been called:
element
Example
use slack_blocks::{blocks::Actions, elems::Button}; let block = Actions::builder().element(Button::builder().text("Click me!") .action_id("clicked") .build()) .build();
Implementations
impl<'a, E> ActionsBuilder<'a, E>
[src]
impl<'a, E> ActionsBuilder<'a, E>
[src]pub fn element<El>(self, element: El) -> ActionsBuilder<'a, Set<elements>> where
El: Into<SupportedElement<'a>>,
[src]
pub fn element<El>(self, element: El) -> ActionsBuilder<'a, Set<elements>> where
El: Into<SupportedElement<'a>>,
[src]Add an element
(Required, can be called many times)
Add an interactive element object 🔗
For a list of BlockElement
types that are supported, see slack_blocks::blocks::actions::SupportedElement
.
There is a maximum of 5 elements in each action block.
pub fn block_id<S>(self, block_id: S) -> Self where
S: Into<Cow<'a, str>>,
[src]
pub fn block_id<S>(self, block_id: S) -> Self where
S: Into<Cow<'a, str>>,
[src]Set block_id
(Optional)
A string acting as a unique identifier for a block.
You can use this block_id
when you receive an interaction payload
to identify the source of the action 🔗.
If not specified, a block_id
will be generated.
Maximum length for this field is 255 characters.
impl<'a> ActionsBuilder<'a, Set<elements>>
[src]
impl<'a> ActionsBuilder<'a, Set<elements>>
[src]pub fn build(self) -> Actions<'a>
[src]
pub fn build(self) -> Actions<'a>
[src]All done building, now give me a darn actions block!
no method name 'build' found for struct 'ActionsBuilder<...>'
? Make sure all required setter methods have been called. See docs forActionsBuilder
.
use slack_blocks::blocks::Actions; let foo = Actions::builder().build(); // Won't compile!
use slack_blocks::{blocks::Actions, elems::Button}; let block = Actions::builder().element(Button::builder().text("Click me!") .action_id("clicked") .build()) .build();
Trait Implementations
Auto Trait Implementations
impl<'a, Elements> RefUnwindSafe for ActionsBuilder<'a, Elements> where
Elements: RefUnwindSafe,
Elements: RefUnwindSafe,
impl<'a, Elements> Send for ActionsBuilder<'a, Elements> where
Elements: Send,
Elements: Send,
impl<'a, Elements> Sync for ActionsBuilder<'a, Elements> where
Elements: Sync,
Elements: Sync,
impl<'a, Elements> Unpin for ActionsBuilder<'a, Elements> where
Elements: Unpin,
Elements: Unpin,
impl<'a, Elements> UnwindSafe for ActionsBuilder<'a, Elements> where
Elements: UnwindSafe,
Elements: UnwindSafe,