pub struct App {Show 14 fields
pub items: Vec<Item>,
pub sel: usize,
pub scroll: usize,
pub focus: Focus,
pub diff: Vec<String>,
pub diff_for: Option<(Group, String)>,
pub diff_scroll: usize,
pub overlay: Overlay,
pub status: Option<(String, bool)>,
pub prefix: String,
pub head: String,
pub width: u16,
pub height: u16,
pub color: bool,
}Fields§
§items: Vec<Item>§sel: usize§scroll: usizeFirst visible list row.
focus: Focus§diff: Vec<String>Diff lines for diff_for.
diff_for: Option<(Group, String)>§diff_scroll: usize§overlay: Overlay§status: Option<(String, bool)>(message, is_error)
prefix: Stringgit rev-parse --show-prefix, for cwd-relative display.
head: StringBranch line shown in the list title.
width: u16§height: u16§color: boolFalse under NO_COLOR.
Implementations§
Source§impl App
impl App
pub fn new(items: Vec<Item>, prefix: String, head: String) -> Self
pub fn resize(&mut self, w: u16, h: u16)
Sourcepub fn body_height(&self) -> usize
pub fn body_height(&self) -> usize
Lines inside a pane: screen minus status line, hotkey bar and borders.
pub fn selected(&self) -> Option<&Item>
pub fn rows(&self) -> Vec<Row>
Sourcepub fn diff_wanted(&self) -> Option<&Item>
pub fn diff_wanted(&self) -> Option<&Item>
The item whose diff should be shown, when it is not loaded yet.
pub fn set_diff(&mut self, item: &Item, lines: Vec<String>)
Sourcepub fn replace_items(&mut self, items: Vec<Item>)
pub fn replace_items(&mut self, items: Vec<Item>)
New list after a reload: keep the same entry selected (same group and path, else same path in another group, else the nearest position).
pub fn confirm_revert(&mut self, item: Item, files: Vec<String>, total: usize)
pub fn key(&mut self, k: KeyEvent) -> Effect
pub fn hotkeys(&self) -> Vec<(&'static str, &'static str)>
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> 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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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