pub struct Confirm { /* private fields */ }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§
Source§impl Confirm
impl Confirm
Sourcepub fn builder() -> ConfirmBuilderInit
pub fn builder() -> ConfirmBuilderInit
Build a new Confirm object
See ConfirmBuilder for example
Sourcepub fn validate(&self) -> Result<(), ValidationErrors>
Available on crate feature validation only.
pub fn validate(&self) -> Result<(), ValidationErrors>
validation only.Validate that this Confirm composition object agrees with Slack’s model requirements
§Errors
- If
titlelonger than 100 chars - If
textlonger than 300 chars - If
confirmlonger than 30 chars - If
denylonger 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§
Source§impl<'de> Deserialize<'de> for Confirm
impl<'de> Deserialize<'de> for Confirm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Confirm
Auto Trait Implementations§
impl Freeze for Confirm
impl RefUnwindSafe for Confirm
impl Send for Confirm
impl Sync for Confirm
impl Unpin for Confirm
impl UnwindSafe for Confirm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more