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: BlockElement = DatePicker::builder().action_id("foo").build().into(); let block: Block = Actions::try_from(picker).unwrap().into(); // <send block to slack API>
Implementations
impl<'a, A> DatePickerBuilder<'a, A>
[src]
impl<'a, A> DatePickerBuilder<'a, A>
[src]pub fn action_id<S>(self, action_id: S) -> DatePickerBuilder<'a, Set<action_id>> where
S: Into<Cow<'a, str>>,
[src]
pub fn action_id<S>(self, action_id: S) -> DatePickerBuilder<'a, Set<action_id>> where
S: Into<Cow<'a, str>>,
[src]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.
pub fn placeholder<S>(self, placeholder: S) -> Self where
S: Into<Plain>,
[src]
pub fn placeholder<S>(self, placeholder: S) -> Self where
S: Into<Plain>,
[src]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.
pub fn initial_date(self, day: u8, month: u8, year: u16) -> Self
[src]
pub fn initial_date(self, day: u8, month: u8, year: u16) -> Self
[src]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();
pub fn confirm(self, confirm: Confirm) -> Self
[src]
pub fn confirm(self, confirm: Confirm) -> Self
[src]Set confirm
(Optional)
A confirm object 🔗 that defines an optional confirmation dialog that appears after a date is selected.
impl<'a> DatePickerBuilder<'a, Set<action_id>>
[src]
impl<'a> DatePickerBuilder<'a, Set<action_id>>
[src]pub fn build(self) -> DatePicker<'a>
[src]
pub fn build(self) -> DatePicker<'a>
[src]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,
A: RefUnwindSafe,
impl<'a, A> Send for DatePickerBuilder<'a, A> where
A: Send,
A: Send,
impl<'a, A> Sync for DatePickerBuilder<'a, A> where
A: Sync,
A: Sync,
impl<'a, A> Unpin for DatePickerBuilder<'a, A> where
A: Unpin,
A: Unpin,
impl<'a, A> UnwindSafe for DatePickerBuilder<'a, A> where
A: UnwindSafe,
A: UnwindSafe,