Struct slack_blocks::blocks::image::Image [−][src]
pub struct Image<'a> { /* fields omitted */ }
Expand description
Implementations
Build a new Image block.
For example, see docs for ImageBuilder.
This is supported on crate feature validation
only.
This is supported on crate feature
validation
only.Validate that this Image block agrees with Slack’s model requirements
Errors
- If
block_id
longer than 255 chars - If title longer than 2000 chars
- If
alt_text
longer than 2000 chars - If
image_url
longer than 3000 chars
Example
use slack_blocks::blocks; let long_string = std::iter::repeat(' ').take(256).collect::<String>(); let block = blocks::Image::builder().image_url("") .alt("") .block_id(long_string) .build(); assert_eq!(true, matches!(block.validate(), Err(_)));
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for Image<'a>
impl<'a> UnwindSafe for Image<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more