Type Alias de_uom::units::LogicalPixel

source ·
pub type LogicalPixel = Quantity<PIXEL>;

Aliased Type§

struct LogicalPixel(pub(crate) f32);

Fields§

§0: f32

Implementations

source§

impl Quantity<DIMENSIONLESS>

source

pub const FRAC_PI_2: Self = _

The angle equal to π/2.

source

pub fn normalized(&self) -> Self

Returns a new angle normalized to a values between 0.0 (inclusive) and the full circle constant τ (exclusive).

source§

impl<const U: i32> Quantity<U>

source

pub const ZERO: Self = _

source

pub const ONE: Self = _

source

pub const fn new_unchecked(value: f32) -> Self

Creates a new quantity without checking the value.

It is expected that the value is not a NaN. If NaN is given, the type might behave strangely or panic during some of the operations.

source

pub fn new(value: f32) -> Self

Crates a new quantity.

§Panics

Panics if value is NaN.

source

pub fn abs(&self) -> Self

Returns a new quantity with absolute value of self.

source

pub const fn inner(&self) -> f32

Trait Implementations

source§

impl<const U: i32> Add for Quantity<U>

§

type Output = Quantity<U>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl<const U: i32> AddAssign for Quantity<U>

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl<const U: i32> Clone for Quantity<U>

source§

fn clone(&self) -> Quantity<U>

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<const U: i32> Debug for Quantity<U>

source§

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

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

impl<const U: i32> Div<f32> for Quantity<U>

§

type Output = Quantity<U>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl<const U: i32> DivAssign<f32> for Quantity<U>

source§

fn div_assign(&mut self, rhs: f32)

Performs the /= operation. Read more
source§

impl Mul<Quantity<{ -$units }>> for Quantity<PIXEL>

§

type Output = f32

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Quantity<{ _ }>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Quantity<{ -$units }>> for Quantity<SECOND>

§

type Output = f32

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Quantity<{ _ }>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Quantity<PIXEL>> for Quantity<{ _ }>

§

type Output = f32

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Quantity<PIXEL>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Quantity<SECOND>> for Quantity<{ _ }>

§

type Output = f32

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Quantity<SECOND>) -> Self::Output

Performs the * operation. Read more
source§

impl<const U: i32> Mul<f32> for Quantity<U>

§

type Output = Quantity<U>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<const U: i32> MulAssign<f32> for Quantity<U>

source§

fn mul_assign(&mut self, rhs: f32)

Performs the *= operation. Read more
source§

impl<const U: i32> Neg for Quantity<U>

§

type Output = Quantity<U>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl<const U: i32> Ord for Quantity<U>

source§

fn cmp(&self, other: &Self) -> 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 + PartialOrd,

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

impl<const U: i32> PartialEq for Quantity<U>

source§

fn eq(&self, other: &Self) -> 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<const U: i32> PartialOrd for Quantity<U>

source§

fn partial_cmp(&self, other: &Self) -> 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<const U: i32> Sub for Quantity<U>

§

type Output = Quantity<U>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl<const U: i32> SubAssign for Quantity<U>

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl<const U: i32> TryFrom<f32> for Quantity<U>

§

type Error = QuantityValueError

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

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

Performs the conversion.
source§

impl<const U: i32> Copy for Quantity<U>

source§

impl<const U: i32> Eq for Quantity<U>