Struct slack_blocks::compose::Confirm [−][src]
pub struct Confirm { /* fields omitted */ }
Expand description
Confirm Dialog
An object that defines a dialog that provides a confirmation step to any interactive element. This dialog will ask the user to confirm their action by offering a confirm and deny buttons.
Implementations
Build a new Confirm object
See ConfirmBuilder for example
This is supported on crate feature validation
only.
This is supported on crate feature
validation
only.Validate that this Confirm composition object agrees with Slack’s model requirements
Errors
- If
title
longer than 100 chars - If
text
longer than 300 chars - If
confirm
longer than 30 chars - If
deny
longer than 30 chars
Example
use slack_blocks::compose::{Confirm, ConfirmStyle}; use slack_blocks::text; let dialog = Confirm::builder().title( "Are you sure?",).text( text::Mrkdwn::from("Are you _sure_ you're sure?\nThis action is permanent."),).confirm( "I'm sure.",).deny( "I'm not sure! Oh, geez, I just don't know! Help me decide, please??? Gosh, this is scary...",) .style(ConfirmStyle::Danger) .build(); assert_eq!(true, matches!(dialog.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 RefUnwindSafe for Confirm
impl UnwindSafe for Confirm
Blanket Implementations
Mutably borrows from an owned value. Read more