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>,
) -> ActionBinding
pub fn set( path: impl Into<PropertyPath>, value: impl Into<String>, ) -> ActionBinding
Create a set property action.
Sourcepub fn toggle(path: impl Into<PropertyPath>) -> ActionBinding
pub fn toggle(path: impl Into<PropertyPath>) -> ActionBinding
Create a toggle action.
Sourcepub fn increment(path: impl Into<PropertyPath>) -> ActionBinding
pub fn increment(path: impl Into<PropertyPath>) -> ActionBinding
Create an increment action.
Sourcepub fn increment_by(path: impl Into<PropertyPath>, amount: f64) -> ActionBinding
pub fn increment_by(path: impl Into<PropertyPath>, amount: f64) -> ActionBinding
Create an increment by amount action.
Create a navigate action.
Sourcepub fn dispatch(message: impl Into<String>) -> ActionBinding
pub fn dispatch(message: impl Into<String>) -> ActionBinding
Create a dispatch action.
Sourcepub fn dispatch_with(
message: impl Into<String>,
payload: impl Into<String>,
) -> ActionBinding
pub fn dispatch_with( message: impl Into<String>, payload: impl Into<String>, ) -> ActionBinding
Create a dispatch with payload action.
Sourcepub fn batch(actions: impl IntoIterator<Item = ActionBinding>) -> ActionBinding
pub fn batch(actions: impl IntoIterator<Item = ActionBinding>) -> ActionBinding
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 (const: unstable) · 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<ActionBinding, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionBinding, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ActionBinding
impl Serialize for ActionBinding
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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 UnsafeUnpin 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