pub enum ActionBinding {
SetProperty {
path: PropertyPath,
value: String,
},
ToggleProperty {
path: PropertyPath,
},
IncrementProperty {
path: PropertyPath,
amount: Option<f64>,
},
Navigate {
route: String,
},
Dispatch {
message: String,
payload: Option<String>,
},
Batch {
actions: Vec<ActionBinding>,
},
}Expand description
Action binding for state updates.
Variants§
SetProperty
Set a property to a value
ToggleProperty
Toggle a boolean property
Fields
§
path: PropertyPathProperty path
IncrementProperty
Increment a numeric property
Navigate to a route
Dispatch
Dispatch a custom message
Batch
Execute multiple actions
Fields
§
actions: Vec<ActionBinding>Actions to execute
Implementations§
Source§impl ActionBinding
impl ActionBinding
Sourcepub fn set(path: impl Into<PropertyPath>, value: impl Into<String>) -> Self
pub fn set(path: impl Into<PropertyPath>, value: impl Into<String>) -> Self
Create a set property action.
Sourcepub fn toggle(path: impl Into<PropertyPath>) -> Self
pub fn toggle(path: impl Into<PropertyPath>) -> Self
Create a toggle action.
Sourcepub fn increment(path: impl Into<PropertyPath>) -> Self
pub fn increment(path: impl Into<PropertyPath>) -> Self
Create an increment action.
Sourcepub fn increment_by(path: impl Into<PropertyPath>, amount: f64) -> Self
pub fn increment_by(path: impl Into<PropertyPath>, amount: f64) -> Self
Create an increment by amount action.
Create a navigate action.
Sourcepub fn dispatch_with(
message: impl Into<String>,
payload: impl Into<String>,
) -> Self
pub fn dispatch_with( message: impl Into<String>, payload: impl Into<String>, ) -> Self
Create a dispatch with payload action.
Sourcepub fn batch(actions: impl IntoIterator<Item = Self>) -> Self
pub fn batch(actions: impl IntoIterator<Item = Self>) -> Self
Create a batch of actions.
Trait Implementations§
Source§impl Clone for ActionBinding
impl Clone for ActionBinding
Source§fn clone(&self) -> ActionBinding
fn clone(&self) -> ActionBinding
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActionBinding
impl Debug for ActionBinding
Source§impl<'de> Deserialize<'de> for ActionBinding
impl<'de> Deserialize<'de> for ActionBinding
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
Auto Trait Implementations§
impl Freeze for ActionBinding
impl RefUnwindSafe for ActionBinding
impl Send for ActionBinding
impl Sync for ActionBinding
impl Unpin for ActionBinding
impl UnwindSafe for ActionBinding
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