pub struct ReplayGuard {
floor: u64,
skipped: u64,
first_skipped: u64,
last_skipped: u64,
}Expand description
Skips messages at or below a trusted floor and counts them for logging.
Fields§
§floor: u64§skipped: u64§first_skipped: u64§last_skipped: u64Implementations§
Source§impl ReplayGuard
impl ReplayGuard
Sourcepub fn new(floor: u64) -> Self
pub fn new(floor: u64) -> Self
Creates a guard that skips stream sequences 1..=floor. A floor of 0 skips
nothing.
Sourcepub fn is_archived(&mut self, stream_seq: u64) -> bool
pub fn is_archived(&mut self, stream_seq: u64) -> bool
Returns true if the message at stream_seq is already archived and must be
acked without writing. Sequence 0 (unknown) is never skipped.
Sourcepub fn skipped_in_run(&self) -> u64
pub fn skipped_in_run(&self) -> u64
Number of messages skipped in the current run.
Trait Implementations§
Source§impl Debug for ReplayGuard
impl Debug for ReplayGuard
Source§impl Default for ReplayGuard
impl Default for ReplayGuard
Source§fn default() -> ReplayGuard
fn default() -> ReplayGuard
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ReplayGuard
impl RefUnwindSafe for ReplayGuard
impl Send for ReplayGuard
impl Sync for ReplayGuard
impl Unpin for ReplayGuard
impl UnsafeUnpin for ReplayGuard
impl UnwindSafe for ReplayGuard
Blanket Implementations§
impl<T> Allocation for T
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