pub enum DispatchOutcome {
Continue,
RefreshRequested,
DeleteRequested {
id: VarId,
name: String,
},
CreateRequested(VarDraft),
UpdateValueRequested {
id: VarId,
value: SecretString,
name: String,
},
LinkRequested {
id: VarId,
name: String,
project_path: PathBuf,
profile: String,
materialize: bool,
},
ViewValueRequested {
id: VarId,
name: String,
},
RunRequested {
project_path: PathBuf,
profile: String,
program: String,
args: Vec<String>,
},
}Expand description
Outcome of AppState::dispatch_key: signals whether the caller
(the runtime) should perform an I/O side effect after the state
has been updated.
Variants§
Continue
Continue the event loop without further side effects.
RefreshRequested
Re-fetch rows from the provider; the dispatch translated a
Refresh intent. The runtime owns the provider and is
responsible for the actual call.
DeleteRequested
The user confirmed deletion of the variable identified by
id; the runtime should call
VarMutator::delete and then
refresh. name is carried along for the post-delete success
toast so the runtime does not have to look it up after the row
is gone.
Fields
CreateRequested(VarDraft)
The user submitted the new-var prompt; the runtime should call
crate::VarMutator::create and refresh on success.
UpdateValueRequested
The user submitted the edit-value prompt; the runtime should
call crate::VarMutator::update_value and refresh on success.
name is carried for the post-update toast.
Fields
value: SecretStringNew value.
LinkRequested
The user submitted the link form; the runtime should call
crate::VarMutator::link_to_project and refresh on success.
Fields
ViewValueRequested
The user asked to view the value of a variable. The runtime
should fetch via crate::VarProvider::get_value and then
call AppState::show_value_modal with the result.
RunRequested
The user submitted the run-in-project form. The runtime should
restore the terminal, call
crate::VarMutator::run_in_project, and re-init the TUI
afterwards.
Trait Implementations§
Source§impl Clone for DispatchOutcome
impl Clone for DispatchOutcome
Source§fn clone(&self) -> DispatchOutcome
fn clone(&self) -> DispatchOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DispatchOutcome
impl RefUnwindSafe for DispatchOutcome
impl Send for DispatchOutcome
impl Sync for DispatchOutcome
impl Unpin for DispatchOutcome
impl UnsafeUnpin for DispatchOutcome
impl UnwindSafe for DispatchOutcome
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more