Struct slack_blocks::elems::select::external::build::ExternalBuilder [−][src]
pub struct ExternalBuilder<'a, Multi, Placeholder, ActionId, Options> { /* fields omitted */ }
Expand description
External Select builder
Allows you to construct a External Select safely, with compile-time checks on required setter methods.
Required Methods
ExternalBuilder::build()
is only available if these methods have been called:
placeholder
action_id
options
oroption_groups
NOTE: I’m experimenting with an API that deviates from the from_foo_and_bar
.
If you’re a user of this library, please give me feedback in the repository
as to which pattern you like more. This will most likely be the new builder pattern
for every structure in this crate.
Example
use std::convert::TryFrom; use slack_blocks::{elems::{select::External, BlockElement}, blocks::{Actions, Block}, compose::Opt}; let select: BlockElement = External::builder().placeholder("Choose your favorite programming language!") .action_id("lang_chosen") .build() .into(); let block: Block = Actions::try_from(select).expect("actions supports select elements") .into(); // <send block to API>
Implementations
impl<'a, M, P, A, O> ExternalBuilder<'a, M, P, A, O>
[src]
impl<'a, M, P, A, O> ExternalBuilder<'a, M, P, A, O>
[src]pub fn placeholder(
self,
text: impl Into<Plain>
) -> ExternalBuilder<'a, M, Set<placeholder>, A, O>
[src]
pub fn placeholder(
self,
text: impl Into<Plain>
) -> ExternalBuilder<'a, M, Set<placeholder>, A, O>
[src]Set placeholder
(Required)
A plain_text
only text object 🔗 that defines
the placeholder text shown on the menu.
Maximum length for the text
in this field is 150 characters.
pub fn action_id(
self,
text: impl Into<Cow<'a, str>>
) -> ExternalBuilder<'a, M, P, Set<action_id>, O>
[src]
pub fn action_id(
self,
text: impl Into<Cow<'a, str>>
) -> ExternalBuilder<'a, M, P, Set<action_id>, O>
[src]Set action_id
(Required)
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 used elsewhere by your app.
Maximum length for this field is 255 characters.
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 menu item is selected.
pub fn min_query_length(self, min: u64) -> Self
[src]
pub fn min_query_length(self, min: u64) -> Self
[src]Set min_query_length
(Optional)
When the typeahead field is used, a request will be sent on every character change.
If you prefer fewer requests or more fully ideated queries,
use the min_query_length
attribute to tell Slack the fewest number
of typed characters required before dispatch.
The default value is 3
.
impl<'a, P, A, O> ExternalBuilder<'a, Multi, P, A, O>
[src]
impl<'a, P, A, O> ExternalBuilder<'a, Multi, P, A, O>
[src]pub fn max_selected_items(self, max: u32) -> Self
[src]
pub fn max_selected_items(self, max: u32) -> Self
[src]Set max_selected_items
(Optional)
Specifies the maximum number of items that can be selected in the menu.
Minimum number is 1.
impl<'a, P, A> ExternalBuilder<'a, Multi, P, A, OptionalMethodNotCalled<initial_option>>
[src]
impl<'a, P, A> ExternalBuilder<'a, Multi, P, A, OptionalMethodNotCalled<initial_option>>
[src]pub fn initial_options<I>(
self,
options: I
) -> ExternalBuilder<'a, Multi, P, A, Set<initial_option>> where
I: IntoIterator<Item = Opt<'a, Plain, NoUrl>>,
[src]
pub fn initial_options<I>(
self,
options: I
) -> ExternalBuilder<'a, Multi, P, A, Set<initial_option>> where
I: IntoIterator<Item = Opt<'a, Plain, NoUrl>>,
[src]Set initial_options
(Optional)
An array of option objects 🔗 that exactly match one or more of the options loaded from the external data source.
These options will be selected when the menu initially loads.
pub fn initial_option_groups<I>(
self,
option_groups: I
) -> ExternalBuilder<'a, Multi, P, A, Set<initial_option>> where
I: IntoIterator<Item = OptGroup<'a, Plain, NoUrl>>,
[src]
pub fn initial_option_groups<I>(
self,
option_groups: I
) -> ExternalBuilder<'a, Multi, P, A, Set<initial_option>> where
I: IntoIterator<Item = OptGroup<'a, Plain, NoUrl>>,
[src]Set initial_options
(Optional)
An array of option objects 🔗 that exactly match one or more of the options loaded from the external data source.
These options will be selected when the menu initially loads.
impl<'a, P, A> ExternalBuilder<'a, Single, P, A, OptionalMethodNotCalled<initial_option>>
[src]
impl<'a, P, A> ExternalBuilder<'a, Single, P, A, OptionalMethodNotCalled<initial_option>>
[src]pub fn initial_option(
self,
option: Opt<'a, Plain, NoUrl>
) -> ExternalBuilder<'a, Single, P, A, Set<initial_option>>
[src]
pub fn initial_option(
self,
option: Opt<'a, Plain, NoUrl>
) -> ExternalBuilder<'a, Single, P, A, Set<initial_option>>
[src]Set initial_option
(Optional)
A single option that exactly matches one of the options loaded from the external data source.
This option will be selected when the menu initially loads.
pub fn initial_option_group(
self,
option_group: OptGroup<'a, Plain, NoUrl>
) -> ExternalBuilder<'a, Single, P, A, Set<initial_option>>
[src]
pub fn initial_option_group(
self,
option_group: OptGroup<'a, Plain, NoUrl>
) -> ExternalBuilder<'a, Single, P, A, Set<initial_option>>
[src]Set initial_option
(Optional)
A single option group that exactly matches one of the option groups loaded from the external data source.
This option will be selected when the menu initially loads.
impl<'a, O> ExternalBuilder<'a, Single, Set<placeholder>, Set<action_id>, O>
[src]
impl<'a, O> ExternalBuilder<'a, Single, Set<placeholder>, Set<action_id>, O>
[src]pub fn build(self) -> External<'a>
[src]
pub fn build(self) -> External<'a>
[src]All done building, now give me a darn select element!
no method name 'build' found for struct 'select::static_::build::ExternalBuilder<...>'
? Make sure all required setter methods have been called. See docs forExternalBuilder
.
use slack_blocks::elems::select::External; let sel = External::builder().build(); // Won't compile!
use slack_blocks::elems::select::External; let sel = External::builder().placeholder("foo") .action_id("bar") .build();
impl<'a, O> ExternalBuilder<'a, Multi, Set<placeholder>, Set<action_id>, O>
[src]
impl<'a, O> ExternalBuilder<'a, Multi, Set<placeholder>, Set<action_id>, O>
[src]pub fn build(self) -> External<'a>
[src]
pub fn build(self) -> External<'a>
[src]All done building, now give me a darn select element!
no method name 'build' found for struct 'select::static_::build::ExternalBuilder<...>'
? Make sure all required setter methods have been called. See docs forExternalBuilder
.
use slack_blocks::elems::select::External; let sel = External::builder().build(); // Won't compile!
use slack_blocks::elems::select::External; let sel = External::builder().placeholder("foo") .action_id("bar") .build();
Trait Implementations
Auto Trait Implementations
impl<'a, Multi, Placeholder, ActionId, Options> RefUnwindSafe for ExternalBuilder<'a, Multi, Placeholder, ActionId, Options> where
ActionId: RefUnwindSafe,
Multi: RefUnwindSafe,
Options: RefUnwindSafe,
Placeholder: RefUnwindSafe,
ActionId: RefUnwindSafe,
Multi: RefUnwindSafe,
Options: RefUnwindSafe,
Placeholder: RefUnwindSafe,
impl<'a, Multi, Placeholder, ActionId, Options> Send for ExternalBuilder<'a, Multi, Placeholder, ActionId, Options> where
ActionId: Send,
Multi: Send,
Options: Send,
Placeholder: Send,
ActionId: Send,
Multi: Send,
Options: Send,
Placeholder: Send,
impl<'a, Multi, Placeholder, ActionId, Options> Sync for ExternalBuilder<'a, Multi, Placeholder, ActionId, Options> where
ActionId: Sync,
Multi: Sync,
Options: Sync,
Placeholder: Sync,
ActionId: Sync,
Multi: Sync,
Options: Sync,
Placeholder: Sync,
impl<'a, Multi, Placeholder, ActionId, Options> Unpin for ExternalBuilder<'a, Multi, Placeholder, ActionId, Options> where
ActionId: Unpin,
Multi: Unpin,
Options: Unpin,
Placeholder: Unpin,
ActionId: Unpin,
Multi: Unpin,
Options: Unpin,
Placeholder: Unpin,
impl<'a, Multi, Placeholder, ActionId, Options> UnwindSafe for ExternalBuilder<'a, Multi, Placeholder, ActionId, Options> where
ActionId: UnwindSafe,
Multi: UnwindSafe,
Options: UnwindSafe,
Placeholder: UnwindSafe,
ActionId: UnwindSafe,
Multi: UnwindSafe,
Options: UnwindSafe,
Placeholder: UnwindSafe,