Struct slack_blocks::elems::select::public_channel::build::PublicChannelBuilder [−][src]
pub struct PublicChannelBuilder<'a, Multi, Placeholder, ActionId> { /* fields omitted */ }
Expand description
PublicChannel Select builder
Allows you to construct a PublicChannel Select safely, with compile-time checks on required setter methods.
Required Methods
PublicChannelBuilder::build()
is only available if these methods have been called:
placeholder
action_id
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::{blocks::{Actions, Block}, compose::Opt, elems::{select::PublicChannel, BlockElement}}; let select: BlockElement = PublicChannel::builder().placeholder("Choose your favorite channel!") .action_id("favorite_channel") .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> PublicChannelBuilder<'a, M, P, A>
[src]
impl<'a, M, P, A> PublicChannelBuilder<'a, M, P, A>
[src]pub fn placeholder(
self,
text: impl Into<Plain>
) -> PublicChannelBuilder<'a, M, Set<placeholder>, A>
[src]
pub fn placeholder(
self,
text: impl Into<Plain>
) -> PublicChannelBuilder<'a, M, Set<placeholder>, A>
[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>>
) -> PublicChannelBuilder<'a, M, P, Set<action_id>>
[src]
pub fn action_id(
self,
text: impl Into<Cow<'a, str>>
) -> PublicChannelBuilder<'a, M, P, Set<action_id>>
[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.
impl<'a, M, P, A> PublicChannelBuilder<'a, M, P, A>
[src]
impl<'a, M, P, A> PublicChannelBuilder<'a, M, P, A>
[src]pub fn initial_channel<S>(self, channel: S) -> Self where
S: Into<Cow<'a, str>>,
[src]
pub fn initial_channel<S>(self, channel: S) -> Self where
S: Into<Cow<'a, str>>,
[src]Set initial_channel
(Optional)
The ID of any valid conversation to be pre-selected when the menu loads.
If default_to_current_conversation
is called, this will take precedence.
impl<'a, P, A> PublicChannelBuilder<'a, Multi, P, A>
[src]
impl<'a, P, A> PublicChannelBuilder<'a, Multi, P, A>
[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> PublicChannelBuilder<'a, Single, Set<placeholder>, Set<action_id>>
[src]
impl<'a> PublicChannelBuilder<'a, Single, Set<placeholder>, Set<action_id>>
[src]pub fn build(self) -> PublicChannel<'a>
[src]
pub fn build(self) -> PublicChannel<'a>
[src]All done building, now give me a darn select element!
no method name 'build' found for struct 'select::static_::build::PublicChannelBuilder<...>'
? Make sure all required setter methods have been called. See docs forPublicChannelBuilder
.
use slack_blocks::elems::select::PublicChannel; let sel = PublicChannel::builder().build(); // Won't compile!
use slack_blocks::elems::select::PublicChannel; let sel = PublicChannel::builder().placeholder("foo") .action_id("bar") .build();
impl<'a> PublicChannelBuilder<'a, Multi, Set<placeholder>, Set<action_id>>
[src]
impl<'a> PublicChannelBuilder<'a, Multi, Set<placeholder>, Set<action_id>>
[src]pub fn build(self) -> PublicChannel<'a>
[src]
pub fn build(self) -> PublicChannel<'a>
[src]All done building, now give me a darn select element!
no method name 'build' found for struct 'select::static_::build::PublicChannelBuilder<...>'
? Make sure all required setter methods have been called. See docs forPublicChannelBuilder
.
use slack_blocks::elems::select; let sel = select::multi::PublicChannel::builder().build(); // Won't compile!
use slack_blocks::elems::select; let sel = select::multi::PublicChannel::builder().placeholder("foo") .action_id("bar") .build();
Trait Implementations
Auto Trait Implementations
impl<'a, Multi, Placeholder, ActionId> RefUnwindSafe for PublicChannelBuilder<'a, Multi, Placeholder, ActionId> where
ActionId: RefUnwindSafe,
Multi: RefUnwindSafe,
Placeholder: RefUnwindSafe,
ActionId: RefUnwindSafe,
Multi: RefUnwindSafe,
Placeholder: RefUnwindSafe,
impl<'a, Multi, Placeholder, ActionId> Send for PublicChannelBuilder<'a, Multi, Placeholder, ActionId> where
ActionId: Send,
Multi: Send,
Placeholder: Send,
ActionId: Send,
Multi: Send,
Placeholder: Send,
impl<'a, Multi, Placeholder, ActionId> Sync for PublicChannelBuilder<'a, Multi, Placeholder, ActionId> where
ActionId: Sync,
Multi: Sync,
Placeholder: Sync,
ActionId: Sync,
Multi: Sync,
Placeholder: Sync,
impl<'a, Multi, Placeholder, ActionId> Unpin for PublicChannelBuilder<'a, Multi, Placeholder, ActionId> where
ActionId: Unpin,
Multi: Unpin,
Placeholder: Unpin,
ActionId: Unpin,
Multi: Unpin,
Placeholder: Unpin,
impl<'a, Multi, Placeholder, ActionId> UnwindSafe for PublicChannelBuilder<'a, Multi, Placeholder, ActionId> where
ActionId: UnwindSafe,
Multi: UnwindSafe,
Placeholder: UnwindSafe,
ActionId: UnwindSafe,
Multi: UnwindSafe,
Placeholder: UnwindSafe,