Struct Pager

Source
pub struct Pager { /* private fields */ }
Expand description

Keeps track of the current pager state

Implementations§

Source§

impl Pager

Source

pub fn new() -> Self

Creates new instance of Pager with default settings

Source

pub fn with_env(env: &str) -> Self

Creates new instance of pager using env environment variable instead of PAGER

Source

pub fn env(env: &str) -> Self

👎Deprecated since 0.12.0: use with_env() instead
Source

pub fn with_default_pager<S>(pager: S) -> Self
where S: Into<OsString>,

Creates a new Pager instance with the specified default fallback

Source

pub fn with_pager(pager: &str) -> Self

Creates a new Pager instance directly specifying the desired pager

Source

pub fn pager_envs( self, envs: impl IntoIterator<Item = impl Into<OsString>>, ) -> Self

Launch pager with the specified environment variables

Source

pub fn skip_on_notty(self) -> Self

👎Deprecated since 0.14.0: ‘skip_on_notty’ is default now

Instructs Pager to bypass invoking pager if output is not a tty

Source

pub fn is_on(&self) -> bool

Gives quick assessment of successful Pager setup

Source

pub fn setup(&mut self)

Initiates Pager framework and sets up all the necessary environment for sending standard output to the activated pager.

Trait Implementations§

Source§

impl Debug for Pager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Pager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Pager

§

impl RefUnwindSafe for Pager

§

impl Send for Pager

§

impl Sync for Pager

§

impl Unpin for Pager

§

impl UnwindSafe for Pager

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