pub struct App {
pub should_quit: bool,
pub exit_action: Option<ExitAction>,
/* private fields */
}Expand description
Main application state
Fields§
§should_quit: boolFlag to signal application should quit
exit_action: Option<ExitAction>Action to take when exiting (if entry was selected)
Implementations§
Source§impl App
impl App
Sourcepub fn new(entries: Vec<AliasEntry>, theme: Theme) -> Self
pub fn new(entries: Vec<AliasEntry>, theme: Theme) -> Self
Create a new App instance with the given entries and theme
Sourcepub fn selected_entry(&self) -> Option<&AliasEntry>
pub fn selected_entry(&self) -> Option<&AliasEntry>
Get the currently selected entry, if any
Sourcepub fn update_visible_entries(&mut self)
pub fn update_visible_entries(&mut self)
Update visible entries based on current filter and search query
Sourcepub fn entries(&self) -> &[AliasEntry]
pub fn entries(&self) -> &[AliasEntry]
Get reference to all entries
Sourcepub fn visible_indices(&self) -> &[usize]
pub fn visible_indices(&self) -> &[usize]
Get reference to visible indices
Sourcepub fn search_query(&self) -> &str
pub fn search_query(&self) -> &str
Get the search query
Sourcepub fn cursor_position(&self) -> usize
pub fn cursor_position(&self) -> usize
Get the cursor position
Sourcepub fn selected_index(&self) -> usize
pub fn selected_index(&self) -> usize
Get the selected index
Sourcepub fn input_mode(&self) -> InputMode
pub fn input_mode(&self) -> InputMode
Get the input mode
Sourcepub fn active_panel(&self) -> Panel
pub fn active_panel(&self) -> Panel
Get the active panel
Sourcepub fn filter(&self) -> EntryFilter
pub fn filter(&self) -> EntryFilter
Get the current filter
Sourcepub fn list_scroll_offset(&self) -> usize
pub fn list_scroll_offset(&self) -> usize
Get list scroll offset
Sourcepub fn description_scroll_offset(&self) -> usize
pub fn description_scroll_offset(&self) -> usize
Get description scroll offset
Sourcepub fn description_max_scroll(&self) -> usize
pub fn description_max_scroll(&self) -> usize
Get description max scroll
Sourcepub fn script_scroll_offset(&self) -> usize
pub fn script_scroll_offset(&self) -> usize
Get script scroll offset
Sourcepub fn script_max_scroll(&self) -> usize
pub fn script_max_scroll(&self) -> usize
Get script max scroll
Sourcepub fn pending_key(&self) -> Option<char>
pub fn pending_key(&self) -> Option<char>
Get pending key
Sourcepub fn pending_key_time(&self) -> Option<Instant>
pub fn pending_key_time(&self) -> Option<Instant>
Get pending key time
Sourcepub fn help_scroll_offset(&self) -> usize
pub fn help_scroll_offset(&self) -> usize
Get help scroll offset
Sourcepub fn help_max_scroll(&self) -> usize
pub fn help_max_scroll(&self) -> usize
Get help max scroll
Sourcepub fn group_mode(&self) -> GroupMode
pub fn group_mode(&self) -> GroupMode
Get group mode
Sourcepub fn sort_order(&self) -> SortOrder
pub fn sort_order(&self) -> SortOrder
Get sort order
Sourcepub fn move_bottom(&mut self)
pub fn move_bottom(&mut self)
Jump to the bottom of the active panel
Sourcepub fn scroll_down(&mut self, amount: usize)
pub fn scroll_down(&mut self, amount: usize)
Scroll the active panel down
Sourcepub fn cycle_panel(&mut self)
pub fn cycle_panel(&mut self)
Cycle to the next panel (forward)
Sourcepub fn cycle_panel_backward(&mut self)
pub fn cycle_panel_backward(&mut self)
Cycle to the previous panel (backward)
Sourcepub fn cycle_filter(&mut self)
pub fn cycle_filter(&mut self)
Cycle the entry type filter (forward)
Sourcepub fn cycle_filter_backward(&mut self)
pub fn cycle_filter_backward(&mut self)
Cycle the entry type filter (backward)
Sourcepub fn set_filter(&mut self, filter: EntryFilter)
pub fn set_filter(&mut self, filter: EntryFilter)
Set a specific filter
Sourcepub fn enter_search_mode(&mut self)
pub fn enter_search_mode(&mut self)
Enter search mode
Sourcepub fn exit_search_keep_query(&mut self)
pub fn exit_search_keep_query(&mut self)
Exit search mode, keeping the current query
Sourcepub fn exit_search_clear_query(&mut self)
pub fn exit_search_clear_query(&mut self)
Exit search mode, clearing the query
Sourcepub fn clear_search(&mut self)
pub fn clear_search(&mut self)
Clear the search query without changing mode
Sourcepub fn set_search_query(&mut self, query: String)
pub fn set_search_query(&mut self, query: String)
Set the search query directly and update visible entries
Sourcepub fn search_insert_char(&mut self, c: char)
pub fn search_insert_char(&mut self, c: char)
Insert a character at the cursor position in the search query
Sourcepub fn search_delete_char(&mut self)
pub fn search_delete_char(&mut self)
Delete the character before the cursor in the search query
Sourcepub fn search_cursor_left(&mut self)
pub fn search_cursor_left(&mut self)
Move search cursor left
Sourcepub fn search_cursor_right(&mut self)
pub fn search_cursor_right(&mut self)
Move search cursor right
Sourcepub fn toggle_help(&mut self)
pub fn toggle_help(&mut self)
Toggle the help modal
Sourcepub fn help_scroll_down(&mut self)
pub fn help_scroll_down(&mut self)
Scroll help modal down by one line
Sourcepub fn help_scroll_up(&mut self)
pub fn help_scroll_up(&mut self)
Scroll help modal up by one line
Sourcepub fn help_jump_top(&mut self)
pub fn help_jump_top(&mut self)
Jump to the top of the help modal
Sourcepub fn help_jump_bottom(&mut self)
pub fn help_jump_bottom(&mut self)
Jump to the bottom of the help modal
Sourcepub fn update_help_max_scroll(
&mut self,
total_lines: usize,
visible_lines: usize,
)
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
Sourcepub fn update_description_max_scroll(
&mut self,
total_lines: usize,
visible_lines: usize,
)
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
Sourcepub fn update_script_max_scroll(
&mut self,
total_lines: usize,
visible_lines: usize,
)
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
Sourcepub fn cycle_group_mode(&mut self)
pub fn cycle_group_mode(&mut self)
Cycle to the next group mode
Sourcepub fn cycle_group_mode_backward(&mut self)
pub fn cycle_group_mode_backward(&mut self)
Cycle to the previous group mode
Sourcepub fn toggle_sort_order(&mut self)
pub fn toggle_sort_order(&mut self)
Toggle sort order
Sourcepub fn is_pending_key_expired(&self) -> bool
pub fn is_pending_key_expired(&self) -> bool
Check if pending key has timed out (2 seconds)
Sourcepub fn clear_pending_key(&mut self)
pub fn clear_pending_key(&mut self)
Clear pending key state
Sourcepub fn set_pending_key(&mut self, key: char)
pub fn set_pending_key(&mut self, key: char)
Set pending key with timestamp
Sourcepub fn select_entry(&mut self, action: ExitAction)
pub fn select_entry(&mut self, action: ExitAction)
Select the current entry with the given action and exit gracefully
Sourcepub fn cycle_theme_next(&mut self)
pub fn cycle_theme_next(&mut self)
Cycle to the next theme in alphabetical order (wraps around)
Sourcepub fn cycle_theme_prev(&mut self)
pub fn cycle_theme_prev(&mut self)
Cycle to the previous theme in alphabetical order (wraps around)
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> 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> 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