pub struct DivergenceLog { /* private fields */ }Expand description
Bounded ring buffer. Drops the oldest entry when full.
Implementations§
Source§impl DivergenceLog
impl DivergenceLog
Sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
Build a log with the given capacity. capacity = 0 disables logging.
Sourcepub fn push(&self, entry: DivergenceEntry)
pub fn push(&self, entry: DivergenceEntry)
Push one divergence. No-op when capacity is 0.
Sourcepub fn snapshot(&self) -> Vec<DivergenceEntry>
pub fn snapshot(&self) -> Vec<DivergenceEntry>
Snapshot the current entries oldest-first.
Trait Implementations§
Source§impl Debug for DivergenceLog
impl Debug for DivergenceLog
Auto Trait Implementations§
impl !Freeze for DivergenceLog
impl RefUnwindSafe for DivergenceLog
impl Send for DivergenceLog
impl Sync for DivergenceLog
impl Unpin for DivergenceLog
impl UnsafeUnpin for DivergenceLog
impl UnwindSafe for DivergenceLog
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