#[repr(transparent)]pub struct ScaledPixels(pub f32);Expand description
Points scaled to device pixels without rounding: a fractional device
position, as a platform draws at (Points::scale).
Tuple Fields§
§0: f32Implementations§
Source§impl ScaledPixels
impl ScaledPixels
Sourcepub const ZERO: ScaledPixels
pub const ZERO: ScaledPixels
Zero.
Sourcepub fn abs(self) -> ScaledPixels
pub fn abs(self) -> ScaledPixels
The absolute value.
Sourcepub fn min(self, other: ScaledPixels) -> ScaledPixels
pub fn min(self, other: ScaledPixels) -> ScaledPixels
The smaller of two values.
Sourcepub fn max(self, other: ScaledPixels) -> ScaledPixels
pub fn max(self, other: ScaledPixels) -> ScaledPixels
The larger of two values.
Sourcepub fn clamp(self, min: ScaledPixels, max: ScaledPixels) -> ScaledPixels
pub fn clamp(self, min: ScaledPixels, max: ScaledPixels) -> ScaledPixels
The value within min..=max.
Sourcepub fn floor(self) -> ScaledPixels
pub fn floor(self) -> ScaledPixels
Rounded down.
Sourcepub fn round(self) -> ScaledPixels
pub fn round(self) -> ScaledPixels
Rounded to the nearest whole value.
Sourcepub fn ceil(self) -> ScaledPixels
pub fn ceil(self) -> ScaledPixels
Rounded up.
Source§impl ScaledPixels
impl ScaledPixels
Sourcepub fn to_device_pixels(self) -> DevicePixels
pub fn to_device_pixels(self) -> DevicePixels
Rounded to whole device pixels.
Trait Implementations§
Source§impl Add for ScaledPixels
impl Add for ScaledPixels
Source§type Output = ScaledPixels
type Output = ScaledPixels
The resulting type after applying the
+ operator.Source§fn add(self, rhs: ScaledPixels) -> ScaledPixels
fn add(self, rhs: ScaledPixels) -> ScaledPixels
Performs the
+ operation. Read moreSource§impl AddAssign for ScaledPixels
impl AddAssign for ScaledPixels
Source§fn add_assign(&mut self, rhs: ScaledPixels)
fn add_assign(&mut self, rhs: ScaledPixels)
Performs the
+= operation. Read moreSource§impl Clone for ScaledPixels
impl Clone for ScaledPixels
Source§fn clone(&self) -> ScaledPixels
fn clone(&self) -> ScaledPixels
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ScaledPixels
Source§impl Debug for ScaledPixels
impl Debug for ScaledPixels
Source§impl Default for ScaledPixels
impl Default for ScaledPixels
Source§fn default() -> ScaledPixels
fn default() -> ScaledPixels
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ScaledPixels
impl<'de> Deserialize<'de> for ScaledPixels
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScaledPixels, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScaledPixels, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Div for ScaledPixels
The ratio of two values.
impl Div for ScaledPixels
The ratio of two values.
Source§impl Div<f32> for ScaledPixels
impl Div<f32> for ScaledPixels
Source§type Output = ScaledPixels
type Output = ScaledPixels
The resulting type after applying the
/ operator.Source§impl DivAssign<f32> for ScaledPixels
impl DivAssign<f32> for ScaledPixels
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moreimpl Eq for ScaledPixels
Source§impl From<f32> for ScaledPixels
impl From<f32> for ScaledPixels
Source§fn from(v: f32) -> ScaledPixels
fn from(v: f32) -> ScaledPixels
Converts to this type from the input type.
Source§impl Half for ScaledPixels
impl Half for ScaledPixels
Source§fn half(&self) -> ScaledPixels
fn half(&self) -> ScaledPixels
Half the value.
Source§impl Hash for ScaledPixels
impl Hash for ScaledPixels
Source§impl Mul<f32> for ScaledPixels
impl Mul<f32> for ScaledPixels
Source§type Output = ScaledPixels
type Output = ScaledPixels
The resulting type after applying the
* operator.Source§impl MulAssign<f32> for ScaledPixels
impl MulAssign<f32> for ScaledPixels
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moreSource§impl Neg for ScaledPixels
impl Neg for ScaledPixels
Source§type Output = ScaledPixels
type Output = ScaledPixels
The resulting type after applying the
- operator.Source§fn neg(self) -> ScaledPixels
fn neg(self) -> ScaledPixels
Performs the unary
- operation. Read moreSource§impl PartialEq for ScaledPixels
impl PartialEq for ScaledPixels
Source§impl PartialOrd for ScaledPixels
impl PartialOrd for ScaledPixels
Source§impl Serialize for ScaledPixels
impl Serialize for ScaledPixels
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ScaledPixels
Source§impl Sub for ScaledPixels
impl Sub for ScaledPixels
Source§type Output = ScaledPixels
type Output = ScaledPixels
The resulting type after applying the
- operator.Source§fn sub(self, rhs: ScaledPixels) -> ScaledPixels
fn sub(self, rhs: ScaledPixels) -> ScaledPixels
Performs the
- operation. Read moreSource§impl SubAssign for ScaledPixels
impl SubAssign for ScaledPixels
Source§fn sub_assign(&mut self, rhs: ScaledPixels)
fn sub_assign(&mut self, rhs: ScaledPixels)
Performs the
-= operation. Read moreSource§impl Sum for ScaledPixels
impl Sum for ScaledPixels
Source§fn sum<I>(iter: I) -> ScaledPixelswhere
I: Iterator<Item = ScaledPixels>,
fn sum<I>(iter: I) -> ScaledPixelswhere
I: Iterator<Item = ScaledPixels>,
Takes an iterator and generates
Self from the elements by “summing up”
the items.Source§impl<'a> Sum<&'a ScaledPixels> for ScaledPixels
impl<'a> Sum<&'a ScaledPixels> for ScaledPixels
Source§fn sum<I>(iter: I) -> ScaledPixelswhere
I: Iterator<Item = &'a ScaledPixels>,
fn sum<I>(iter: I) -> ScaledPixelswhere
I: Iterator<Item = &'a ScaledPixels>,
Takes an iterator and generates
Self from the elements by “summing up”
the items.Auto Trait Implementations§
impl Freeze for ScaledPixels
impl RefUnwindSafe for ScaledPixels
impl Send for ScaledPixels
impl Sync for ScaledPixels
impl Unpin for ScaledPixels
impl UnsafeUnpin for ScaledPixels
impl UnwindSafe for ScaledPixels
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.