pub struct TraceLog { /* private fields */ }Expand description
A bounded ring buffer of recent function traces.
Thread-safe. Stores the most recent capacity traces. Oldest entries
are evicted when the buffer is full.
Implementations§
Source§impl TraceLog
impl TraceLog
pub fn new(capacity: usize) -> Self
Sourcepub fn by_fn(&self, fn_name: &str, limit: usize) -> Vec<FnTrace>
pub fn by_fn(&self, fn_name: &str, limit: usize) -> Vec<FnTrace>
Query traces filtered by function name, newest first.
Sourcepub fn errors(&self, limit: usize) -> Vec<FnTrace>
pub fn errors(&self, limit: usize) -> Vec<FnTrace>
Query only error/rollback traces, newest first.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Total traces recorded (including evicted).
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl !Freeze for TraceLog
impl RefUnwindSafe for TraceLog
impl Send for TraceLog
impl Sync for TraceLog
impl Unpin for TraceLog
impl UnsafeUnpin for TraceLog
impl UnwindSafe for TraceLog
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