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
impl Confirm[src]
impl Confirm[src]pub fn builder() -> ConfirmBuilderInit[src]
pub fn builder() -> ConfirmBuilderInit[src]Build a new Confirm object
See ConfirmBuilder for example
pub fn validate(&self) -> Result<(), ValidationErrors>[src]
pub fn validate(&self) -> Result<(), ValidationErrors>[src]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
impl<'de> Deserialize<'de> for Confirm[src]
impl<'de> Deserialize<'de> for Confirm[src]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
impl StructuralPartialEq for Confirm[src]
Auto Trait Implementations
impl RefUnwindSafe for Confirm
impl Send for Confirm
impl Sync for Confirm
impl Unpin for Confirm
impl UnwindSafe for Confirm
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,