pub struct KcpTimestamp(/* private fields */);Expand description
A KCP timestamp interpreted modulo 2^32.
Implementations§
Source§impl KcpTimestamp
impl KcpTimestamp
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 timestamp 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 timestamp 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 KcpTimestamp
impl Clone for KcpTimestamp
impl Copy for KcpTimestamp
Source§impl Debug for KcpTimestamp
impl Debug for KcpTimestamp
impl Eq for KcpTimestamp
Source§impl Hash for KcpTimestamp
impl Hash for KcpTimestamp
Source§impl PartialEq for KcpTimestamp
impl PartialEq for KcpTimestamp
impl StructuralPartialEq for KcpTimestamp
Auto Trait Implementations§
impl Freeze for KcpTimestamp
impl RefUnwindSafe for KcpTimestamp
impl Send for KcpTimestamp
impl Sync for KcpTimestamp
impl Unpin for KcpTimestamp
impl UnsafeUnpin for KcpTimestamp
impl UnwindSafe for KcpTimestamp
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