pub struct BitValue<const BITS: u32>(pub u32);Expand description
A wrapper for restricted bit-sized value with debug assert.
The idea is to make it validate in debug only, in the release it is zero-cost, and the caller is responsible for the validity of values.
Tuple Fields§
§0: u32Implementations§
Trait Implementations§
impl<const BITS: u32> Copy for BitValue<BITS>
impl<const BITS: u32> Eq for BitValue<BITS>
impl<const BITS: u32> StructuralPartialEq for BitValue<BITS>
Auto Trait Implementations§
impl<const BITS: u32> Freeze for BitValue<BITS>
impl<const BITS: u32> RefUnwindSafe for BitValue<BITS>
impl<const BITS: u32> Send for BitValue<BITS>
impl<const BITS: u32> Sync for BitValue<BITS>
impl<const BITS: u32> Unpin for BitValue<BITS>
impl<const BITS: u32> UnwindSafe for BitValue<BITS>
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