pub struct ReloadLog { /* private fields */ }Expand description
A bounded, append-only log of ReloadEvents.
When the log reaches its capacity, the oldest events are dropped (FIFO).
Implementations§
Source§impl ReloadLog
impl ReloadLog
Sourcepub fn record(&mut self, old: u64, new: u64, description: impl Into<String>)
pub fn record(&mut self, old: u64, new: u64, description: impl Into<String>)
Record a reload transition from old generation to new generation.
If the log is at capacity the oldest event is removed first.
Sourcepub fn recent_events(&self, n: usize) -> Vec<&ReloadEvent>
pub fn recent_events(&self, n: usize) -> Vec<&ReloadEvent>
Return references to the n most recent events (or all events if
fewer than n are available).
Sourcepub fn total_events(&self) -> usize
pub fn total_events(&self) -> usize
Total number of events currently stored in the log.
Auto Trait Implementations§
impl Freeze for ReloadLog
impl RefUnwindSafe for ReloadLog
impl Send for ReloadLog
impl Sync for ReloadLog
impl Unpin for ReloadLog
impl UnsafeUnpin for ReloadLog
impl UnwindSafe for ReloadLog
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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