pub struct RingLog<const N: usize> { /* private fields */ }Expand description
A fixed-capacity in-memory log sink.
This is useful when you don’t have a device early during boot, or when you want to keep the
last N bytes of logs for later inspection.
Internally it uses RingBuffer, so it has overwrite-on-full semantics.
Implementations§
Source§impl<const N: usize> RingLog<N>
impl<const N: usize> RingLog<N>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates an empty ring log.
If N == 0, all writes become no-ops and as_slices() returns empty slices.
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> Freeze for RingLog<N>
impl<const N: usize> RefUnwindSafe for RingLog<N>
impl<const N: usize> Send for RingLog<N>
impl<const N: usize> Sync for RingLog<N>
impl<const N: usize> Unpin for RingLog<N>
impl<const N: usize> UnsafeUnpin for RingLog<N>
impl<const N: usize> UnwindSafe for RingLog<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