pub struct DispatchActionConfiguration { /* private fields */ }Expand description
Dispatch action configuration representation.
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| trigger_actions_on | Vec<TriggerAction> | No | Must contain at least one item if provided |
§Example
use slack_messaging::composition_objects::{DispatchActionConfiguration, types::TriggerAction};
let config = DispatchActionConfiguration::builder()
.trigger_action(TriggerAction::OnEnterPressed)
.trigger_action(TriggerAction::OnCharacterEntered)
.build()?;
let expected = serde_json::json!({
"trigger_actions_on": [
"on_enter_pressed",
"on_character_entered"
]
});
let json = serde_json::to_value(config).unwrap();
assert_eq!(json, expected);
// If your object has any validation errors, the build method returns Result::Err
let config = DispatchActionConfiguration::builder()
.trigger_actions_on(vec![])
.build();
assert!(config.is_err());Implementations§
Source§impl DispatchActionConfiguration
impl DispatchActionConfiguration
Sourcepub fn builder() -> DispatchActionConfigurationBuilder
pub fn builder() -> DispatchActionConfigurationBuilder
constract DispatchActionConfigurationBuilder object.
Trait Implementations§
Source§impl Clone for DispatchActionConfiguration
impl Clone for DispatchActionConfiguration
Source§fn clone(&self) -> DispatchActionConfiguration
fn clone(&self) -> DispatchActionConfiguration
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DispatchActionConfiguration
impl Debug for DispatchActionConfiguration
impl StructuralPartialEq for DispatchActionConfiguration
Auto Trait Implementations§
impl Freeze for DispatchActionConfiguration
impl RefUnwindSafe for DispatchActionConfiguration
impl Send for DispatchActionConfiguration
impl Sync for DispatchActionConfiguration
impl Unpin for DispatchActionConfiguration
impl UnwindSafe for DispatchActionConfiguration
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)