pub struct SeqNum(/* private fields */);
Expand description
Sequence number of a transferred TCP segment.
Per https://tools.ietf.org/html/rfc793#section-3.3: This space ranges from 0 to 232 - 1. Since the space is finite, all arithmetic dealing with sequence numbers must be performed modulo 232. This unsigned arithmetic preserves the relationship of sequence numbers as they cycle from 2**32 - 1 to 0 again. There are some subtleties to computer modulo arithmetic, so great care should be taken in programming the comparison of such values.
For any sequence number, there are 231 numbers after it and 231 - 1 numbers before it.
Implementations§
Source§impl SeqNum
impl SeqNum
Sourcepub fn before(self, other: SeqNum) -> bool
pub fn before(self, other: SeqNum) -> bool
A predicate for whether a sequence number is before the other.
Please refer to SeqNum
for the defined order.
Sourcepub fn before_or_eq(self, other: SeqNum) -> bool
pub fn before_or_eq(self, other: SeqNum) -> bool
A predicate for whether a sequence number is equal to or before the other.
Please refer to SeqNum
for the defined order.
Sourcepub fn after(self, other: SeqNum) -> bool
pub fn after(self, other: SeqNum) -> bool
A predicate for whether a sequence number is after the other.
Please refer to SeqNum
for the defined order.
Sourcepub fn after_or_eq(self, other: SeqNum) -> bool
pub fn after_or_eq(self, other: SeqNum) -> bool
A predicate for whether a sequence number is equal to or after the other.
Please refer to SeqNum
for the defined order.
Trait Implementations§
Source§impl Add<WindowSize> for SeqNum
impl Add<WindowSize> for SeqNum
Source§impl Sub<WindowSize> for SeqNum
impl Sub<WindowSize> for SeqNum
impl Copy for SeqNum
impl Eq for SeqNum
impl StructuralPartialEq for SeqNum
Auto Trait Implementations§
impl Freeze for SeqNum
impl RefUnwindSafe for SeqNum
impl Send for SeqNum
impl Sync for SeqNum
impl Unpin for SeqNum
impl UnwindSafe for SeqNum
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more