pub(crate) struct PackageId(u32);
Tuple Fields§
§0: u32
Implementations§
source§impl PackageId
impl PackageId
const MAX: u32 = 16_777_215u32
pub(crate) const fn zero() -> Self
sourcepub(crate) fn incremented(self) -> Self
pub(crate) fn incremented(self) -> Self
Increments the counter by one. It wraps around to zero after reaching maximum value.
sourcepub(crate) fn from_bytes(bytes: &[u8]) -> Self
pub(crate) fn from_bytes(bytes: &[u8]) -> Self
§Panics
If not exactly 3 bytes are passed.
pub(crate) fn to_bytes(self) -> [u8; 3]
Trait Implementations§
source§impl Ord for PackageId
impl Ord for PackageId
source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Returns probable relative ordering of two package IDs.
Note that the implementation is circular due to wrapping around maximum value and thus the ordering is not transitive.
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for PackageId
impl PartialEq for PackageId
source§impl PartialOrd for PackageId
impl PartialOrd for PackageId
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 moreimpl Copy for PackageId
impl Eq for PackageId
impl StructuralPartialEq for PackageId
Auto Trait Implementations§
impl Freeze for PackageId
impl RefUnwindSafe for PackageId
impl Send for PackageId
impl Sync for PackageId
impl Unpin for PackageId
impl UnwindSafe for PackageId
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 Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.