Skip to main content

App

Struct App 

Source
pub struct App {
Show 23 fields pub should_quit: bool, pub screen: AppScreen, pub active_pane: ActivePane, pub input_mode: InputMode, pub input_purpose: InputPurpose, pub tick_count: u64, pub bg_rx: Receiver<BackgroundResult>, pub input_buffer: String, pub show_theme_panel: bool, pub show_options_panel: bool, pub editor: Editor, pub show_editor_panel: bool, pub editor_list_state: ListState, pub current_theme_index: usize, pub theme_list_state: ListState, pub recent_repos: Vec<RepoHistoryEntry>, pub browser_dir: PathBuf, pub browser_entries: Vec<PathBuf>, pub browser_list_state: ListState, pub browser_return_screen: AppScreen, pub tabs: Vec<RepoTab>, pub active_tab_index: usize, pub last_auto_refresh: Instant, /* private fields */
}

Fields§

§should_quit: bool§screen: AppScreen§active_pane: ActivePane§input_mode: InputMode§input_purpose: InputPurpose§tick_count: u64§bg_rx: Receiver<BackgroundResult>

Receiver for results from background tasks.

§input_buffer: String§show_theme_panel: bool

Whether the theme selection panel is visible.

§show_options_panel: bool

Whether the options panel is visible.

§editor: Editor

Configured editor for opening files.

§show_editor_panel: bool

Whether the editor picker panel is visible.

§editor_list_state: ListState

ListState for the editor picker list.

§current_theme_index: usize

Currently selected theme index (0-26).

§theme_list_state: ListState

ListState for the theme list widget.

§recent_repos: Vec<RepoHistoryEntry>

Recently opened repositories loaded from persistence.

§browser_dir: PathBuf

Current directory being browsed in the directory picker.

§browser_entries: Vec<PathBuf>

Entries in the current browser directory.

§browser_list_state: ListState

List state for the directory browser.

§browser_return_screen: AppScreen

Screen to return to when the directory browser is dismissed.

§tabs: Vec<RepoTab>

Open repository tabs.

§active_tab_index: usize

Index of the currently active tab.

§last_auto_refresh: Instant

Timestamp of the last auto-refresh.

Implementations§

Source§

impl App

Source

pub fn new() -> Self

Source

pub fn tab(&self) -> &RepoTab

Return a shared reference to the currently active tab.

Source

pub fn tab_mut(&mut self) -> &mut RepoTab

Return an exclusive reference to the currently active tab.

Source

pub fn new_tab(&mut self)

Open a new empty tab and make it active.

Source

pub fn close_tab(&mut self)

Close the current tab. If it is the last tab, replace it with an empty one.

Source

pub fn next_tab(&mut self)

Switch to the next tab (wrapping around).

Source

pub fn prev_tab(&mut self)

Switch to the previous tab (wrapping around).

Source§

impl App

Source

pub fn cycle_theme_next(&mut self)

Source

pub fn cycle_theme_prev(&mut self)

Source

pub fn current_theme_name(&self) -> &'static str

Source

pub fn theme(&self) -> UiTheme

Return the UiTheme for the currently selected theme index.

Source

pub fn save_theme(&self)

Persist the current theme selection to disk.

Source

pub fn save_session(&self)

Persist the paths of all open tabs for session restore.

Source

pub fn open_repo(&mut self, path: PathBuf)

Source

pub fn refresh(&mut self)

Source

pub fn poll_background(&mut self)

Process any pending results from background tasks. Call this once per tick in the event loop.

Source

pub fn maybe_auto_refresh(&mut self)

Reload only the staging area (unstaged + staged diffs). Check if enough time has passed and trigger a staging refresh.

Source

pub fn refresh_staging(&mut self)

Source

pub fn stage_selected(&mut self)

Source

pub fn unstage_selected(&mut self)

Source

pub fn stage_all(&mut self)

Source

pub fn unstage_all(&mut self)

Source

pub fn discard_selected(&mut self)

Source

pub fn stage_files(&mut self, paths: Vec<String>)

Stage multiple files at once.

Source

pub fn unstage_files(&mut self, paths: Vec<String>)

Unstage multiple files at once.

Source

pub fn discard_files(&mut self, paths: Vec<String>)

Discard changes for multiple files at once.

Source

pub fn create_commit(&mut self)

Source

pub fn checkout_selected_branch(&mut self)

Source

pub fn create_branch(&mut self)

Source

pub fn delete_selected_branch(&mut self)

Source

pub fn stash_save(&mut self)

Source

pub fn stash_pop_selected(&mut self)

Source

pub fn stash_drop_selected(&mut self)

Source

pub fn load_commit_diff(&mut self)

Load the file list for the currently selected commit (phase 1 of two-phase loading).

Source

pub fn load_single_file_diff(&mut self, file_path: String)

Load the diff for a single file in the selected commit (phase 2).

Source

pub fn next_diff_file(&mut self)

Switch to the next file in the commit diff list.

Source

pub fn prev_diff_file(&mut self)

Switch to the previous file in the commit diff list.

Source

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

Close the current repository and return to the welcome screen. Search commits by query string.

Source

pub fn load_commit_diff_by_oid(&mut self)

Load the diff for a commit by its OID (used by search results).

Source

pub fn close_repo(&mut self)

Source

pub fn refresh_browser(&mut self)

Populate browser_entries with the contents of browser_dir.

Source

pub fn open_browser(&mut self, start: PathBuf)

Open the directory browser starting from a given path.

Source

pub fn open_selected_in_editor(&mut self)

Load the diff for a selected staging file into the diff pane. Open the currently selected staging file in the configured editor.

Source

pub fn load_staging_diff(&mut self)

Source

pub fn fetch_remote(&mut self)

Source

pub fn pull_rebase(&mut self)

Source

pub fn push_branch(&mut self)

Source

pub fn force_push_branch(&mut self)

Source

pub fn merge_selected_branch(&mut self)

Source

pub fn rebase_onto_selected_branch(&mut self)

Source

pub fn revert_selected_commit(&mut self)

Source

pub fn reset_to_selected_commit(&mut self, mode: &str)

Trait Implementations§

Source§

impl Default for App

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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