pub struct HeaderBuilder<'a, T> { /* private fields */ }Expand description
Build an Header block
Allows you to construct safely, with compile-time checks on required setter methods.
§Required Methods
HeaderBuilder::build() is only available if these methods have been called:
text
§Example
use slack_blocks::blocks::Header;
let block = Header::builder().block_id("foo").text("bar").build();Implementations§
Source§impl<'a, T> HeaderBuilder<'a, T>
impl<'a, T> HeaderBuilder<'a, T>
Sourcepub fn text(self, text: impl Into<Plain>) -> HeaderBuilder<'a, Set<text>>
pub fn text(self, text: impl Into<Plain>) -> HeaderBuilder<'a, Set<text>>
Set text (Required)
The text for the block, in the form of a plain_text text object 🔗.
Maximum length for the text in this field is 150 characters.
Sourcepub fn child(self, text: impl Into<Plain>) -> HeaderBuilder<'a, Set<text>>
Available on crate feature blox only.
pub fn child(self, text: impl Into<Plain>) -> HeaderBuilder<'a, Set<text>>
blox only.XML child alias for Self::text()
Sourcepub fn block_id(self, block_id: impl Into<Cow<'a, str>>) -> Self
pub fn block_id(self, block_id: impl Into<Cow<'a, str>>) -> Self
A string acting as a unique identifier for a block.
If not specified, one will be generated.
Maximum length for this field is 255 characters.
block_id should be unique for each message and each iteration of a message.
If a message is updated, use a new block_id.
Source§impl<'a> HeaderBuilder<'a, Set<text>>
impl<'a> HeaderBuilder<'a, Set<text>>
Sourcepub fn build(self) -> Header<'a>
pub fn build(self) -> Header<'a>
All done building, now give me a darn actions block!
no method name 'build' found for struct 'FileBuilder<...>'? Make sure all required setter methods have been called. See docs forFileBuilder.
use slack_blocks::blocks::Header;
let foo = Header::builder().build(); // Won't compile!use slack_blocks::blocks::Header;
let block = Header::builder().text("Foo").build();Trait Implementations§
Source§impl<'a, T: Clone> Clone for HeaderBuilder<'a, T>
impl<'a, T: Clone> Clone for HeaderBuilder<'a, T>
Source§fn clone(&self) -> HeaderBuilder<'a, T>
fn clone(&self) -> HeaderBuilder<'a, T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more