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: LineNumbersConfiguration 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: usizeThe 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: usizeThe left mark of scrolling
When this is > 0, this amount of text will be truncated from the left side
search_mode: SearchModesearch 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: usizeAvailable rows in the terminal
cols: usizeAvailable columns in the terminal
prefix_num: StringThis 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: SearchStatesearch only.screen: Screen§selection: Option<Selection>§output_sink: Arc<Mutex<Box<dyn OutputSink>>>The output sink configured for the pager.
Implementations§
Source§impl PagerState
impl PagerState
Sourcepub const fn set_smart_case(&mut self, smart_case: bool)
Available on crate feature search only.
pub const fn set_smart_case(&mut self, smart_case: bool)
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.
impl<'a> From<&'a PagerState> for IncrementalSearchOpts<'a>
search only.Source§fn from(ps: &'a PagerState) -> Self
fn from(ps: &'a PagerState) -> Self
Source§impl<'a> From<&'a PagerState> for SearchOpts<'a>
Available on crate feature search only.
impl<'a> From<&'a PagerState> for SearchOpts<'a>
search only.Source§fn from(ps: &'a PagerState) -> Self
fn from(ps: &'a PagerState) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for PagerState
impl !UnwindSafe for PagerState
impl Freeze for PagerState
impl Send for PagerState
impl Sync for PagerState
impl Unpin for PagerState
impl UnsafeUnpin for PagerState
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.