pub struct EpisodeCatalog<const N: usize> { /* private fields */ }Expand description
Fixed-size circular buffer of past episodes.
N is the catalog capacity. Older episodes are overwritten when
the buffer wraps. For audit-grade durability, persist the catalog
to disk between runs (see docs/operator_handbook.md).
Implementations§
Source§impl<const N: usize> EpisodeCatalog<N>
impl<const N: usize> EpisodeCatalog<N>
Sourcepub fn record(&mut self, ep: DebugEpisode)
pub fn record(&mut self, ep: DebugEpisode)
Append an episode to the catalog. Wraps when full.
Sourcepub fn total_recorded(&self) -> u64
pub fn total_recorded(&self) -> u64
Total episodes recorded since construction (including any overwritten by buffer wrap). Useful for audit logs.
Sourcepub fn find_similar(&self, query: &DebugEpisode) -> Option<SimilarEpisode>
pub fn find_similar(&self, query: &DebugEpisode) -> Option<SimilarEpisode>
Find the most-similar past episode to query.
Returns None if the catalog is empty or no past entry has
non-zero similarity. Tie-broken by lower catalog index for
determinism.
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> Freeze for EpisodeCatalog<N>
impl<const N: usize> RefUnwindSafe for EpisodeCatalog<N>
impl<const N: usize> Send for EpisodeCatalog<N>
impl<const N: usize> Sync for EpisodeCatalog<N>
impl<const N: usize> Unpin for EpisodeCatalog<N>
impl<const N: usize> UnsafeUnpin for EpisodeCatalog<N>
impl<const N: usize> UnwindSafe for EpisodeCatalog<N>
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