Struct mycelium_bitfield::pack::Pair8
source · pub struct Pair8<T = u8> { /* private fields */ }
Expand description
A pair of Pack8s, allowing a bit range to be unpacked from one offset in a u8 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 Pair8
impl Pair8
sourcepub const fn pack_from_src(&self, src: u8, dst: u8) -> u8
pub const fn pack_from_src(&self, src: u8, dst: u8) -> u8
Pack bits from the source location in src
into the
destination location in dst
.
sourcepub const fn pack_from_dst(&self, src: u8, dst: u8) -> u8
pub const fn pack_from_dst(&self, src: u8, dst: u8) -> u8
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 Pair8<T>
impl<T> Eq for Pair8<T>
Auto Trait Implementations§
impl<T> Freeze for Pair8<T>
impl<T> RefUnwindSafe for Pair8<T>
impl<T> Send for Pair8<T>
impl<T> Sync for Pair8<T>
impl<T> Unpin for Pair8<T>
impl<T> UnwindSafe for Pair8<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
)