pub struct ReplayWindow { /* private fields */ }Expand description
Sliding-window replay tracker for a single sequence-numbered stream.
Implementations§
Source§impl ReplayWindow
impl ReplayWindow
Sourcepub fn accept(&mut self, seq: u32) -> bool
pub fn accept(&mut self, seq: u32) -> bool
Attempt to accept a new sequence number.
Returns true if the sequence is novel (never seen before AND within
the window). Updates internal state to record the acceptance.
Returns false for:
- Exact duplicate of a previously-accepted sequence within the window.
- Sequence below the window (too old).
Sourcepub fn high_watermark(&self) -> u32
pub fn high_watermark(&self) -> u32
Highest accepted sequence number. Returns 0 if no packets have been
accepted yet (caller should check is_initialized to disambiguate).
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Whether any packet has been accepted yet.
Trait Implementations§
Source§impl Debug for ReplayWindow
impl Debug for ReplayWindow
Auto Trait Implementations§
impl Freeze for ReplayWindow
impl RefUnwindSafe for ReplayWindow
impl Send for ReplayWindow
impl Sync for ReplayWindow
impl Unpin for ReplayWindow
impl UnsafeUnpin for ReplayWindow
impl UnwindSafe for ReplayWindow
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