pub struct PagerState {
    pub line_numbers: LineNumbers,
    pub upper_mark: usize,
    pub search_mode: SearchMode,
    pub rows: usize,
    pub cols: usize,
    pub prefix_num: String,
    /* private fields */
}
Expand description

Holds all information and configuration about the pager during its un time.

This type is exposed so that end-applications can implement the InputClassifier trait which requires the PagerState to be passed as a parameter

Various fields are made public so that their values can be accessed while implementing the trait.

Fields

line_numbers: LineNumbers

Configuration for line numbers. See LineNumbers

upper_mark: usize

The upper bound of scrolling.

This is useful for keeping track of the range of lines which are currently being displayed on the terminal. When rows - 1 is added to the upper_mark, it gives the lower bound of scroll.

For example if there are 10 rows is a terminal and the data to display has 50 lines in it/ If the upper_mark is 15, then the first row of the terminal is the 16th line of the data and last row is the 24th line of the data.

search_mode: SearchMode

Direction of search

See SearchMode for available options

rows: usize

Available rows in the terminal

cols: usize

Available columns in the terminal

prefix_num: String

This variable helps in scrolling more than one line at a time It keeps track of all the numbers that have been entered by the user untill any of j, k, G, Up or Down is pressed

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.