Struct slack_blocks::blocks::file::build::FileBuilder [−][src]
pub struct FileBuilder<'a, ExternalId> { /* fields omitted */ }
Expand description
Build an File block
Allows you to construct safely, with compile-time checks on required setter methods.
Required Methods
FileBuilder::build()
is only available if these methods have been called:
external_id
source
Example
use slack_blocks::{blocks::File, elems::Image, text::ToSlackPlaintext}; let my_file_id: String = { // use Slack Web API: files.remote.add to upload a file }; let block = File::builder().external_id(my_file_id).build();
Implementations
impl<'a, Ext> FileBuilder<'a, Ext>
[src]
impl<'a, Ext> FileBuilder<'a, Ext>
[src]pub fn external_id<S>(self, external_id: S) -> FileBuilder<'a, Set<external_id>> where
S: Into<Cow<'a, str>>,
[src]
pub fn external_id<S>(self, external_id: S) -> FileBuilder<'a, Set<external_id>> where
S: Into<Cow<'a, str>>,
[src]Set external_id
(Required)
The external unique ID for a remote file 🔗.
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> FileBuilder<'a, Set<external_id>>
[src]
impl<'a> FileBuilder<'a, Set<external_id>>
[src]pub fn build(self) -> File<'a>
[src]
pub fn build(self) -> File<'a>
[src]All done building, now give me a darn actions block!
no method name 'build' found for struct 'FileBuilder<...>'
? Make sure all required setter methods have been called. See docs forFileBuilder
.
ⓘ
use slack_blocks::blocks::File; let foo = File::builder().build(); // Won't compile!
use slack_blocks::{blocks::File, compose::text::ToSlackPlaintext, elems::Image}; let my_file_id: String = { // use Slack Web API: files.remote.add to upload a file }; let block = File::builder().external_id(my_file_id).build();
Trait Implementations
Auto Trait Implementations
impl<'a, ExternalId> RefUnwindSafe for FileBuilder<'a, ExternalId> where
ExternalId: RefUnwindSafe,
ExternalId: RefUnwindSafe,
impl<'a, ExternalId> Send for FileBuilder<'a, ExternalId> where
ExternalId: Send,
ExternalId: Send,
impl<'a, ExternalId> Sync for FileBuilder<'a, ExternalId> where
ExternalId: Sync,
ExternalId: Sync,
impl<'a, ExternalId> Unpin for FileBuilder<'a, ExternalId> where
ExternalId: Unpin,
ExternalId: Unpin,
impl<'a, ExternalId> UnwindSafe for FileBuilder<'a, ExternalId> where
ExternalId: UnwindSafe,
ExternalId: UnwindSafe,