Struct slack_blocks::compose::Confirm[][src]

pub struct Confirm { /* fields omitted */ }
Expand description

Confirm Dialog

slack api docs 🔗

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

This is supported on crate feature blox only.

Identity function

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.