pub struct DiffWidget {
pub hunks: Vec<DiffHunk>,
pub view_type: DiffViewType,
pub selected_hunk: Option<usize>,
pub scroll: usize,
pub approvals: Vec<bool>,
}Expand description
Diff widget
Fields§
§hunks: Vec<DiffHunk>Hunks in the diff
view_type: DiffViewTypeCurrent view type
selected_hunk: Option<usize>Selected hunk index
scroll: usizeScroll offset
approvals: Vec<bool>Approval state for each hunk
Implementations§
Source§impl DiffWidget
impl DiffWidget
Sourcepub fn toggle_view_type(&mut self)
pub fn toggle_view_type(&mut self)
Toggle view type
Sourcepub fn select_next_hunk(&mut self)
pub fn select_next_hunk(&mut self)
Select next hunk
Sourcepub fn select_prev_hunk(&mut self)
pub fn select_prev_hunk(&mut self)
Select previous hunk
Sourcepub fn toggle_selected_hunk(&mut self)
pub fn toggle_selected_hunk(&mut self)
Toggle selected hunk collapsed state
Sourcepub fn approve_all(&mut self)
pub fn approve_all(&mut self)
Approve all changes
Sourcepub fn reject_all(&mut self)
pub fn reject_all(&mut self)
Reject all changes
Sourcepub fn approve_hunk(&mut self)
pub fn approve_hunk(&mut self)
Approve selected hunk
Sourcepub fn reject_hunk(&mut self)
pub fn reject_hunk(&mut self)
Reject selected hunk
Sourcepub fn approved_hunks(&self) -> Vec<usize>
pub fn approved_hunks(&self) -> Vec<usize>
Get all approved hunks
Sourcepub fn rejected_hunks(&self) -> Vec<usize>
pub fn rejected_hunks(&self) -> Vec<usize>
Get all rejected hunks
Sourcepub fn scroll_down(&mut self, height: usize)
pub fn scroll_down(&mut self, height: usize)
Scroll down
Trait Implementations§
Source§impl Debug for DiffWidget
impl Debug for DiffWidget
Auto Trait Implementations§
impl Freeze for DiffWidget
impl RefUnwindSafe for DiffWidget
impl Send for DiffWidget
impl Sync for DiffWidget
impl Unpin for DiffWidget
impl UnwindSafe for DiffWidget
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> 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