pub struct Actions<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> Actions<'a>
impl<'a> Actions<'a>
Sourcepub fn builder() -> ActionsBuilderInit<'a>
pub fn builder() -> ActionsBuilderInit<'a>
Build a new Actions block.
For example, see docs for ActionsBuilder.
Sourcepub fn validate(&self) -> Result<(), ValidationErrors>
Available on crate feature validation only.
pub fn validate(&self) -> Result<(), ValidationErrors>
validation only.Validate that this Section block agrees with Slack’s model requirements
§Errors
- If
block_idlonger than 255 chars - If
elementscontains more than 5 elements
§Example
use slack_blocks::{blocks, compose, elems::Button};
let long_string = std::iter::repeat(' ').take(256).collect::<String>();
let block =
blocks::Actions::builder().element(Button::builder().text("Click me")
.action_id("btn")
.build())
.block_id(long_string)
.build();
assert!(matches!(block.validate(), Err(_)));Trait Implementations§
Source§impl<'de, 'a> Deserialize<'de> for Actions<'a>
impl<'de, 'a> Deserialize<'de> for Actions<'a>
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<'a> StructuralPartialEq for Actions<'a>
Auto Trait Implementations§
impl<'a> Freeze for Actions<'a>
impl<'a> RefUnwindSafe for Actions<'a>
impl<'a> Send for Actions<'a>
impl<'a> Sync for Actions<'a>
impl<'a> Unpin for Actions<'a>
impl<'a> UnwindSafe for Actions<'a>
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