Struct slack_blocks::blocks::input::build::InputBuilder [−][src]
pub struct InputBuilder<'a, Element, Label> { /* fields omitted */ }
Expand description
Build an Input block
Allows you to construct safely, with compile-time checks on required setter methods.
Required Methods
InputBuilder::build()
is only available if these methods have been called:
element
Example
use slack_blocks::{blocks::Input, compose::text::ToSlackPlaintext, elems::TextInput}; let block = Input::builder().label("foo".plaintext()) .element(TextInput::builder().action_id("foo").build()) .build();
Implementations
impl<'a, E, L> InputBuilder<'a, E, L>
[src]
impl<'a, E, L> InputBuilder<'a, E, L>
[src]pub fn element<El>(self, element: El) -> InputBuilder<'a, Set<element>, L> where
El: Into<SupportedElement<'a>>,
[src]
pub fn element<El>(self, element: El) -> InputBuilder<'a, Set<element>, L> where
El: Into<SupportedElement<'a>>,
[src]Set element
(Required)
An interactive block_element
that will be used to gather
the input for this block.
For the kinds of Elements supported by
Input blocks, see the SupportedElement
enum.
pub fn label<T>(self, label: T) -> InputBuilder<'a, E, Set<label>> where
T: Into<Plain>,
[src]
pub fn label<T>(self, label: T) -> InputBuilder<'a, E, Set<label>> where
T: Into<Plain>,
[src]Set label
(Required)
A label that appears above an input element in the form of
a text object 🔗 that must have type of plain_text
.
Maximum length for the text in this field is 2000 characters.
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> InputBuilder<'a, Set<element>, Set<label>>
[src]
impl<'a> InputBuilder<'a, Set<element>, Set<label>>
[src]pub fn build(self) -> Input<'a>
[src]
pub fn build(self) -> Input<'a>
[src]All done building, now give me a darn actions block!
no method name 'build' found for struct 'InputBuilder<...>'
? Make sure all required setter methods have been called. See docs forInputBuilder
.
use slack_blocks::blocks::Input; let foo = Input::builder().build(); // Won't compile!
use slack_blocks::{blocks::Input, compose::text::ToSlackPlaintext, elems::TextInput}; let block = Input::builder().label("foo".plaintext()) .element(TextInput::builder().action_id("foo").build()) .build();
Trait Implementations
Auto Trait Implementations
impl<'a, Element, Label> RefUnwindSafe for InputBuilder<'a, Element, Label> where
Element: RefUnwindSafe,
Label: RefUnwindSafe,
Element: RefUnwindSafe,
Label: RefUnwindSafe,
impl<'a, Element, Label> Send for InputBuilder<'a, Element, Label> where
Element: Send,
Label: Send,
Element: Send,
Label: Send,
impl<'a, Element, Label> Sync for InputBuilder<'a, Element, Label> where
Element: Sync,
Label: Sync,
Element: Sync,
Label: Sync,
impl<'a, Element, Label> Unpin for InputBuilder<'a, Element, Label> where
Element: Unpin,
Label: Unpin,
Element: Unpin,
Label: Unpin,
impl<'a, Element, Label> UnwindSafe for InputBuilder<'a, Element, Label> where
Element: UnwindSafe,
Label: UnwindSafe,
Element: UnwindSafe,
Label: UnwindSafe,