#[repr(C)]pub struct Px(/* private fields */);
Expand description
Physical pixels
Implementations§
source§impl Px
impl Px
sourcepub const fn saturating_sub(self, other: Self) -> Self
pub const fn saturating_sub(self, other: Self) -> Self
sourcepub const fn saturating_add(self, other: Self) -> Self
pub const fn saturating_add(self, other: Self) -> Self
sourcepub const fn saturating_mul(self, other: Self) -> Self
pub const fn saturating_mul(self, other: Self) -> Self
sourcepub const fn saturating_div(self, other: Self) -> Self
pub const fn saturating_div(self, other: Self) -> Self
Trait Implementations§
source§impl AddAssign<i32> for Px
impl AddAssign<i32> for Px
source§fn add_assign(&mut self, rhs: i32)
fn add_assign(&mut self, rhs: i32)
Performs the
+=
operation. Read moresource§impl AddAssign for Px
impl AddAssign for Px
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl<'de> Deserialize<'de> for Px
impl<'de> Deserialize<'de> for Px
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 DivAssign<i32> for Px
impl DivAssign<i32> for Px
source§fn div_assign(&mut self, rhs: i32)
fn div_assign(&mut self, rhs: i32)
Performs the
/=
operation. Read moresource§impl DivAssign for Px
impl DivAssign for Px
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moresource§impl FloatConversion for Px
impl FloatConversion for Px
source§impl IntoComponents<Px> for f32
impl IntoComponents<Px> for f32
source§fn into_components(self) -> (Px, Px)
fn into_components(self) -> (Px, Px)
Extracts this type’s 2d vector components.
source§fn to_vec<Type>(self) -> Typewhere
Type: FromComponents<Unit>,
fn to_vec<Type>(self) -> Typewhere Type: FromComponents<Unit>,
Converts this type to another type using
FromComponents
and
IntoComponents
.source§impl IntoComponents<Px> for i32
impl IntoComponents<Px> for i32
source§fn into_components(self) -> (Px, Px)
fn into_components(self) -> (Px, Px)
Extracts this type’s 2d vector components.
source§fn to_vec<Type>(self) -> Typewhere
Type: FromComponents<Unit>,
fn to_vec<Type>(self) -> Typewhere Type: FromComponents<Unit>,
Converts this type to another type using
FromComponents
and
IntoComponents
.source§impl IntoSigned for Px
impl IntoSigned for Px
source§impl IntoUnsigned for Px
impl IntoUnsigned for Px
source§impl MulAssign<i32> for Px
impl MulAssign<i32> for Px
source§fn mul_assign(&mut self, rhs: i32)
fn mul_assign(&mut self, rhs: i32)
Performs the
*=
operation. Read moresource§impl MulAssign for Px
impl MulAssign for Px
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl Ord for Px
impl Ord for Px
source§impl PartialOrd<Px> for UPx
impl PartialOrd<Px> for UPx
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PartialOrd<UPx> for Px
impl PartialOrd<UPx> for Px
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PartialOrd<i32> for Px
impl PartialOrd<i32> for Px
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PartialOrd for Px
impl PartialOrd for Px
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PixelScaling for Px
impl PixelScaling for Px
source§const PX_SCALING_FACTOR: u16 = 1u16
const PX_SCALING_FACTOR: u16 = 1u16
The scaling factor to apply when converting to pixels, in addition to
any spatial scaling already being applied.
source§impl RemAssign<i32> for Px
impl RemAssign<i32> for Px
source§fn rem_assign(&mut self, rhs: i32)
fn rem_assign(&mut self, rhs: i32)
Performs the
%=
operation. Read moresource§impl RemAssign for Px
impl RemAssign for Px
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moresource§impl ScreenScale for Px
impl ScreenScale for Px
source§fn into_px(self, _scale: Fraction) -> Self::Px
fn into_px(self, _scale: Fraction) -> Self::Px
Converts this value from its current unit into device pixels (
Px
)
using the provided scale
factor.source§fn from_px(px: Self::Px, _scale: Fraction) -> Self
fn from_px(px: Self::Px, _scale: Fraction) -> Self
Converts from pixels into this type, using the provided
scale
factor.source§fn into_lp(self, scale: Fraction) -> Self::Lp
fn into_lp(self, scale: Fraction) -> Self::Lp
Converts this value from its current unit into device independent pixels
(
Lp
) using the provided scale
factor.source§fn from_lp(lp: Self::Lp, scale: Fraction) -> Self
fn from_lp(lp: Self::Lp, scale: Fraction) -> Self
Converts from Lp into this type, using the provided
scale
factor.source§impl SubAssign<i32> for Px
impl SubAssign<i32> for Px
source§fn sub_assign(&mut self, rhs: i32)
fn sub_assign(&mut self, rhs: i32)
Performs the
-=
operation. Read moresource§impl SubAssign for Px
impl SubAssign for Px
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moresource§impl UnscaledUnit for Px
impl UnscaledUnit for Px
§type Representation = i32
type Representation = i32
The internal reprsentation used by this type.
source§fn from_unscaled(unscaled: Self::Representation) -> Self
fn from_unscaled(unscaled: Self::Representation) -> Self
Returns a new instance using the unscaled representation.
source§fn into_unscaled(self) -> Self::Representation
fn into_unscaled(self) -> Self::Representation
Returns the inner, unscaled representation of this value.
impl Copy for Px
impl Eq for Px
impl Pod for Px
impl StructuralEq for Px
impl StructuralPartialEq for Px
Auto Trait Implementations§
impl RefUnwindSafe for Px
impl Send for Px
impl Sync for Px
impl Unpin for Px
impl UnwindSafe for Px
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
§impl<A> Cast for A
impl<A> Cast for A
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§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
.§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
.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Unit> IntoComponents<Unit> for Unitwhere
Unit: Copy,
impl<Unit> IntoComponents<Unit> for Unitwhere Unit: Copy,
source§fn into_components(self) -> (Unit, Unit)
fn into_components(self) -> (Unit, Unit)
Extracts this type’s 2d vector components.
source§fn to_vec<Type>(self) -> Typewhere
Type: FromComponents<Unit>,
fn to_vec<Type>(self) -> Typewhere Type: FromComponents<Unit>,
Converts this type to another type using
FromComponents
and
IntoComponents
.