pub struct LogBar { /* private fields */ }Expand description
An expandable log bar anchored to the bottom of the viewport.
Owns its own entry buffer — construct once, store on your app struct,
call LogBar::push (or one of the shortcuts) from any event handler,
and call LogBar::show once per frame to render.
Implementations§
Source§impl LogBar
impl LogBar
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a log bar with default settings: capacity 100, heading
"Message Log", starts collapsed.
Sourcepub fn heading(self, heading: impl Into<String>) -> Self
pub fn heading(self, heading: impl Into<String>) -> Self
Set the label shown in the collapsed header. Default: "Message Log".
Sourcepub fn max_entries(self, n: usize) -> Self
pub fn max_entries(self, n: usize) -> Self
Set the maximum number of entries kept. When the buffer is full the oldest entry is dropped on each push. Default: 100. Clamped to a minimum of 1.
Sourcepub fn id_salt(self, salt: impl Hash) -> Self
pub fn id_salt(self, salt: impl Hash) -> Self
Override the id used for the panel and collapse state. Set this if
you want more than one LogBar in a single app.
Sourcepub fn push(&mut self, kind: LogKind, msg: impl Into<String>)
pub fn push(&mut self, kind: LogKind, msg: impl Into<String>)
Append an entry. The current wall-clock time (HH:MM:SS UTC) is
recorded as the row’s timestamp.
Sourcepub fn recv(&mut self, msg: impl Into<String>)
pub fn recv(&mut self, msg: impl Into<String>)
Shortcut for push(LogKind::In, msg) — named recv because in
is a Rust keyword.