Skip to main content

App

Struct App 

Source
pub struct App {
    pub should_quit: bool,
    pub exit_action: Option<ExitAction>,
    /* private fields */
}
Expand description

Main application state

Fields§

§should_quit: bool

Flag to signal application should quit

§exit_action: Option<ExitAction>

Action to take when exiting (if entry was selected)

Implementations§

Source§

impl App

Source

pub fn new(entries: Vec<AliasEntry>, theme: Theme) -> Self

Create a new App instance with the given entries and theme

Source

pub fn selected_entry(&self) -> Option<&AliasEntry>

Get the currently selected entry, if any

Source

pub fn update_visible_entries(&mut self)

Update visible entries based on current filter and search query

Source

pub fn entries(&self) -> &[AliasEntry]

Get reference to all entries

Source

pub fn visible_indices(&self) -> &[usize]

Get reference to visible indices

Source

pub fn search_query(&self) -> &str

Get the search query

Source

pub fn cursor_position(&self) -> usize

Get the cursor position

Source

pub fn selected_index(&self) -> usize

Get the selected index

Source

pub fn input_mode(&self) -> InputMode

Get the input mode

Source

pub fn active_panel(&self) -> Panel

Get the active panel

Source

pub fn filter(&self) -> EntryFilter

Get the current filter

Source

pub fn list_scroll_offset(&self) -> usize

Get list scroll offset

Source

pub fn description_scroll_offset(&self) -> usize

Get description scroll offset

Source

pub fn description_max_scroll(&self) -> usize

Get description max scroll

Source

pub fn script_scroll_offset(&self) -> usize

Get script scroll offset

Source

pub fn script_max_scroll(&self) -> usize

Get script max scroll

Source

pub fn pending_key(&self) -> Option<char>

Get pending key

Source

pub fn pending_key_time(&self) -> Option<Instant>

Get pending key time

Source

pub fn show_help(&self) -> bool

Get show help flag

Source

pub fn help_scroll_offset(&self) -> usize

Get help scroll offset

Source

pub fn help_max_scroll(&self) -> usize

Get help max scroll

Source

pub fn group_mode(&self) -> GroupMode

Get group mode

Source

pub fn sort_order(&self) -> SortOrder

Get sort order

Source

pub fn move_up(&mut self)

Move selection up by one

Source

pub fn move_down(&mut self)

Move selection down by one

Source

pub fn move_top(&mut self)

Jump to the top of the active panel

Source

pub fn move_bottom(&mut self)

Jump to the bottom of the active panel

Source

pub fn scroll_up(&mut self, amount: usize)

Scroll the active panel up

Source

pub fn scroll_down(&mut self, amount: usize)

Scroll the active panel down

Source

pub fn cycle_panel(&mut self)

Cycle to the next panel (forward)

Source

pub fn cycle_panel_backward(&mut self)

Cycle to the previous panel (backward)

Source

pub fn cycle_filter(&mut self)

Cycle the entry type filter (forward)

Source

pub fn cycle_filter_backward(&mut self)

Cycle the entry type filter (backward)

Source

pub fn set_filter(&mut self, filter: EntryFilter)

Set a specific filter

Source

pub fn enter_search_mode(&mut self)

Enter search mode

Source

pub fn exit_search_keep_query(&mut self)

Exit search mode, keeping the current query

Source

pub fn exit_search_clear_query(&mut self)

Exit search mode, clearing the query

Clear the search query without changing mode

Source

pub fn set_search_query(&mut self, query: String)

Set the search query directly and update visible entries

Source

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

Insert a character at the cursor position in the search query

Source

pub fn search_delete_char(&mut self)

Delete the character before the cursor in the search query

Source

pub fn search_cursor_left(&mut self)

Move search cursor left

Source

pub fn search_cursor_right(&mut self)

Move search cursor right

Source

pub fn toggle_help(&mut self)

Toggle the help modal

Source

pub fn help_scroll_down(&mut self)

Scroll help modal down by one line

Source

pub fn help_scroll_up(&mut self)

Scroll help modal up by one line

Source

pub fn help_jump_top(&mut self)

Jump to the top of the help modal

Source

pub fn help_jump_bottom(&mut self)

Jump to the bottom of the help modal

Source

pub fn update_help_max_scroll( &mut self, total_lines: usize, visible_lines: usize, )

Update the maximum scroll offset for help modal based on content and visible area

Source

pub fn update_description_max_scroll( &mut self, total_lines: usize, visible_lines: usize, )

Update the maximum scroll offset for description panel based on content and visible area

Source

pub fn update_script_max_scroll( &mut self, total_lines: usize, visible_lines: usize, )

Update the maximum scroll offset for script panel based on content and visible area

Source

pub fn cycle_group_mode(&mut self)

Cycle to the next group mode

Source

pub fn cycle_group_mode_backward(&mut self)

Cycle to the previous group mode

Source

pub fn toggle_sort_order(&mut self)

Toggle sort order

Source

pub fn is_pending_key_expired(&self) -> bool

Check if pending key has timed out (2 seconds)

Source

pub fn clear_pending_key(&mut self)

Clear pending key state

Source

pub fn set_pending_key(&mut self, key: char)

Set pending key with timestamp

Source

pub fn select_entry(&mut self, action: ExitAction)

Select the current entry with the given action and exit gracefully

Source

pub fn tick(&mut self)

Update application state (called each tick)

Source

pub fn cycle_theme_next(&mut self)

Cycle to the next theme in alphabetical order (wraps around)

Source

pub fn cycle_theme_prev(&mut self)

Cycle to the previous theme in alphabetical order (wraps around)

Source

pub fn theme(&self) -> &Theme

Get reference to the current theme

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin 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 = !

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.