Struct slack_blocks::elems::date_picker::build::DatePickerBuilder [−][src]
pub struct DatePickerBuilder<'a, A> { /* fields omitted */ }
Expand description
Date Picker builder
Allows you to construct safely, with compile-time checks on required setter methods.
Required Methods
DatePickerBuilder::build()
is only available if these methods have been called:
action_id
Example
use std::convert::TryFrom; use slack_blocks::{blocks::{Actions, Block}, elems::{BlockElement, DatePicker}}; let picker = DatePicker::builder().action_id("foo").build(); let block: Block = Actions::builder().element(picker).build().into(); // <send block to slack API>
Implementations
Set action_id
(Optional)
An identifier for the action triggered when a menu option is selected.
You can use this when you receive an interaction payload to identify the source of the action 🔗.
Should be unique among all other action_id
s in the containing block.
Maximum length for this field is 255 characters.
Set placeholder
(Optional)
A plain_text
only text object 🔗 that defines the placeholder text shown on the datepicker.
Maximum length for the text
in this field is 150 characters.
Set initial_date
(Optional)
The initial date that is selected when the element is loaded.
use slack_blocks::elems::DatePicker; DatePicker::builder().action_id("foo") .initial_date((01, 05, 2021)) .build();
Set confirm
(Optional)
A confirm object 🔗 that defines an optional confirmation dialog that appears after a date is selected.
All done building, now give me a darn date picker!
no method name 'build' found for struct 'DatePickerBuilder<...>'
? Make sure all required setter methods have been called. See docs forDatePickerBuilder
.
use slack_blocks::elems::DatePicker; let foo = DatePicker::builder().build(); // Won't compile!
use slack_blocks::{compose::Opt, elems::DatePicker}; let foo = DatePicker::builder().action_id("foo").build();
Trait Implementations
Auto Trait Implementations
impl<'a, A> RefUnwindSafe for DatePickerBuilder<'a, A> where
A: RefUnwindSafe,
impl<'a, A> Send for DatePickerBuilder<'a, A> where
A: Send,
impl<'a, A> Sync for DatePickerBuilder<'a, A> where
A: Sync,
impl<'a, A> Unpin for DatePickerBuilder<'a, A> where
A: Unpin,
impl<'a, A> UnwindSafe for DatePickerBuilder<'a, A> where
A: UnwindSafe,