pub struct Board { /* private fields */ }Expand description
Rolling buffer of recent events for cross-component visibility.
Backed by a VecDeque with a configurable maximum size.
When full, the oldest entry is evicted on each append.
Implementations§
Source§impl Board
impl Board
Sourcepub fn with_capacity(max_entries: usize) -> Self
pub fn with_capacity(max_entries: usize) -> Self
Creates a new Board with specified maximum entries.
A max_entries of 0 is treated as 1 (at least one entry is always stored).
Sourcepub fn append(&mut self, entry: BoardEntry)
pub fn append(&mut self, entry: BoardEntry)
Appends an entry, evicting the oldest if at capacity.
Sourcepub fn recent(&self, n: usize) -> Vec<&BoardEntry>
pub fn recent(&self, n: usize) -> Vec<&BoardEntry>
Returns the most recent n entries (oldest first, newest last).
Sourcepub fn query_by_source(
&self,
source: &ComponentId,
n: usize,
) -> Vec<&BoardEntry>
pub fn query_by_source( &self, source: &ComponentId, n: usize, ) -> Vec<&BoardEntry>
Returns the most recent n entries from a specific source (oldest first).
Sourcepub fn recent_as_json(&self, n: usize) -> Vec<Value>
pub fn recent_as_json(&self, n: usize) -> Vec<Value>
Returns the most recent n entries as JSON values.
Each entry is serialized via serde. Entries that fail serialization are silently skipped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Board
impl RefUnwindSafe for Board
impl Send for Board
impl Sync for Board
impl Unpin for Board
impl UnsafeUnpin for Board
impl UnwindSafe for Board
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