Struct mycelium_bitfield::pack::Pair128
source · pub struct Pair128<T = u128> { /* private fields */ }
Expand description
A pair of Pack128s, allowing a bit range to be unpacked from one offset in a u128 value, and packed into a different offset in a different value.
See the module-level documentation for details on using packing specs.
Implementations§
source§impl Pair128
impl Pair128
sourcepub const fn pack_from_src(&self, src: u128, dst: u128) -> u128
pub const fn pack_from_src(&self, src: u128, dst: u128) -> u128
Pack bits from the source location in src
into the
destination location in dst
.
sourcepub const fn pack_from_dst(&self, src: u128, dst: u128) -> u128
pub const fn pack_from_dst(&self, src: u128, dst: u128) -> u128
Pack bits from the destination location in dst
into the
source location in src
.
sourcepub fn assert_valid(&self)
pub fn assert_valid(&self)
Asserts that this packing pair is valid.
Because assertions cannot be made in const fn
, this
performs validating assertions that would ideally be made
when constructing a new instance of this type. When packing
specs are declared as const
s, this method can be called in
a unit test to ensure that the spec is valid.
Trait Implementations§
impl<T> Copy for Pair128<T>
impl<T> Eq for Pair128<T>
Auto Trait Implementations§
impl<T> Freeze for Pair128<T>
impl<T> RefUnwindSafe for Pair128<T>
impl<T> Send for Pair128<T>
impl<T> Sync for Pair128<T>
impl<T> Unpin for Pair128<T>
impl<T> UnwindSafe for Pair128<T>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)