pub struct Unit(/* private fields */);Expand description
One millionth of a typographic point, used as geometry truth.
Implementations§
Source§impl Unit
impl Unit
Sourcepub fn from_ratio(numerator: i128, denominator: i128) -> Result<Self>
pub fn from_ratio(numerator: i128, denominator: i128) -> Result<Self>
Converts a rational point measurement using half-away-from-zero rounding.
Sourcepub fn checked_add(self, other: Self) -> Result<Self>
pub fn checked_add(self, other: Self) -> Result<Self>
Checked addition.
Sourcepub fn checked_sub(self, other: Self) -> Result<Self>
pub fn checked_sub(self, other: Self) -> Result<Self>
Checked subtraction.
Sourcepub fn checked_scale(self, millionths: i64) -> Result<Self>
pub fn checked_scale(self, millionths: i64) -> Result<Self>
Checked multiplication by a fixed-point millionth ratio.
Sourcepub fn as_points_f64(self) -> f64
pub fn as_points_f64(self) -> f64
Returns a floating-point value for output APIs only.
Trait Implementations§
impl Copy for Unit
Source§impl<'de> Deserialize<'de> for Unit
impl<'de> Deserialize<'de> for Unit
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
impl Eq for Unit
Source§impl Ord for Unit
impl Ord for Unit
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Unit
impl PartialOrd for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnsafeUnpin for Unit
impl UnwindSafe for Unit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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§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.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.