pub struct File<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> File<'a>
impl<'a> File<'a>
Sourcepub fn builder() -> FileBuilderInit<'a>
pub fn builder() -> FileBuilderInit<'a>
Build a new File block.
For example, see docs for FileBuilder.
Sourcepub fn validate(&self) -> Result<(), ValidationErrors>
Available on crate feature validation only.
pub fn validate(&self) -> Result<(), ValidationErrors>
validation only.Validate that this File block agrees with Slack’s model requirements
§Errors
- If
block_idlonger than 256 chars
§Example
use slack_blocks::{blocks::File, compose};
let long_string = std::iter::repeat(' ').take(256).collect::<String>();
let block = File::builder().external_id("file_id")
.block_id(long_string)
.build();
assert_eq!(true, matches!(block.validate(), Err(_)));
// < send to slack API >Trait Implementations§
Source§impl<'de, 'a> Deserialize<'de> for File<'a>
impl<'de, 'a> Deserialize<'de> for File<'a>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<'a> StructuralPartialEq for File<'a>
Auto Trait Implementations§
impl<'a> Freeze for File<'a>
impl<'a> RefUnwindSafe for File<'a>
impl<'a> Send for File<'a>
impl<'a> Sync for File<'a>
impl<'a> Unpin for File<'a>
impl<'a> UnwindSafe for File<'a>
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