pub struct F6Dot10(/* private fields */);
Expand description
16-bit signed fixed point number with 10 bits of fraction.
Implementations§
Source§impl F6Dot10
impl F6Dot10
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 fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Checked 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 F6Dot10
impl AddAssign for F6Dot10
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moreSource§impl<'de> Deserialize<'de> for F6Dot10
impl<'de> Deserialize<'de> for F6Dot10
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for F6Dot10
impl Ord for F6Dot10
Source§impl PartialOrd for F6Dot10
impl PartialOrd for F6Dot10
Source§impl SubAssign for F6Dot10
impl SubAssign for F6Dot10
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreimpl AnyBitPattern for F6Dot10
impl Copy for F6Dot10
impl Eq for F6Dot10
impl NoUninit for F6Dot10
impl StructuralPartialEq for F6Dot10
Auto Trait Implementations§
impl Freeze for F6Dot10
impl RefUnwindSafe for F6Dot10
impl Send for F6Dot10
impl Sync for F6Dot10
impl Unpin for F6Dot10
impl UnwindSafe for F6Dot10
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§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