pub(crate) struct PackedCollision<T: Copy + TryFrom<usize> + TryInto<usize> + Shl<usize, Output = T> + Shr<usize, Output = T> + BitAnd<T, Output = T> + BitOr<T, Output = T>, const BUCKET_BITS: usize, const ITEM_BITS: usize>(T);
Expand description
Packed representation of a CollisionLocation
Tuple Fields§
§0: T
Implementations§
Source§impl<T: Copy + TryFrom<usize> + TryInto<usize> + Shl<usize, Output = T> + Shr<usize, Output = T> + BitAnd<T, Output = T> + BitOr<T, Output = T>, const BUCKET_BITS: usize, const ITEM_BITS: usize> PackedCollision<T, BUCKET_BITS, ITEM_BITS>
impl<T: Copy + TryFrom<usize> + TryInto<usize> + Shl<usize, Output = T> + Shr<usize, Output = T> + BitAnd<T, Output = T> + BitOr<T, Output = T>, const BUCKET_BITS: usize, const ITEM_BITS: usize> PackedCollision<T, BUCKET_BITS, ITEM_BITS>
Sourcepub(crate) fn new(inner: T) -> Self
pub(crate) fn new(inner: T) -> Self
Construct a new PackedCollision
from its inner type.
Sourcepub(crate) fn into_inner(self) -> T
pub(crate) fn into_inner(self) -> T
Unwrap this PackedCollision
into its inner type.
Sourcefn from_usize(i: usize) -> T
fn from_usize(i: usize) -> T
Cast to the inner type from usize
, with panic on overflow.
Sourcepub(crate) fn pack(loc: &CollisionLocation) -> Self
pub(crate) fn pack(loc: &CollisionLocation) -> Self
Construct a new packed location from a CollisionLocation
.
Packs all members into a bitfield. Panics if any of the indices are larger than the selected field widths can represent.
Sourcepub(crate) fn unpack(&self) -> CollisionLocation
pub(crate) fn unpack(&self) -> CollisionLocation
Unpack a bitfield into its CollisionLocation
.
Trait Implementations§
Source§impl<T: Clone + Copy + TryFrom<usize> + TryInto<usize> + Shl<usize, Output = T> + Shr<usize, Output = T> + BitAnd<T, Output = T> + BitOr<T, Output = T>, const BUCKET_BITS: usize, const ITEM_BITS: usize> Clone for PackedCollision<T, BUCKET_BITS, ITEM_BITS>
impl<T: Clone + Copy + TryFrom<usize> + TryInto<usize> + Shl<usize, Output = T> + Shr<usize, Output = T> + BitAnd<T, Output = T> + BitOr<T, Output = T>, const BUCKET_BITS: usize, const ITEM_BITS: usize> Clone for PackedCollision<T, BUCKET_BITS, ITEM_BITS>
Source§fn clone(&self) -> PackedCollision<T, BUCKET_BITS, ITEM_BITS>
fn clone(&self) -> PackedCollision<T, BUCKET_BITS, ITEM_BITS>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug + Copy + TryFrom<usize> + TryInto<usize> + Shl<usize, Output = T> + Shr<usize, Output = T> + BitAnd<T, Output = T> + BitOr<T, Output = T>, const BUCKET_BITS: usize, const ITEM_BITS: usize> Debug for PackedCollision<T, BUCKET_BITS, ITEM_BITS>
impl<T: Debug + Copy + TryFrom<usize> + TryInto<usize> + Shl<usize, Output = T> + Shr<usize, Output = T> + BitAnd<T, Output = T> + BitOr<T, Output = T>, const BUCKET_BITS: usize, const ITEM_BITS: usize> Debug for PackedCollision<T, BUCKET_BITS, ITEM_BITS>
impl<T: Copy + Copy + TryFrom<usize> + TryInto<usize> + Shl<usize, Output = T> + Shr<usize, Output = T> + BitAnd<T, Output = T> + BitOr<T, Output = T>, const BUCKET_BITS: usize, const ITEM_BITS: usize> Copy for PackedCollision<T, BUCKET_BITS, ITEM_BITS>
Auto Trait Implementations§
impl<T, const BUCKET_BITS: usize, const ITEM_BITS: usize> Freeze for PackedCollision<T, BUCKET_BITS, ITEM_BITS>where
T: Freeze,
impl<T, const BUCKET_BITS: usize, const ITEM_BITS: usize> RefUnwindSafe for PackedCollision<T, BUCKET_BITS, ITEM_BITS>where
T: RefUnwindSafe,
impl<T, const BUCKET_BITS: usize, const ITEM_BITS: usize> Send for PackedCollision<T, BUCKET_BITS, ITEM_BITS>where
T: Send,
impl<T, const BUCKET_BITS: usize, const ITEM_BITS: usize> Sync for PackedCollision<T, BUCKET_BITS, ITEM_BITS>where
T: Sync,
impl<T, const BUCKET_BITS: usize, const ITEM_BITS: usize> Unpin for PackedCollision<T, BUCKET_BITS, ITEM_BITS>where
T: Unpin,
impl<T, const BUCKET_BITS: usize, const ITEM_BITS: usize> UnwindSafe for PackedCollision<T, BUCKET_BITS, ITEM_BITS>where
T: UnwindSafe,
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