pub struct FileBuilder<'a, ExternalId> { /* private fields */ }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_idsource
§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§
Source§impl<'a, Ext> FileBuilder<'a, Ext>
impl<'a, Ext> FileBuilder<'a, Ext>
Sourcepub fn external_id<S>(self, external_id: S) -> FileBuilder<'a, Set<external_id>>
pub fn external_id<S>(self, external_id: S) -> FileBuilder<'a, Set<external_id>>
Set external_id (Required)
The external unique ID for a remote file 🔗.
Sourcepub fn block_id<S>(self, block_id: S) -> Self
pub fn block_id<S>(self, block_id: S) -> Self
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.
Source§impl<'a> FileBuilder<'a, Set<external_id>>
impl<'a> FileBuilder<'a, Set<external_id>>
Sourcepub fn build(self) -> File<'a>
pub fn build(self) -> File<'a>
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> Freeze for FileBuilder<'a, ExternalId>
impl<'a, ExternalId> RefUnwindSafe for FileBuilder<'a, ExternalId>where
ExternalId: RefUnwindSafe,
impl<'a, ExternalId> Send for FileBuilder<'a, ExternalId>where
ExternalId: Send,
impl<'a, ExternalId> Sync for FileBuilder<'a, ExternalId>where
ExternalId: Sync,
impl<'a, ExternalId> Unpin for FileBuilder<'a, ExternalId>where
ExternalId: Unpin,
impl<'a, ExternalId> UnwindSafe for FileBuilder<'a, ExternalId>where
ExternalId: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more