pub struct Pager { /* private fields */ }Expand description
Pages content; returns when closed.
Implementations§
Source§impl Pager
impl Pager
Sourcepub fn new(renderable: impl Renderable + Send + Sync + 'static) -> Pager
pub fn new(renderable: impl Renderable + Send + Sync + 'static) -> Pager
Page renderable, rendered at the terminal’s width.
Sourcepub fn rebind(self, action: &str, keys: impl IntoIterator<Item = Key>) -> Self
pub fn rebind(self, action: &str, keys: impl IntoIterator<Item = Key>) -> Self
Make keys do action (see pager_keymap and
pager_search_keymap) on this pager only; no keys unbinds it.
pub fn theme(self, theme: Theme) -> Self
Sourcepub fn with_mouse(self, on: bool) -> Self
pub fn with_mouse(self, on: bool) -> Self
Report the mouse (#476): the wheel scrolls, and a click on a link
(an OSC 8 hyperlink in the content) records it: see
Pager::links. The pager never opens a link itself.
Sourcepub fn links(&self) -> &[String]
pub fn links(&self) -> &[String]
The links clicked while paging, in order: for the caller to open, print or ignore.
Sourcepub fn sticky_header(self, lines: usize) -> Self
pub fn sticky_header(self, lines: usize) -> Self
Keep the first lines lines on top while the rest scroll (#716):
a header rendered with the content.
Sourcepub fn sticky_table_header(self, on: bool) -> Self
pub fn sticky_table_header(self, on: bool) -> Self
Keep a table’s header on top while its rows scroll (#716), when the
content starts with a table: its title, top edge and header rows,
down to the line under the header, as table_header_rows finds
them at each width. Content that does not start with a table
scrolls as it is.
Sourcepub fn sticky_rows(&self) -> usize
pub fn sticky_rows(&self) -> usize
The lines that stay on top now.
Trait Implementations§
Source§impl Component for Pager
impl Component for Pager
Source§fn start(&mut self, context: &Context<'_>) -> Flow<()>
fn start(&mut self, context: &Context<'_>) -> Flow<()>
Render the content at the terminal’s width and, for a search given up front, show its first match.
Source§fn prompt(&mut self, io: &mut dyn LineIo) -> Result<Option<()>, NotInteractive>
fn prompt(&mut self, io: &mut dyn LineIo) -> Result<Option<()>, NotInteractive>
Without a terminal, there is nothing to page: write it all.
type Output = ()
Source§fn handle(&mut self, event: &Event, context: &Context<'_>) -> Flow<()>
fn handle(&mut self, event: &Event, context: &Context<'_>) -> Flow<()>
Outcome::Interrupted.Source§fn keymap(&self) -> Keymap
fn keymap(&self) -> Keymap
keymap). A container’s include its focused
child’s, before its own. The default declares none.Source§fn mouse(&self) -> bool
fn mouse(&self) -> bool
run then enables mouse reporting
for the session.Source§fn default_value(&self) -> Option<()>
fn default_value(&self) -> Option<()>
None: there is none.Source§fn tick(&self) -> Option<Duration>
fn tick(&self) -> Option<Duration>
Event::Tick, for a spinner or a
countdown. None (the default): never.Source§fn focusable(&self) -> bool
fn focusable(&self) -> bool
Source§fn focus_step(&mut self, forward: bool) -> bool
fn focus_step(&mut self, forward: bool) -> bool
forward) or previous focus stop inside
this component, for Tab and Shift+Tab. false when there is none
after the current one, so the container moves on to its next
child. The default, for a component that is one stop: false.Auto Trait Implementations§
impl !RefUnwindSafe for Pager
impl !UnwindSafe for Pager
impl Freeze for Pager
impl Send for Pager
impl Sync for Pager
impl Unpin for Pager
impl UnsafeUnpin for Pager
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<C> ComponentExt for Cwhere
C: Component,
impl<C> ComponentExt for Cwhere
C: Component,
Source§fn map<'a, M>(
self,
done: impl FnMut(Self::Output) -> Flow<M> + 'a,
) -> Map<'a, Self, M>where
Self: 'a,
fn map<'a, M>(
self,
done: impl FnMut(Self::Output) -> Flow<M> + 'a,
) -> Map<'a, Self, M>where
Self: 'a,
M’s flow: Flow::Done(m) to
finish the whole composition with m, Flow::Continue to carry on
(the component stays, showing its answer, and focus moves past it).
Cancelling cancels the composition unless
on_cancel says otherwise.