pub struct AiCallLog { /* private fields */ }Expand description
Bounded ring buffer of AiCallRecords.
Implementations§
Source§impl AiCallLog
impl AiCallLog
Sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
Create a log retaining at most capacity of the most recent records.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a log with a default capacity of 10,000 records.
Sourcepub fn record(&self, record: AiCallRecord)
pub fn record(&self, record: AiCallRecord)
Append a record, evicting the oldest if at capacity.
Sourcepub fn snapshot(&self) -> Vec<AiCallRecord>
pub fn snapshot(&self) -> Vec<AiCallRecord>
Snapshot the retained records, oldest first. Backs laminar.ai_calls.
Sourcepub fn total_recorded(&self) -> u64
pub fn total_recorded(&self) -> u64
Total calls ever logged, including those evicted from the buffer.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AiCallLog
impl !RefUnwindSafe for AiCallLog
impl Send for AiCallLog
impl Sync for AiCallLog
impl Unpin for AiCallLog
impl UnsafeUnpin for AiCallLog
impl UnwindSafe for AiCallLog
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more