pub struct State { /* private fields */ }log-viewer only.Expand description
The kept entries, the filters, the search, the selection and whether the log follows its newest line.
Implementations§
Source§impl State
impl State
Sourcepub fn new() -> Self
pub fn new() -> Self
An empty log that keeps DEFAULT_LIMIT entries, shows every
level and follows the newest line.
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Keeps at most limit entries, dropping the oldest. A limit of zero
is treated as one.
Sourcepub fn with_levels(self, levels: impl IntoIterator<Item = Level>) -> Self
pub fn with_levels(self, levels: impl IntoIterator<Item = Level>) -> Self
Shows only the given levels.
Sourcepub fn with_search_id(self, id: impl Into<Id>) -> Self
pub fn with_search_id(self, id: impl Into<Id>) -> Self
Replaces SEARCH_ID, so several logs on one screen each focus
their own field.
Sourcepub fn extend(&mut self, entries: impl IntoIterator<Item = Entry>)
pub fn extend(&mut self, entries: impl IntoIterator<Item = Entry>)
Appends entries straight away, as the channel does.
Sourcepub fn entries(&self) -> impl Iterator<Item = &Entry>
pub fn entries(&self) -> impl Iterator<Item = &Entry>
Every kept entry, oldest first, whether shown or not.
pub fn is_empty(&self) -> bool
pub fn limit(&self) -> usize
Sourcepub fn visible(&self) -> impl Iterator<Item = LineId> + '_
pub fn visible(&self) -> impl Iterator<Item = LineId> + '_
The ids of the lines shown, oldest first.
Sourcepub fn visible_len(&self) -> usize
pub fn visible_len(&self) -> usize
How many lines are shown.
pub fn is_shown(&self, level: Level) -> bool
Sourcepub fn levels(&self) -> &State<Level>
pub fn levels(&self) -> &State<Level>
The level filters as a multiple-choice toggle group, each labelled with its level’s count.
pub fn query(&self) -> &str
Sourcepub fn matches(&self) -> impl Iterator<Item = LineId> + '_
pub fn matches(&self) -> impl Iterator<Item = LineId> + '_
The shown lines whose message matches the search, oldest first.
pub fn match_count(&self) -> usize
Sourcepub fn current_match(&self) -> Option<(LineId, usize)>
pub fn current_match(&self) -> Option<(LineId, usize)>
The match the search last moved to, and its position counted from one, if it is still shown.
pub fn is_selected(&self, id: LineId) -> bool
Sourcepub fn highlighted(&self) -> Option<LineId>
pub fn highlighted(&self) -> Option<LineId>
The line the keyboard acts on.
pub fn is_focused(&self) -> bool
pub fn is_following(&self) -> bool
pub fn is_paused(&self) -> bool
pub fn is_wrapped(&self) -> bool
pub fn search_id(&self) -> &Id
Sourcepub fn can_copy(&self) -> bool
pub fn can_copy(&self) -> bool
Whether there is anything to copy: a shown selected line or a highlight.
Sourcepub fn copy_text(&self) -> Option<String>
pub fn copy_text(&self) -> Option<String>
The selected lines as text, one per line, or the highlighted line when nothing is selected.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.