Skip to main content

DispatchOutcome

Enum DispatchOutcome 

Source
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

§id: VarId

Variable identifier the user confirmed deleting.

§name: String

Human-readable name, for use in the post-delete toast.

§

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

§id: VarId

Variable to update.

§value: SecretString

New value.

§name: String

Human-readable name for the success toast.

§

LinkRequested

The user submitted the link form; the runtime should call crate::VarMutator::link_to_project and refresh on success.

Fields

§id: VarId

Variable being linked.

§name: String

Variable’s display name (for the success toast).

§project_path: PathBuf

Project path the user typed.

§profile: String

Profile name to use for the binding.

§materialize: bool

Whether to also materialize .env after linking.

§

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.

Fields

§id: VarId

Variable id whose value to fetch.

§name: String

Display name for the modal title.

§

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.

Fields

§project_path: PathBuf

Project path to load the manifest from.

§profile: String

Profile to resolve bindings under.

§program: String

Program to spawn.

§args: Vec<String>

Arguments forwarded to the program.

Trait Implementations§

Source§

impl Clone for DispatchOutcome

Source§

fn clone(&self) -> DispatchOutcome

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DispatchOutcome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.