pub struct DiffViewState { /* private fields */ }Expand description
State for the diff view widget
Implementations§
Source§impl DiffViewState
impl DiffViewState
Sourcepub fn current_diff(&self) -> Option<&FileDiff>
pub fn current_diff(&self) -> Option<&FileDiff>
Get current file diff
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Get number of files
Sourcepub fn select_file(&mut self, index: usize)
pub fn select_file(&mut self, index: usize)
Select file by index
Sourcepub fn scroll_down(&mut self, amount: usize)
pub fn scroll_down(&mut self, amount: usize)
Scroll down
Sourcepub fn scroll_to_top(&mut self)
pub fn scroll_to_top(&mut self)
Scroll to top
Sourcepub fn scroll_to_bottom(&mut self)
pub fn scroll_to_bottom(&mut self)
Scroll to bottom
Sourcepub fn scroll_offset(&self) -> usize
pub fn scroll_offset(&self) -> usize
Get scroll offset
Sourcepub fn selected_file_index(&self) -> usize
pub fn selected_file_index(&self) -> usize
Get selected file index
Sourcepub fn select_file_by_path(&mut self, path: &Path) -> bool
pub fn select_file_by_path(&mut self, path: &Path) -> bool
Select file by path (returns true if found)
Sourcepub fn file_paths(&self) -> Vec<&Path>
pub fn file_paths(&self) -> Vec<&Path>
Get all file paths in the diff
Trait Implementations§
Source§impl Clone for DiffViewState
impl Clone for DiffViewState
Source§fn clone(&self) -> DiffViewState
fn clone(&self) -> DiffViewState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiffViewState
impl Debug for DiffViewState
Auto Trait Implementations§
impl Freeze for DiffViewState
impl RefUnwindSafe for DiffViewState
impl Send for DiffViewState
impl Sync for DiffViewState
impl Unpin for DiffViewState
impl UnwindSafe for DiffViewState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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