Struct srt_protocol::packet::MsgNumber
source · pub struct MsgNumber(pub u32);
Tuple Fields§
§0: u32
Implementations§
Trait Implementations§
source§impl AddAssign<u32> for MsgNumber
impl AddAssign<u32> for MsgNumber
source§fn add_assign(&mut self, rhs: u32)
fn add_assign(&mut self, rhs: u32)
Performs the
+=
operation. Read moresource§impl Distribution<MsgNumber> for Standard
impl Distribution<MsgNumber> for Standard
source§fn sample<T: Rng + ?Sized>(&self, rng: &mut T) -> MsgNumber
fn sample<T: Rng + ?Sized>(&self, rng: &mut T) -> MsgNumber
Generate a random value of
T
, using rng
as the source of randomness.source§impl Ord for MsgNumber
impl Ord for MsgNumber
Ordering sequence numbers is difficult, as they are modular How it works is if the absolute value of the difference between sequence numbers is greater than MAX_DIFF, then wrapping is assumed
source§impl PartialEq<MsgNumber> for MsgNumber
impl PartialEq<MsgNumber> for MsgNumber
source§impl PartialOrd<MsgNumber> for MsgNumber
impl PartialOrd<MsgNumber> for MsgNumber
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Sub<MsgNumber> for MsgNumber
impl Sub<MsgNumber> for MsgNumber
Gets the distance between two sequence numbers Always measured with first one first and the second one second ie: SeqNumber(0) - SeqNumber(MAX) == 1 and SeqNumber(1) - SeqNumber(0) == 1
source§impl Sub<u32> for MsgNumber
impl Sub<u32> for MsgNumber
Move a sequence number backwards by an offset ie: SeqNumber(3) - 2 == 1 and SeqNumber(0) - 1 == SeqNumber(MAX)
impl Copy for MsgNumber
impl Eq for MsgNumber
impl StructuralEq for MsgNumber
impl StructuralPartialEq for MsgNumber
Auto Trait Implementations§
impl RefUnwindSafe for MsgNumber
impl Send for MsgNumber
impl Sync for MsgNumber
impl Unpin for MsgNumber
impl UnwindSafe for MsgNumber
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.