pub type FontWeightFixedPoint = FixedPoint<u16, FONT_WEIGHT_FRACTION_BITS>;
Expand description

This is an alias which is useful mostly as a cbindgen / C++ inference workaround.

Aliased Type§

struct FontWeightFixedPoint {
    pub value: u16,
}

Fields§

§value: u16

The actual representation.

Implementations§

source§

impl<T, const FRACTION_BITS: u16> FixedPoint<T, FRACTION_BITS>where T: AsPrimitive<f32>, f32: AsPrimitive<T>, u16: AsPrimitive<T>,

source

const SCALE: u16 = _

source

const INVERSE_SCALE: f32 = _

source

pub fn from_float(v: f32) -> Self

Returns a fixed-point bit from a floating-point context.

source

pub fn to_float(&self) -> f32

Returns the floating-point representation.

Trait Implementations§

source§

impl<T: Clone, const FRACTION_BITS: u16> Clone for FixedPoint<T, FRACTION_BITS>

source§

fn clone(&self) -> FixedPoint<T, FRACTION_BITS>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, const FRACTION_BITS: u16> ComputeSquaredDistance for FixedPoint<T, FRACTION_BITS>where T: ComputeSquaredDistance,

source§

fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>

Computes the squared distance between two animatable values.
source§

impl<T: Debug, const FRACTION_BITS: u16> Debug for FixedPoint<T, FRACTION_BITS>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, T, const FRACTION_BITS: u16> Deserialize<'de> for FixedPoint<T, FRACTION_BITS>where T: Deserialize<'de>,

source§

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<const FRACTION_BITS: u16> Div<FixedPoint<u16, FRACTION_BITS>> for FixedPoint<u16, FRACTION_BITS>

§

type Output = FixedPoint<u16, FRACTION_BITS>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Self) -> Self

Performs the / operation. Read more
source§

impl<T: Hash, const FRACTION_BITS: u16> Hash for FixedPoint<T, FRACTION_BITS>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T, const FRACTION_BITS: u16> MallocSizeOf for FixedPoint<T, FRACTION_BITS>where T: MallocSizeOf,

source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
source§

impl<const FRACTION_BITS: u16> Mul<FixedPoint<u16, FRACTION_BITS>> for FixedPoint<u16, FRACTION_BITS>

§

type Output = FixedPoint<u16, FRACTION_BITS>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
source§

impl<T: PartialEq, const FRACTION_BITS: u16> PartialEq<FixedPoint<T, FRACTION_BITS>> for FixedPoint<T, FRACTION_BITS>

source§

fn eq(&self, other: &FixedPoint<T, FRACTION_BITS>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialOrd, const FRACTION_BITS: u16> PartialOrd<FixedPoint<T, FRACTION_BITS>> for FixedPoint<T, FRACTION_BITS>

source§

fn partial_cmp(&self, other: &FixedPoint<T, FRACTION_BITS>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T, const FRACTION_BITS: u16> Serialize for FixedPoint<T, FRACTION_BITS>where T: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T, const FRACTION_BITS: u16> ToResolvedValue for FixedPoint<T, FRACTION_BITS>where T: ToResolvedValue,

§

type ResolvedValue = FixedPoint<<T as ToResolvedValue>::ResolvedValue, FRACTION_BITS>

The resolved value type we’re going to be converted to.
source§

fn from_resolved_value(from: Self::ResolvedValue) -> Self

Convert a resolved value to resolved value form.
source§

fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue

Convert a resolved value to a resolved value.
source§

impl<T: Copy, const FRACTION_BITS: u16> Copy for FixedPoint<T, FRACTION_BITS>

source§

impl<T: Eq, const FRACTION_BITS: u16> Eq for FixedPoint<T, FRACTION_BITS>

source§

impl<T, const FRACTION_BITS: u16> StructuralEq for FixedPoint<T, FRACTION_BITS>

source§

impl<T, const FRACTION_BITS: u16> StructuralPartialEq for FixedPoint<T, FRACTION_BITS>