pub struct Ring { /* private fields */ }Expand description
The kept entries, newest last. Their seqs run without a gap from
first_seq to newest_seq, since only the oldest are evicted, so a seq
finds its entry by position.
Implementations§
Source§impl Ring
impl Ring
pub fn new(limits: Limits) -> Self
Sourcepub fn push(&mut self, entry: Entry) -> u64
pub fn push(&mut self, entry: Entry) -> u64
Keep an entry, evicting the oldest while over a limit. An entry larger than the byte budget evicts itself and everything before it.
pub fn usage(&self) -> Value
Sourcepub fn read(&self, after: u64, grep: Option<&Regex>, max: usize) -> Page
pub fn read(&self, after: u64, grep: Option<&Regex>, max: usize) -> Page
The entries newer than after whose message matches, at most max,
oldest first. A cursor is only meaningful in the capture that issued
it, since seqs begin again at 1 with each capture. One that is newer
than every entry returns nothing and gets the newest seq back, so it
cannot run ahead of the buffer.
Auto Trait Implementations§
impl Forget for Ring
impl Freeze for Ring
impl Move for Ring
impl RefUnwindSafe for Ring
impl Send for Ring
impl Sync for Ring
impl Unpin for Ring
impl UnsafeUnpin for Ring
impl UnwindSafe for Ring
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