Unorm32

Struct Unorm32 

Source
pub struct Unorm32(/* private fields */);

Implementations§

Source§

impl Unorm32

Source

pub const fn from_inner(inner: u32) -> Self

Source

pub const fn zero() -> Self

Source

pub const fn one() -> Self

Source

pub const fn min_value() -> Self

Source

pub const fn max_value() -> Self

Source

pub const fn epsilon() -> Self

Source

pub fn from_denominator(denominator: u32) -> Self

Source

pub fn try_from_float<F: Float>(f: F) -> Result<Self, FloatToUnormError<F>>

Source

pub fn from_float<F: Float>(f: F) -> Self

Source

pub fn from_float_clamped<F: Float>(f: F) -> Self

Source

pub const fn to_inner(self) -> u32

Source

pub fn to_float<F: Float>(self) -> F

Source

pub fn saturating_add(self, other: Self) -> Self

Source

pub fn saturating_mul(self, other: Self) -> Self

Source

pub fn saturating_pow(self, other: u32) -> Self

Source

pub fn saturating_sub(self, other: Self) -> Self

Source

pub fn wrapping_add(self, other: Self) -> Self

Source

pub fn wrapping_div(self, other: Self) -> Self

Source

pub fn wrapping_mul(self, other: Self) -> Self

Source

pub fn wrapping_neg(self) -> Self

Source

pub fn wrapping_pow(self, other: u32) -> Self

Source

pub fn wrapping_rem(self, other: Self) -> Self

Source

pub fn wrapping_shl(self, other: u32) -> Self

Source

pub fn wrapping_shr(self, other: u32) -> Self

Source

pub fn wrapping_sub(self, other: Self) -> Self

Trait Implementations§

Source§

impl Add<&Unorm32> for Unorm32

Source§

type Output = Unorm32

The resulting type after applying the + operator.
Source§

fn add(self, other: &Self) -> Self

Performs the + operation. Read more
Source§

impl Add for Unorm32

Source§

type Output = Unorm32

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
Source§

impl AddAssign<&Unorm32> for Unorm32

Source§

fn add_assign(&mut self, other: &Self)

Performs the += operation. Read more
Source§

impl AddAssign for Unorm32

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl Bounded for Unorm32

Source§

fn min_value() -> Self

Returns the smallest finite number this type can represent
Source§

fn max_value() -> Self

Returns the largest finite number this type can represent
Source§

impl Clone for Unorm32

Source§

fn clone(&self) -> Unorm32

Returns a duplicate 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 Debug for Unorm32

Source§

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

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

impl Default for Unorm32

Source§

fn default() -> Unorm32

Returns the “default value” for a type. Read more
Source§

impl Display for Unorm32

Source§

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

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

impl Div<&Unorm32> for Unorm32

Source§

type Output = Unorm32

The resulting type after applying the / operator.
Source§

fn div(self, other: &Self) -> Self

Performs the / operation. Read more
Source§

impl Div for Unorm32

Source§

type Output = Unorm32

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl DivAssign<&Unorm32> for Unorm32

Source§

fn div_assign(&mut self, other: &Self)

Performs the /= operation. Read more
Source§

impl DivAssign for Unorm32

Source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
Source§

impl From<Unorm16> for Unorm32

Source§

fn from(n: Unorm16) -> Self

Converts to this type from the input type.
Source§

impl From<Unorm32> for Unorm64

Source§

fn from(n: Unorm32) -> Self

Converts to this type from the input type.
Source§

impl From<Unorm8> for Unorm32

Source§

fn from(n: Unorm8) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Unorm32

Source§

fn from(n: u32) -> Self

Converts to this type from the input type.
Source§

impl Hash for Unorm32

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 Into<u32> for Unorm32

Source§

fn into(self) -> u32

Converts this type into the (usually inferred) input type.
Source§

impl Mul<&Unorm32> for Unorm32

Source§

type Output = Unorm32

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Self) -> Self

Performs the * operation. Read more
Source§

impl Mul for Unorm32

Source§

type Output = Unorm32

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl MulAssign<&Unorm32> for Unorm32

Source§

fn mul_assign(&mut self, other: &Self)

Performs the *= operation. Read more
Source§

impl MulAssign for Unorm32

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

impl Num for Unorm32

Source§

type FromStrRadixErr = <u32 as Num>::FromStrRadixErr

Source§

fn from_str_radix(s: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
Source§

impl NumCast for Unorm32

Source§

fn from<T: ToPrimitive>(n: T) -> Option<Self>

Creates a number from another value that can be converted into a primitive via the ToPrimitive trait. If the source value cannot be represented by the target type, then None is returned. Read more
Source§

impl One for Unorm32

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

impl Ord for Unorm32

Source§

fn cmp(&self, other: &Unorm32) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Unorm32

Source§

fn eq(&self, other: &Unorm32) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Unorm32

Source§

fn partial_cmp(&self, other: &Unorm32) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Rem<&Unorm32> for Unorm32

Source§

type Output = Unorm32

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Self) -> Self

Performs the % operation. Read more
Source§

impl Rem for Unorm32

Source§

type Output = Unorm32

The resulting type after applying the % operator.
Source§

fn rem(self, other: Self) -> Self

Performs the % operation. Read more
Source§

impl RemAssign<&Unorm32> for Unorm32

Source§

fn rem_assign(&mut self, other: &Self)

Performs the %= operation. Read more
Source§

impl RemAssign for Unorm32

Source§

fn rem_assign(&mut self, other: Self)

Performs the %= operation. Read more
Source§

impl Sub<&Unorm32> for Unorm32

Source§

type Output = Unorm32

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Self) -> Self

Performs the - operation. Read more
Source§

impl Sub for Unorm32

Source§

type Output = Unorm32

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
Source§

impl SubAssign<&Unorm32> for Unorm32

Source§

fn sub_assign(&mut self, other: &Self)

Performs the -= operation. Read more
Source§

impl SubAssign for Unorm32

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

impl ToPrimitive for Unorm32

Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

impl TryFrom<f32> for Unorm32

Source§

type Error = FloatToUnormError<f32>

The type returned in the event of a conversion error.
Source§

fn try_from(f: f32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<f64> for Unorm32

Source§

type Error = FloatToUnormError<f64>

The type returned in the event of a conversion error.
Source§

fn try_from(f: f64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Zero for Unorm32

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl Copy for Unorm32

Source§

impl Eq for Unorm32

Source§

impl StructuralPartialEq for Unorm32

Source§

impl Unsigned for Unorm32

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LowerBounded for T
where T: Bounded,

Source§

fn min_value() -> T

Returns the smallest finite number this type can represent
Source§

impl<T> Max for T
where T: PartialOrd,

Source§

fn max(self, other: T) -> T

Source§

impl<T> Min for T
where T: PartialOrd,

Source§

fn min(self, other: T) -> T

Source§

impl<T> Num for T
where T: Copy + Debug + Max + Min + Num + NumCast + NumRef,

Source§

fn try_cast<T>(self) -> Result<T, CastFailure<T, Self>>
where T: NumCast,

Source§

fn cast<T>(self) -> T
where T: NumCast,

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_i128(self) -> i128

Source§

fn to_isize(self) -> isize

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_u128(self) -> u128

Source§

fn to_usize(self) -> usize

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn two() -> Self

Source§

fn three() -> Self

Source§

fn four() -> Self

Source§

fn five() -> Self

Source§

fn six() -> Self

Source§

fn seven() -> Self

Source§

fn halved(self) -> Self

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UpperBounded for T
where T: Bounded,

Source§

fn max_value() -> T

Returns the largest finite number this type can represent
Source§

impl<T> NumAssign for T
where T: Num + NumAssignOps,

Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T> NumAssignRef for T
where T: NumAssign + for<'r> NumAssignOps<&'r T>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Source§

impl<T> NumRef for T
where T: Num + for<'r> NumOps<&'r T>,

Source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,