Skip to main content

ScreenAction

Enum ScreenAction 

Source
pub enum ScreenAction {
Show 29 variants None, Navigate(Screen), NavigateWithMessage { screen: Screen, title: String, message: String, }, ShowMessage { title: String, content: String, }, ShowToast { message: String, variant: ToastVariant, }, Quit, Refresh, SetHasChanges(bool), ConfigUpdated, ShowHelp, SaveLocalRepoConfig { repo_path: PathBuf, profiles: Vec<String>, }, StartGitHubSetup { token: String, repo_name: String, is_private: bool, }, UpdateGitHubToken { token: String, }, ShowProfileSelection { profiles: Vec<String>, }, CreateAndActivateProfile { name: String, }, ActivateProfile { name: String, }, ScanDotfiles, RefreshFileBrowser, ToggleFileSync { file_index: usize, is_synced: bool, }, AddCustomFileToSync { full_path: PathBuf, relative_path: String, }, SetBackupEnabled { enabled: bool, }, RemoveCustomFile { file_index: usize, }, MoveToCommon { file_index: usize, is_common: bool, profiles_to_cleanup: Vec<String>, }, CreateProfile { name: String, description: Option<String>, inherits: Option<String>, copy_from: Option<usize>, }, SwitchProfile { name: String, }, RenameProfile { old_name: String, new_name: String, }, DeleteProfile { name: String, }, InstallMissingPackages, UpdateSetting { setting: String, option_index: usize, },
}
Expand description

Actions that a screen can return after handling an event.

This enum allows screens to signal navigation and state changes without directly mutating global state.

Variants§

§

None

No action needed, stay on current screen.

§

Navigate(Screen)

Navigate to a different screen.

§

NavigateWithMessage

Navigate to a screen and pass data.

Fields

§screen: Screen
§title: String
§message: String
§

ShowMessage

Show a message popup.

Fields

§title: String
§content: String
§

ShowToast

Show a toast notification (non-blocking, auto-dismisses).

Fields

§message: String
§

Quit

Request to quit the application.

§

Refresh

Trigger a data refresh (e.g., reload dotfiles).

§

SetHasChanges(bool)

Mark that there are changes to push.

§

ConfigUpdated

Update the config (signals app to reload).

§

ShowHelp

Open help overlay.

§

SaveLocalRepoConfig

Save local repository configuration and navigate to profile selection or main menu.

Fields

§repo_path: PathBuf

Path to the local repository.

§profiles: Vec<String>

List of profiles found in the repository (empty if none).

§

StartGitHubSetup

Start the GitHub setup state machine.

Fields

§token: String

GitHub personal access token.

§repo_name: String

Repository name.

§is_private: bool

Whether the repo should be private.

§

UpdateGitHubToken

Update the GitHub token only (for already configured repos).

Fields

§token: String

New token to save.

§

ShowProfileSelection

Navigate to profile selection screen with profiles.

Fields

§profiles: Vec<String>

List of profile names to choose from.

§

CreateAndActivateProfile

Create a new profile and activate it (used during initial setup).

Fields

§name: String

Name of the profile to create.

§

ActivateProfile

Activate an existing profile (used during initial setup).

Fields

§name: String

Name of the profile to activate.

§

ScanDotfiles

Scan for dotfiles and refresh the list.

§

RefreshFileBrowser

Refresh the file browser entries.

§

ToggleFileSync

Toggle file sync status (add or remove from sync).

Fields

§file_index: usize

Index of the file in the dotfiles list.

§is_synced: bool

Whether the file is currently synced.

§

AddCustomFileToSync

Add a custom file to sync after confirmation.

Fields

§full_path: PathBuf

Full path to the file.

§relative_path: String

Relative path (from home directory).

§

SetBackupEnabled

Update backup enabled setting.

Fields

§enabled: bool

Whether backups are enabled.

§

RemoveCustomFile

Remove a custom file entry from the config (not synced, user-added).

Fields

§file_index: usize

Index of the file in the dotfiles list.

§

MoveToCommon

Move a file to/from common (shared across all profiles).

Fields

§file_index: usize

Index of the file in the dotfiles list.

§is_common: bool

Whether the file is currently in common (true = move to profile, false = move to common).

§profiles_to_cleanup: Vec<String>

Profiles that need cleanup (same file with same content) - only used when moving to common.

§

CreateProfile

Create a new profile.

Fields

§name: String

Name of the new profile.

§description: Option<String>

Optional description.

§inherits: Option<String>

Optional parent profile to inherit from.

§copy_from: Option<usize>

Index of profile to copy from.

§

SwitchProfile

Switch to a different profile by name.

Fields

§name: String

Name of the profile to switch to.

§

RenameProfile

Rename a profile.

Fields

§old_name: String

Current name of the profile.

§new_name: String

New name for the profile.

§

DeleteProfile

Delete a profile.

Fields

§name: String

Name of the profile to delete.

§

InstallMissingPackages

Trigger installation of all missing packages.

§

UpdateSetting

Update a setting value.

Fields

§setting: String

Name of the setting being updated.

§option_index: usize

Index of the selected option.

Trait Implementations§

Source§

impl Clone for ScreenAction

Source§

fn clone(&self) -> Self

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 ScreenAction

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ScreenAction

Source§

fn default() -> Self

Returns the “default value” for a type. 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more