Struct slack_blocks::blocks::context::Context [−][src]
pub struct Context<'a> { /* fields omitted */ }
Expand description
Implementations
Build a new Context block.
For example, see docs for ContextBuilder.
This is supported on crate feature validation
only.
This is supported on crate feature
validation
only.Validate that this Context block agrees with Slack’s model requirements
Errors
- If
block_id
longer than 255 chars - If
elements
contains more than 10 objects
Example
use slack_blocks::{blocks::Context, text::ToSlackPlaintext}; let long_string = std::iter::repeat(' ').take(256).collect::<String>(); let block = Context::builder().element("foo".plaintext()) .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
Performs the conversion.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> UnwindSafe for Context<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more