pub struct CommitListState { /* private fields */ }Expand description
State for the commit list widget.
Implementations§
Source§impl CommitListState
impl CommitListState
Sourcepub fn new(
commits: Vec<VoidCommit>,
refs: Vec<VoidRef>,
head: Option<VoidHead>,
) -> Self
pub fn new( commits: Vec<VoidCommit>, refs: Vec<VoidRef>, head: Option<VoidHead>, ) -> Self
Create a new commit list state.
Sourcepub fn selected_commit(&self) -> Option<&VoidCommit>
pub fn selected_commit(&self) -> Option<&VoidCommit>
Get the currently selected commit.
Sourcepub fn selected_index(&self) -> usize
pub fn selected_index(&self) -> usize
Get the selected absolute index.
Sourcepub fn select_next(&mut self, viewport_height: usize)
pub fn select_next(&mut self, viewport_height: usize)
Move selection down by one.
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Move selection up by one.
Sourcepub fn scroll_down_half(&mut self, viewport_height: usize)
pub fn scroll_down_half(&mut self, viewport_height: usize)
Move selection down by half a page.
Sourcepub fn scroll_up_half(&mut self, viewport_height: usize)
pub fn scroll_up_half(&mut self, viewport_height: usize)
Move selection up by half a page.
Sourcepub fn scroll_down_page(&mut self, viewport_height: usize)
pub fn scroll_down_page(&mut self, viewport_height: usize)
Move selection down by a full page.
Sourcepub fn scroll_up_page(&mut self, viewport_height: usize)
pub fn scroll_up_page(&mut self, viewport_height: usize)
Move selection up by a full page.
Sourcepub fn select_first(&mut self)
pub fn select_first(&mut self)
Jump to the first commit.
Sourcepub fn select_last(&mut self, viewport_height: usize)
pub fn select_last(&mut self, viewport_height: usize)
Jump to the last commit.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommitListState
impl RefUnwindSafe for CommitListState
impl Send for CommitListState
impl Sync for CommitListState
impl Unpin for CommitListState
impl UnsafeUnpin for CommitListState
impl UnwindSafe for CommitListState
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