pub struct I24WithZeroedBits<const LOW_ZEROED_BITS: u8>(/* private fields */);Expand description
New type for signed integers that stores 32-bit numbers with LOW_ZEROED_BITS low bits zeroed
and truncated to 24-bits
Implementations§
Source§impl<const LOW_ZEROED_BITS: u8> I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> I24WithZeroedBits<LOW_ZEROED_BITS>
Sourcepub const fn from_i32(v_original: i32) -> Self
pub const fn from_i32(v_original: i32) -> Self
Create a new I24WithZeroedBits from a signed 32-bit integer.
The input value is shifted right arithmetically by LOW_ZEROED_BITS before being stored.
When converted back with Self::to_i32, the value is shifted back with low bits being
zero.
Trait Implementations§
Source§impl<const LOW_ZEROED_BITS: u8> Clone for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> Clone for I24WithZeroedBits<LOW_ZEROED_BITS>
Source§fn clone(&self) -> I24WithZeroedBits<LOW_ZEROED_BITS>
fn clone(&self) -> I24WithZeroedBits<LOW_ZEROED_BITS>
Returns a duplicate 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<const LOW_ZEROED_BITS: u8> Debug for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> Debug for I24WithZeroedBits<LOW_ZEROED_BITS>
Source§impl<const LOW_ZEROED_BITS: u8> Default for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> Default for I24WithZeroedBits<LOW_ZEROED_BITS>
Source§fn default() -> I24WithZeroedBits<LOW_ZEROED_BITS>
fn default() -> I24WithZeroedBits<LOW_ZEROED_BITS>
Returns the “default value” for a type. Read more
Source§impl<const LOW_ZEROED_BITS: u8> Display for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> Display for I24WithZeroedBits<LOW_ZEROED_BITS>
Source§impl<const LOW_ZEROED_BITS: u8> From<I24WithZeroedBits<LOW_ZEROED_BITS>> for i32
impl<const LOW_ZEROED_BITS: u8> From<I24WithZeroedBits<LOW_ZEROED_BITS>> for i32
Source§fn from(v: I24WithZeroedBits<LOW_ZEROED_BITS>) -> Self
fn from(v: I24WithZeroedBits<LOW_ZEROED_BITS>) -> Self
Converts to this type from the input type.
Source§impl<const LOW_ZEROED_BITS: u8> From<I24WithZeroedBits<LOW_ZEROED_BITS>> for i64
impl<const LOW_ZEROED_BITS: u8> From<I24WithZeroedBits<LOW_ZEROED_BITS>> for i64
Source§fn from(v: I24WithZeroedBits<LOW_ZEROED_BITS>) -> Self
fn from(v: I24WithZeroedBits<LOW_ZEROED_BITS>) -> Self
Converts to this type from the input type.
Source§impl<const LOW_ZEROED_BITS: u8> Hash for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> Hash for I24WithZeroedBits<LOW_ZEROED_BITS>
Source§impl<const LOW_ZEROED_BITS: u8> LowerHex for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> LowerHex for I24WithZeroedBits<LOW_ZEROED_BITS>
Source§impl<const LOW_ZEROED_BITS: u8> PartialEq for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> PartialEq for I24WithZeroedBits<LOW_ZEROED_BITS>
Source§fn eq(&self, other: &I24WithZeroedBits<LOW_ZEROED_BITS>) -> bool
fn eq(&self, other: &I24WithZeroedBits<LOW_ZEROED_BITS>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<const LOW_ZEROED_BITS: u8> UpperHex for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> UpperHex for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> Copy for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> Eq for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> StructuralPartialEq for I24WithZeroedBits<LOW_ZEROED_BITS>
Auto Trait Implementations§
impl<const LOW_ZEROED_BITS: u8> Freeze for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> RefUnwindSafe for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> Send for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> Sync for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> Unpin for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> UnsafeUnpin for I24WithZeroedBits<LOW_ZEROED_BITS>
impl<const LOW_ZEROED_BITS: u8> UnwindSafe for I24WithZeroedBits<LOW_ZEROED_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