Skip to main content

PagerState

Struct PagerState 

Source
pub struct PagerState {
Show 13 fields pub line_numbers: LineNumbers, pub message: Option<String>, pub upper_mark: usize, pub left_mark: usize, pub search_mode: SearchMode, pub rows: usize, pub cols: usize, pub prefix_num: String, pub running: &'static Mutex<RunMode>, pub search_state: SearchState, pub screen: Screen, pub selection: Option<Selection>, pub output_sink: Arc<Mutex<Box<dyn OutputSink>>>, /* private fields */
}

Fields§

§line_numbers: LineNumbers

Configuration for line numbers. See LineNumbers

§message: Option<String>

Any message to display to the user at the prompt The first element contains the actual message, while the second element tells whether the message has changed since the last display.

§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.

§left_mark: usize

The left mark of scrolling

When this is > 0, this amount of text will be truncated from the left side

§search_mode: SearchMode
Available on crate feature search only.

Direction of search

See SearchMode for available options

WARNING: This item has been deprecated in favour of SearchState::search_mode availlable by the PagerState::search_state field. Any new code should prefer using it instead of this one.

§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 until any of j, k, G, Up or Down is pressed

§running: &'static Mutex<RunMode>

Describes whether minus is running and in which mode

§search_state: SearchState
Available on crate feature search only.
§screen: Screen§selection: Option<Selection>§output_sink: Arc<Mutex<Box<dyn OutputSink>>>

The output sink configured for the pager.

Implementations§

Source§

impl PagerState

Source

pub const fn set_smart_case(&mut self, smart_case: bool)

Available on crate feature search only.

Enable or disable smart case searching.

When enabled, search queries containing no uppercase characters are case-insensitive, while queries containing uppercase characters remain case-sensitive.

Trait Implementations§

Source§

impl<'a> From<&'a PagerState> for IncrementalSearchOpts<'a>

Available on crate feature search only.
Source§

fn from(ps: &'a PagerState) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a PagerState> for SearchOpts<'a>

Available on crate feature search only.
Source§

fn from(ps: &'a PagerState) -> Self

Converts to this type from the input type.

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.