App

Struct App 

Source
pub struct App { /* private fields */ }
Expand description

Main application state.

Implementations§

Source§

impl App

Source

pub fn new( scripts: Scripts, config: Config, history: History, project_name: String, project_path: PathBuf, runner: Runner, ) -> Self

Create a new application.

Source

pub fn with_workspaces( scripts: Scripts, config: Config, history: History, project_name: String, project_path: PathBuf, runner: Runner, workspaces: Vec<Workspace>, ) -> Self

Create a new application with workspace support.

Source

pub fn mode(&self) -> &AppMode

Get the current mode.

Source

pub fn should_quit(&self) -> bool

Check if the app should quit.

Source

pub fn script_to_run(&self) -> Option<&ScriptRun>

Get the script to run after exit.

Source

pub fn project_name(&self) -> &str

Get the project name.

Source

pub fn project_path(&self) -> &PathBuf

Get the project path.

Source

pub fn runner(&self) -> Runner

Get the runner.

Source

pub fn scripts(&self) -> &Scripts

Get all scripts.

Source

pub fn filter_text(&self) -> &str

Get the current filter text.

Source

pub fn sort_mode(&self) -> SortMode

Get the current sort mode.

Source

pub fn columns(&self) -> usize

Get the number of columns.

Source

pub fn selected_index(&self) -> usize

Get the selected index.

Source

pub fn scroll_offset(&self) -> usize

Get the scroll offset.

Source

pub fn visible_count(&self) -> usize

Get the number of visible scripts.

Source

pub fn config(&self) -> &Config

Get the config.

Source

pub fn is_monorepo(&self) -> bool

Check if this is a monorepo.

Source

pub fn workspaces(&self) -> &[Workspace]

Get the available workspaces.

Source

pub fn workspace_context(&self) -> &WorkspaceContext

Get the current workspace context.

Source

pub fn workspace_selected(&self) -> usize

Get the selected workspace index in the workspace selector.

Source

pub fn current_workspace(&self) -> Option<&Workspace>

Get the currently selected workspace (if any).

Source

pub fn breadcrumb(&self) -> String

Get the breadcrumb path for display. Returns something like “monorepo > packages/web > scripts”

Source

pub fn visible_scripts(&self) -> Vec<&Script>

Get visible scripts after filtering and sorting.

Source

pub fn selected_script(&self) -> Option<&Script>

Get the currently selected script.

Source

pub fn get_visible_script(&self, index: usize) -> Option<&Script>

Get a visible script by its display index (0-based).

Source

pub fn set_mode(&mut self, mode: AppMode)

Set the application mode.

Source

pub fn toggle_filter_mode(&mut self)

Toggle filter mode.

Source

pub fn enter_args_mode(&mut self)

Enter args input mode for the selected script.

Source

pub fn toggle_multi_select(&mut self)

Toggle multi-select mode.

Source

pub fn toggle_help(&mut self)

Toggle help overlay.

Source

pub fn enter_workspace_select(&mut self)

Enter workspace selection mode.

Source

pub fn exit_workspace_select(&mut self)

Exit workspace selection and go to scripts.

Source

pub fn select_workspace(&mut self, index: usize)

Select a workspace and show its scripts.

Source

pub fn select_current_workspace(&mut self)

Select the currently highlighted workspace.

Source

pub fn back_to_workspace_select(&mut self)

Go back to workspace selection from script view.

Source

pub fn workspace_move_up(&mut self)

Move workspace selection up.

Source

pub fn workspace_move_down(&mut self)

Move workspace selection down.

Source

pub fn workspace_move_left(&mut self)

Move workspace selection left (in grid).

Source

pub fn workspace_move_right(&mut self)

Move workspace selection right (in grid).

Source

pub fn select_workspace_by_number(&mut self, num: usize)

Select workspace by number (1-9).

Source

pub fn workspace_count(&self) -> usize

Get the count of items in workspace selector (root + workspaces).

Source

pub fn set_filter(&mut self, text: String)

Set the filter text.

Source

pub fn push_filter_char(&mut self, c: char)

Append a character to the filter text.

Source

pub fn pop_filter_char(&mut self)

Remove the last character from the filter text.

Source

pub fn clear_filter(&mut self)

Clear the filter text.

Source

pub fn cycle_sort_mode(&mut self)

Cycle through sort modes: Recent -> Alphabetical -> Category -> Recent.

Source

pub fn set_sort_mode(&mut self, mode: SortMode)

Set the sort mode.

Source

pub fn update_visible_scripts(&mut self)

Update the visible scripts based on current filter and sort mode.

Source

pub fn update_columns(&mut self, width: u16)

Update the number of columns based on terminal width.

Source

pub fn move_up(&mut self)

Move selection up by one row.

Source

pub fn move_down(&mut self)

Move selection down by one row.

Source

pub fn move_left(&mut self)

Move selection left by one column.

Source

pub fn move_right(&mut self)

Move selection right by one column.

Source

pub fn move_to_first(&mut self)

Move selection to the first item.

Source

pub fn move_to_last(&mut self)

Move selection to the last item.

Source

pub fn select_by_number(&mut self, num: usize)

Select a script by number (1-9).

Source

pub fn select_prev(&mut self)

Move selection up (alias for move_up).

Source

pub fn select_next(&mut self)

Move selection down (alias for move_down).

Source

pub fn select_first(&mut self)

Move to first item (alias for move_to_first).

Source

pub fn select_last(&mut self)

Move to last item (alias for move_to_last).

Source

pub fn quit(&mut self)

Request the app to quit.

Source

pub fn run_selected(&mut self) -> Option<ScriptRun>

Run the currently selected script.

Source

pub fn run_numbered(&mut self, num: usize) -> Option<ScriptRun>

Run a script by number (1-9).

Source

pub fn run_by_number(&mut self, num: usize)

Run a script by number (alias for run_numbered, for compatibility).

Source

pub fn run_with_args(&mut self, args: String) -> Option<ScriptRun>

Run the selected script with arguments.

Source

pub fn toggle_current_selection(&mut self)

Toggle selection of current item in multi-select mode.

Source

pub fn multi_selected_indices(&self) -> Option<&HashSet<usize>>

Get selected indices in multi-select mode.

Source

pub fn run_multi_selected(&mut self) -> Vec<ScriptRun>

Run all selected scripts in multi-select mode.

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnwindSafe for App

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> 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, 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.