pub struct UnsequencedState { /* private fields */ }Expand description
State for tracking unsequenced packet duplicates using a sliding window.
This struct maintains a 1024-bit window for duplicate detection of unsequenced packets. It tracks which group IDs have been received and automatically slides the window forward when new packets arrive far ahead of the current window base.
Implementations§
Source§impl UnsequencedState
impl UnsequencedState
Sourcepub fn next_outgoing_group(&mut self) -> u16
pub fn next_outgoing_group(&mut self) -> u16
Gets the next outgoing unsequenced group ID and increments the counter.
Sourcepub fn incoming_group(&self) -> u16
pub fn incoming_group(&self) -> u16
Returns the current incoming unsequenced group (window base).
Sourcepub fn outgoing_group(&self) -> u16
pub fn outgoing_group(&self) -> u16
Returns the current outgoing unsequenced group.
Sourcepub fn is_duplicate(&self, group: u16) -> bool
pub fn is_duplicate(&self, group: u16) -> bool
Checks if an incoming unsequenced group is a duplicate or within the window. Returns true if this is a duplicate (already received), false if new.
Sourcepub fn mark_received(&mut self, group: u16)
pub fn mark_received(&mut self, group: u16)
Marks an incoming unsequenced group as received in the window. Advances the window base if necessary.
Trait Implementations§
Source§impl Clone for UnsequencedState
impl Clone for UnsequencedState
Source§fn clone(&self) -> UnsequencedState
fn clone(&self) -> UnsequencedState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnsequencedState
impl Debug for UnsequencedState
Auto Trait Implementations§
impl Freeze for UnsequencedState
impl RefUnwindSafe for UnsequencedState
impl Send for UnsequencedState
impl Sync for UnsequencedState
impl Unpin for UnsequencedState
impl UnsafeUnpin for UnsequencedState
impl UnwindSafe for UnsequencedState
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