Struct slack_blocks::compose::confirm::build::ConfirmBuilder[][src]

pub struct ConfirmBuilder<Title, Text, Confirm, Deny> { /* fields omitted */ }
Expand description

Confirm Builder

Allows you to construct safely, with compile-time checks on required setter methods.

Required Methods

ConfirmBuilder::build() is only available if these methods have been called:

  • title
  • text
  • confirm
  • deny
use slack_blocks::compose::Confirm;

let foo = Confirm::builder().title("do stuff?")
                            .text_plain("stuff")
                            .confirm("do the stuff")
                            .deny("wait no")
                            .build();

Implementations

Construct a new confirm builder

Set style (Required)

Defines the color scheme applied to the confirm button.

A value of danger will display the button with a red background on desktop, or red text on mobile.

A value of primary will display the button with a green background on desktop, or blue text on mobile.

If this field is not provided, the default value will be primary.

Set title (Required)

A plain_text-only text object 🔗 that defines the dialog’s title.

Maximum length for this field is 100 characters.

Set confirm (Required)

A plain_text-only text object 🔗 to define the text of the button that confirms the action.

Maximum length for the text in this field is 30 characters.

Set deny (Required)

A plain_text-only text object 🔗 to define the text of the button that cancels the action.

Maximum length for the text in this field is 30 characters.

Set text (Required)

A text object 🔗 that defines the explanatory text that appears in the confirm dialog.

Maximum length for the text in this field is 300 characters.

Set text to some plain text (Required)

A text object 🔗 that defines the explanatory text that appears in the confirm dialog.

Maximum length for the text in this field is 300 characters.

Set text to some markdown (Required)

A text object 🔗 that defines the explanatory text that appears in the confirm dialog.

Maximum length for the text in this field is 300 characters.

All done building, now give me a darn confirm object!

no method name 'build' found for struct 'ConfirmBuilder<...>'? Make sure all required setter methods have been called. See docs for ConfirmBuilder.

use slack_blocks::compose::Confirm;

let foo = Confirm::builder().build(); // Won't compile!
use slack_blocks::compose::Confirm;

let foo = Confirm::builder().title("do stuff?")
                            .text_plain("stuff")
                            .confirm("do the stuff")
                            .deny("wait no")
                            .build();

Trait Implementations

Formats the value using the given formatter. 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 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.