Skip to main content

App

Struct App 

Source
pub struct App {
Show 20 fields pub rows: Vec<LogRow>, pub view: Vec<usize>, pub marks: Vec<Vec<Vec<usize>>>, pub sel: usize, pub scroll: usize, pub loading: bool, pub filters: Filters, pub search: String, pub focus: Focus, pub files: Option<(String, Vec<FileEntry>)>, pub file_sel: usize, pub file_scroll: usize, pub diff: Option<Diff>, pub overlay: Overlay, pub status: Option<(String, bool)>, pub head: String, pub remotes: Vec<String>, pub now: i64, pub width: u16, pub height: u16, /* private fields */
}

Fields§

§rows: Vec<LogRow>§view: Vec<usize>

Indices into rows currently shown.

§marks: Vec<Vec<Vec<usize>>>

Search match positions per shown row: [short hash, author, subject, refs].

§sel: usize§scroll: usize§loading: bool§filters: Filters§search: String§focus: Focus§files: Option<(String, Vec<FileEntry>)>§file_sel: usize§file_scroll: usize§diff: Option<Diff>§overlay: Overlay§status: Option<(String, bool)>

(message, is_error)

§head: String

Header label for HEAD: branch name or detached at <sha>.

§remotes: Vec<String>§now: i64

Unix time used for relative ages.

§width: u16§height: u16

Implementations§

Source§

impl App

Source

pub fn new( filters: Filters, head: String, remotes: Vec<String>, now: i64, ) -> Self

Source

pub fn resize(&mut self, w: u16, h: u16)

Source

pub fn body_height(&self) -> usize

Rows available for the commit list / sidebar / diff.

Source

pub fn wide(&self) -> bool

Wide enough to show the sidebar beside the list.

Source

pub fn begin_load(&mut self)

Starts a fresh load (after a filter change); keeps the selected commit if it reappears.

Source

pub fn push_rows(&mut self, rows: Vec<LogRow>)

Source

pub fn finish_load(&mut self)

Source

pub fn selected_hash(&self) -> Option<&str>

Source

pub fn selected_short(&self) -> Option<&str>

Source

pub fn set_files(&mut self, sha: String, files: Vec<FileEntry>)

Source

pub fn files_wanted(&self) -> Option<&str>

The selected commit’s file list is missing or stale.

Source

pub fn set_diff(&mut self, sha: String, path: String, lines: Vec<String>)

Source

pub fn open_branches(&mut self, names: Vec<String>)

Source

pub fn open_authors(&mut self, authors: Vec<(u32, String)>)

Source

pub fn date_error(&mut self, msg: String)

Source

pub fn apply_date(&mut self, since: String, until: String)

Valid dates: apply them. Caller then reloads.

Source

pub fn confirm_reset( &mut self, mode: ResetMode, sha: String, branch: String, at_risk: Vec<String>, )

Source

pub fn action_result(&mut self, ok: bool, msg: String)

Result of a git action. Name modals stay open on error.

Source

pub fn key(&mut self, k: KeyEvent) -> Effect

Source

pub fn hotkeys(&self) -> Vec<(&'static str, &'static str)>

Hotkeys for the bottom bar in the current context: (key, label).

Source

pub fn header(&self) -> String

Header text: HEAD, scope, and active filters.

Auto Trait Implementations§

§

impl Forget for App

§

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.