pub enum Action {
Show 13 variants
UpdateState {
path: String,
value: Option<Value>,
from: Option<String>,
merge: bool,
},
CallApi {
name: Option<String>,
api: String,
method: Option<String>,
args_from_state: Vec<String>,
map_args: Vec<ArgMapping>,
body: Option<Value>,
on_success: Vec<Action>,
on_error: Vec<Action>,
on_finally: Vec<Action>,
},
Navigate {
to: String,
replace: bool,
params: HashMap<String, String>,
},
ShowToast {
level: ToastLevel,
message: String,
title: Option<String>,
duration: Option<u32>,
},
ShowDialog {
dialog_id: String,
data: HashMap<String, String>,
},
CloseDialog {
dialog_id: Option<String>,
},
DebouncedAction {
delay_ms: u32,
action: Box<Action>,
key: Option<String>,
},
SetLoading {
loading: bool,
target: Option<String>,
},
Conditional {
condition: String,
then: Vec<Action>,
else_actions: Vec<Action>,
},
Sequence {
actions: Vec<Action>,
stop_on_error: bool,
},
Copy {
text: String,
show_notification: bool,
},
OpenUrl {
url: String,
new_tab: bool,
},
Emit {
event: String,
payload: HashMap<String, Value>,
},
}Expand description
Action that can be executed in response to events.
Variants§
UpdateState
Update state at a path.
CallApi
Call a backend API.
Fields
§
map_args: Vec<ArgMapping>Navigate to a route.
ShowToast
Show a toast notification.
ShowDialog
Show a dialog.
CloseDialog
Close a dialog.
DebouncedAction
Debounced action execution.
SetLoading
Set loading state.
Conditional
Conditional action.
Sequence
Sequence of actions.
Copy
Copy text to clipboard.
OpenUrl
Open external URL.
Emit
Emit custom event.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
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 Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnwindSafe for Action
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