Struct font_types::F4Dot12
source · pub struct F4Dot12(/* private fields */);
Expand description
16-bit signed fixed point number with 12 bits of fraction.
Implementations§
source§impl F4Dot12
impl F4Dot12
sourcepub const fn from_bits(bits: i16) -> Self
pub const fn from_bits(bits: i16) -> Self
Creates a new fixed point value from the underlying bit representation.
sourcepub fn wrapping_add(self, other: Self) -> Self
pub fn wrapping_add(self, other: Self) -> Self
Wrapping addition.
sourcepub const fn saturating_add(self, other: Self) -> Self
pub const fn saturating_add(self, other: Self) -> Self
Saturating addition.
sourcepub const fn wrapping_sub(self, other: Self) -> Self
pub const fn wrapping_sub(self, other: Self) -> Self
Wrapping substitution.
sourcepub const fn saturating_sub(self, other: Self) -> Self
pub const fn saturating_sub(self, other: Self) -> Self
Saturating substitution.
sourcepub const fn to_be_bytes(self) -> [u8; 2]
pub const fn to_be_bytes(self) -> [u8; 2]
The representation of this number as a big-endian byte array.
Trait Implementations§
source§impl AddAssign for F4Dot12
impl AddAssign for F4Dot12
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl Ord for F4Dot12
impl Ord for F4Dot12
source§impl PartialOrd for F4Dot12
impl PartialOrd for F4Dot12
source§impl SubAssign for F4Dot12
impl SubAssign for F4Dot12
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreimpl AnyBitPattern for F4Dot12
impl Copy for F4Dot12
impl Eq for F4Dot12
impl NoUninit for F4Dot12
impl StructuralPartialEq for F4Dot12
Auto Trait Implementations§
impl Freeze for F4Dot12
impl RefUnwindSafe for F4Dot12
impl Send for F4Dot12
impl Sync for F4Dot12
impl Unpin for F4Dot12
impl UnwindSafe for F4Dot12
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
)source§impl<T> FixedSize for Twhere
T: Scalar,
impl<T> FixedSize for Twhere
T: Scalar,
source§const RAW_BYTE_LEN: usize = const RAW_BYTE_LEN: usize = std::mem::size_of::<T::Raw>();
const RAW_BYTE_LEN: usize = const RAW_BYTE_LEN: usize = std::mem::size_of::<T::Raw>();
The raw size of this type, in bytes. Read more