pub struct KcpSequenceNumber(/* private fields */);Expand description
A KCP sequence number interpreted modulo 2^32.
Implementations§
Source§impl KcpSequenceNumber
impl KcpSequenceNumber
Sourcepub const fn distance_from(self, earlier: Self) -> i32
pub const fn distance_from(self, earlier: Self) -> i32
Returns the upstream-compatible signed modular distance from earlier to self.
Sourcepub const fn is_before(self, other: Self) -> bool
pub const fn is_before(self, other: Self) -> bool
Returns whether this sequence number is before other in upstream-compatible modular order.
The ordering is meaningful only when the values differ by less than half the u32 range.
At exactly half the range, this follows upstream signed-difference behavior despite the
ambiguous modular ordering.
Sourcepub const fn is_after(self, other: Self) -> bool
pub const fn is_after(self, other: Self) -> bool
Returns whether this sequence number is after other in upstream-compatible modular order.
The ordering is meaningful only when the values differ by less than half the u32 range.
At exactly half the range, this follows upstream signed-difference behavior despite the
ambiguous modular ordering.
Trait Implementations§
Source§impl Clone for KcpSequenceNumber
impl Clone for KcpSequenceNumber
impl Copy for KcpSequenceNumber
Source§impl Debug for KcpSequenceNumber
impl Debug for KcpSequenceNumber
impl Eq for KcpSequenceNumber
Source§impl Hash for KcpSequenceNumber
impl Hash for KcpSequenceNumber
Source§impl PartialEq for KcpSequenceNumber
impl PartialEq for KcpSequenceNumber
impl StructuralPartialEq for KcpSequenceNumber
Auto Trait Implementations§
impl Freeze for KcpSequenceNumber
impl RefUnwindSafe for KcpSequenceNumber
impl Send for KcpSequenceNumber
impl Sync for KcpSequenceNumber
impl Unpin for KcpSequenceNumber
impl UnsafeUnpin for KcpSequenceNumber
impl UnwindSafe for KcpSequenceNumber
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