pub struct LogView { /* private fields */ }Expand description
A live view of log records. See the module docs.
Implementations§
Source§impl LogView
impl LogView
Sourcepub const LIMIT: usize = 200_000
pub const LIMIT: usize = 200_000
The records a view keeps by default before dropping the oldest.
Sourcepub fn records(self, records: impl IntoIterator<Item = Record>) -> LogView
pub fn records(self, records: impl IntoIterator<Item = Record>) -> LogView
Start with records.
Sourcepub fn source(self, source: Receiver<LogEvent>) -> LogView
pub fn source(self, source: Receiver<LogEvent>) -> LogView
Take records from source as they arrive, checking it every 100 ms
until its sender is dropped.
Sourcepub fn collapse(self, on: bool) -> LogView
pub fn collapse(self, on: bool) -> LogView
Fold runs of identical records into one row (default on).
Sourcepub fn expand_all(self, on: bool) -> LogView
pub fn expand_all(self, on: bool) -> LogView
Show every record’s fields, as if Enter had been pressed on each.
Sourcepub fn filter(self, filter: impl Into<String>) -> LogView
pub fn filter(self, filter: impl Into<String>) -> LogView
Start with this filter (see the module docs).
Sourcepub fn limit(self, records: usize) -> LogView
pub fn limit(self, records: usize) -> LogView
Keep at most records, dropping the oldest (default
LIMIT).
pub fn theme(self, theme: Theme) -> LogView
pub fn is_empty(&self) -> bool
Sourcepub fn is_following(&self) -> bool
pub fn is_following(&self) -> bool
Whether the view follows the end.
pub fn is_paused(&self) -> bool
Sourcepub fn filter_text(&self) -> &str
pub fn filter_text(&self) -> &str
The filter typed.
Sourcepub fn push_continuation(&mut self, line: String)
pub fn push_continuation(&mut self, line: String)
Add a line under the last record. Past
Assembler::CONTINUATION_LIMIT lines it is only counted, and shown
as … N more lines.
Trait Implementations§
Source§impl Component for LogView
impl Component for LogView
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: every row, as text.
type Output = ()
Source§fn start(&mut self, _context: &Context<'_>) -> Flow<()>
fn start(&mut self, _context: &Context<'_>) -> Flow<()>
Called once, before the component is first painted, with the
terminal’s size: for work that needs it, such as rendering content
at the width. Returning
Done or Cancel finishes the component
without waiting for an event. The default does nothing.Source§fn handle(&mut self, event: &Event, context: &Context<'_>) -> Flow<()>
fn handle(&mut self, event: &Event, context: &Context<'_>) -> Flow<()>
Handle one event. Ctrl+C never arrives here: the event loop ends the
component with
Outcome::Interrupted.Source§fn tick(&self) -> Option<Duration>
fn tick(&self) -> Option<Duration>
How often the component wants
Event::Tick, for a spinner or a
countdown. None (the default): never.Source§fn keymap(&self) -> Keymap
fn keymap(&self) -> Keymap
The bindings this component has right now, for a help overlay, a
shortcut list or status-bar hints to read (see
keymap). A container’s include its focused
child’s, before its own. The default declares none.Source§fn default_value(&self) -> Option<()>
fn default_value(&self) -> Option<()>
The value to return when the terminal is not interactive and the
policy asks for defaults.
None: there is none.Source§fn mouse(&self) -> bool
fn mouse(&self) -> bool
Whether the component wants mouse events (#476): clicks, drags and
the wheel. Off by default, since reporting the mouse takes text
selection away from the terminal; a component turns it on when its
caller opts in, and
run then enables mouse reporting
for the session.Source§fn focusable(&self) -> bool
fn focusable(&self) -> bool
Whether the component takes focus in a container: Tab stops on it
and keys go to it. The default: yes. A label, or a component that
has finished, says no.
Source§fn focus_step(&mut self, forward: bool) -> bool
fn focus_step(&mut self, forward: bool) -> bool
Move focus to the next (
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 !Sync for LogView
impl Freeze for LogView
impl RefUnwindSafe for LogView
impl Send for LogView
impl Unpin for LogView
impl UnsafeUnpin for LogView
impl UnwindSafe for LogView
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
Mutably borrows from an owned value. Read more
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,
Turn this component’s answer into
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.