Struct font::Offset

source ·
pub struct Offset(pub Number, pub Number);
Expand description

An offset.

Tuple Fields§

§0: Number§1: Number

Implementations§

source§

impl Offset

source

pub fn is_zero(&self) -> bool

source§

impl Offset

source

pub fn undefined() -> Self

Create an undefined offset.

source

pub fn max(&self, other: Self) -> Self

Return the coordinate-wise maximum ignoring undefined values.

source

pub fn min(&self, other: Self) -> Self

Return the coordinate-wise minimum ignoring undefined values.

Trait Implementations§

source§

impl<T> Add<T> for Offset
where T: Into<Offset>,

§

type Output = Offset

The resulting type after applying the + operator.
source§

fn add(self, other: T) -> Offset

Performs the + operation. Read more
source§

impl<T> AddAssign<T> for Offset
where T: Into<Offset>,

source§

fn add_assign(&mut self, other: T)

Performs the += operation. Read more
source§

impl Clone for Offset

source§

fn clone(&self) -> Offset

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 Debug for Offset

source§

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

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

impl Default for Offset

source§

fn default() -> Offset

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

impl Div<f32> for Offset

§

type Output = Offset

The resulting type after applying the / operator.
source§

fn div(self, other: f32) -> Offset

Performs the / operation. Read more
source§

impl Div<i16> for Offset

§

type Output = Offset

The resulting type after applying the / operator.
source§

fn div(self, other: i16) -> Offset

Performs the / operation. Read more
source§

impl DivAssign<f32> for Offset

source§

fn div_assign(&mut self, other: f32)

Performs the /= operation. Read more
source§

impl DivAssign<i16> for Offset

source§

fn div_assign(&mut self, other: i16)

Performs the /= operation. Read more
source§

impl From<(f32, f32)> for Offset

source§

fn from((x, y): (f32, f32)) -> Self

Converts to this type from the input type.
source§

impl From<(i16, i16)> for Offset

source§

fn from((x, y): (i16, i16)) -> Self

Converts to this type from the input type.
source§

impl From<Offset> for (Number, Number)

source§

fn from(offset: Offset) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Offset

source§

fn from(z: f32) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Offset

source§

fn from(z: i16) -> Self

Converts to this type from the input type.
source§

impl Mul<f32> for Offset

§

type Output = Offset

The resulting type after applying the * operator.
source§

fn mul(self, other: f32) -> Offset

Performs the * operation. Read more
source§

impl Mul<i16> for Offset

§

type Output = Offset

The resulting type after applying the * operator.
source§

fn mul(self, other: i16) -> Offset

Performs the * operation. Read more
source§

impl MulAssign<f32> for Offset

source§

fn mul_assign(&mut self, other: f32)

Performs the *= operation. Read more
source§

impl MulAssign<i16> for Offset

source§

fn mul_assign(&mut self, other: i16)

Performs the *= operation. Read more
source§

impl Neg for Offset

§

type Output = Offset

The resulting type after applying the - operator.
source§

fn neg(self) -> Offset

Performs the unary - operation. Read more
source§

impl PartialEq for Offset

source§

fn eq(&self, other: &Offset) -> 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<T> Sub<T> for Offset
where T: Into<Offset>,

§

type Output = Offset

The resulting type after applying the - operator.
source§

fn sub(self, other: T) -> Offset

Performs the - operation. Read more
source§

impl<T> SubAssign<T> for Offset
where T: Into<Offset>,

source§

fn sub_assign(&mut self, other: T)

Performs the -= operation. Read more
source§

impl Copy for Offset

source§

impl StructuralPartialEq for Offset

Auto Trait Implementations§

§

impl Freeze for Offset

§

impl RefUnwindSafe for Offset

§

impl Send for Offset

§

impl Sync for Offset

§

impl Unpin for Offset

§

impl UnwindSafe for Offset

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> 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> ToOwned for T
where T: Clone,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.