pub struct App {Show 20 fields
pub files: Vec<FileReview>,
pub layers: Layers,
pub selected: usize,
pub cursor: usize,
pub scroll: usize,
pub focus: Focus,
pub store: ReviewStore,
pub notes: NoteStore,
pub input: Option<Input>,
pub search: Option<String>,
pub show_help: bool,
pub message: Option<String>,
pub clipboard: Clipboard,
pub collapse_moves: bool,
pub root: PathBuf,
pub open_request: Option<(PathBuf, usize)>,
pub title: String,
pub palette: Palette,
pub syntax: bool,
pub quit: bool,
/* private fields */
}Fields§
§files: Vec<FileReview>§layers: Layers§selected: usizePosition in the visible list.
cursor: usizeLine of the diff pane the cursor is on.
scroll: usize§focus: Focus§store: ReviewStore§notes: NoteStore§input: Option<Input>The prompt being typed, if one is open.
search: Option<String>The last search, highlighted in the diff until cleared with Esc.
show_help: bool§message: Option<String>A one-off message for the status bar, cleared by the next key.
clipboard: Clipboard§collapse_moves: boolShow each moved block as its one-line marker only.
root: PathBufThe working tree’s top-level directory; changed paths are relative to it.
open_request: Option<(PathBuf, usize)>A file and line to open in the editor, for the run loop to carry out.
title: StringWhat is being reviewed, shown over the file list: “origin/main…feature”, “PR 7”.
palette: Palette§syntax: boolColour code by syntax; off leaves only the diff’s own colouring.
quit: boolImplementations§
Source§impl App
impl App
pub fn new(files: Vec<FileReview>, layers: Layers) -> App
pub fn with_stores( files: Vec<FileReview>, layers: Layers, store: ReviewStore, notes: NoteStore, ) -> App
Sourcepub fn current(&self) -> Option<&FileReview>
pub fn current(&self) -> Option<&FileReview>
The file under the cursor, if any file is listed.
Sourcepub fn moved_blocks(&self) -> usize
pub fn moved_blocks(&self) -> usize
Number of moved blocks among the listed files.
pub fn handle_key(&mut self, key: KeyEvent)
Sourcepub fn review_progress(&self) -> (usize, usize)
pub fn review_progress(&self) -> (usize, usize)
Reviewed and total counts over the listed files.
Auto Trait Implementations§
impl !RefUnwindSafe for App
impl !Send for App
impl !Sync for App
impl Freeze 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