Skip to main content

LogPanel

Struct LogPanel 

Source
pub struct LogPanel {
    pub entries: Vec<LogEntry>,
    pub scope: LogScope,
    pub selected: usize,
    pub scroll: usize,
}
Expand description

A commit-list overlay: log/file_log entries, a highlighted row, and a scroll offset.

Fields§

§entries: Vec<LogEntry>

Commit rows, most recent first (as git log orders them).

§scope: LogScope

Where these entries came from.

§selected: usize

Index of the highlighted row.

§scroll: usize

First visible row.

Implementations§

Source§

impl LogPanel

Source

pub fn new(entries: Vec<LogEntry>, scope: LogScope) -> Self

A fresh panel over entries, selecting the first (most recent) row.

Source

pub fn up(&mut self)

Move the highlight up one row, stopping at the top.

Source

pub fn down(&mut self)

Move the highlight down one row, stopping at the bottom.

Source

pub fn page_up(&mut self, page: usize)

Move the highlight up one page, stopping at the top.

Source

pub fn page_down(&mut self, page: usize)

Move the highlight down one page, stopping at the bottom.

Source

pub fn ensure_visible(&mut self, height: usize)

Keep the highlighted row within a window of height visible rows.

Source

pub fn selected_sha(&self) -> Option<&str>

The highlighted commit’s full hash, if any.

Source

pub fn selected_abbrev(&self) -> Option<&str>

The highlighted commit’s abbreviated hash, if any.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.