Struct glamour::Size2

source ·
#[repr(C)]
pub struct Size2<T: Unit = f32> { pub width: T::Scalar, pub height: T::Scalar, }
Expand description

2D size.

Fields§

§width: T::Scalar

Width

§height: T::Scalar

Height

Implementations§

source§

impl<T: Unit> Size2<T>

source

pub fn from_vector(vec: Vector2<T>) -> Self

Interpret vec as size.

source

pub fn to_vector(self) -> Vector2<T>

Convert to vector.

source

pub fn as_vector(&self) -> &Vector2<T>

Reinterpret as vector.

source

pub fn as_vector_mut(&mut self) -> &mut Vector2<T>

Reinterpret as vector.

source

pub fn is_empty(self) -> bool

True if any component is zero, or negative, or NaN.

source

pub fn with_width(self, width: T::Scalar) -> Self

Replace the width component with a new value.

source

pub fn with_height(self, height: T::Scalar) -> Self

Replace the width component with a new value.

source§

impl<T: Unit> Size2<T>

source

pub const ZERO: Self = _

All zeroes.

source

pub const ONE: Self = _

All ones.

source

pub fn new(width: T::Scalar, height: T::Scalar) -> Self

New size.

source

pub fn from_array(array: [T::Scalar; 2]) -> Self

Instantiate from array. See glam::Vec2::from_array().

source

pub fn to_array(self) -> [T::Scalar; 2]

Convert to array. See glam::Vec2::to_array().

source

pub fn splat(scalar: T::Scalar) -> Self

Instance with all components set to scalar. See glam::Vec2::splat().

source

pub fn write_to_slice(self, slice: &mut [T::Scalar])

Write all components to slice.

source

pub fn cmpeq(self, other: Self) -> BVec2

Return a mask with the result of a component-wise equals comparison. See glam::Vec2::cmpeq().

source

pub fn cmpne(self, other: Self) -> BVec2

Return a mask with the result of a component-wise not-equal comparison. See glam::Vec2::cmpne().

source

pub fn cmpge(self, other: Self) -> BVec2

Return a mask with the result of a component-wise greater-than-or-equal comparison. See glam::Vec2::cmpge().

source

pub fn cmpgt(self, other: Self) -> BVec2

Return a mask with the result of a component-wise greater-than comparison. See glam::Vec2::cmpgt().

source

pub fn cmple(self, other: Self) -> BVec2

Return a mask with the result of a component-wise less-than-or-equal comparison. See glam::Vec2::cmple().

source

pub fn cmplt(self, other: Self) -> BVec2

Return a mask with the result of a component-wise less-than comparison. See glam::Vec2::cmplt().

source

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

Minimum by component. See glam::Vec2::min().

source

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

Maximum by component. See glam::Vec2::max().

source

pub fn min_element(self) -> T::Scalar

Horizontal minimum (smallest component). See glam::Vec2::min_element().

source

pub fn max_element(self) -> T::Scalar

Horizontal maximum (largest component). See glam::Vec2::max_element().

source

pub fn clamp(self, min: Self, max: Self) -> Self

Component-wise clamp. See glam::Vec2::clamp().

source

pub fn select(mask: BVec2, a: Self, b: Self) -> Self

Select components from two instances based on a mask. See glam::Vec2::select().

source

pub fn from_untyped(untyped: Size2<T::Scalar>) -> Size2<T>

Bitcast an untyped instance to self.

source

pub fn to_untyped(self) -> Size2<T::Scalar>

Bitcast self to an untyped instance.

source

pub fn as_untyped(&self) -> &Size2<T::Scalar>

Reinterpret cast self as the untyped variant.

source

pub fn as_untyped_mut(&mut self) -> &mut Size2<T::Scalar>

Reinterpret cast self as the untyped variant.

source

pub fn cast<T2>(self) -> Size2<T2>
where T2: Unit<Scalar = T::Scalar>,

Cast to a different coordinate space with the same underlying scalar type.

source

pub fn cast_ref<T2>(&self) -> &Size2<T2>
where T2: Unit<Scalar = T::Scalar>,

Cast to a different coordinate space with the same underlying scalar type.

source

pub fn cast_mut<T2>(&mut self) -> &mut Size2<T2>
where T2: Unit<Scalar = T::Scalar>,

Cast to a different coordinate space with the same underlying scalar type.

source

pub fn try_cast<T2>(self) -> Option<Size2<T2>>
where T2: Unit,

Cast to a different coordinate space with scalar type conversion. Returns None if any component could not be converted to the target scalar type.

source

pub const fn from_tuple((width, height): (T::Scalar, T::Scalar)) -> Self

Instantiate from tuple.

source

pub const fn to_tuple(self) -> (T::Scalar, T::Scalar)

Convert to tuple.

source

pub fn as_array(&self) -> &[T::Scalar; 2]

Reinterpret as array.

source

pub fn as_array_mut(&mut self) -> &mut [T::Scalar; 2]

Reinterpret as mutable array.

source

pub fn get(&self, index: usize) -> T::Scalar

Get component at index.

source

pub fn set(&mut self, index: usize, value: T::Scalar)

Set component at index.

source

pub fn const_get<const N: usize>(&self) -> T::Scalar

Get component at index N.

source

pub fn const_set<const N: usize>(&mut self, value: T::Scalar)

Set component at index N.

source

pub fn extend(self, depth: T::Scalar) -> Size3<T>

Extend with depth component to Size3. See glam::Vec2::extend().

source

pub fn area(&self) -> T::Scalar

Calculate the area.

source§

impl<T> Size2<T>
where T: Unit, T::Scalar: FloatScalar,

source

pub const NAN: Self = _

All NaN.

source

pub const INFINITY: Self = _

All positive infinity.

source

pub const NEG_INFINITY: Self = _

All negative infinity.

source

pub fn is_finite(&self) -> bool

True if all components are non-infinity and non-NaN. See glam::Vec2::is_finite().

source

pub fn is_nan(&self) -> bool

True if any component is NaN. See glam::Vec2::is_nan().

source

pub fn is_nan_mask(&self) -> BVec2

Return a mask where each bit is set if the corresponding component is NaN. See glam::Vec2::is_nan_mask().

source

pub fn ceil(self) -> Self

Round all components up. See glam::Vec2::ceil().

source

pub fn floor(self) -> Self

Round all components down. See glam::Vec2::floor().

source

pub fn round(self) -> Self

Round all components. See glam::Vec2::round().

source

pub fn fract(self) -> Self

source

pub fn fract_gl(self) -> Self

source

pub fn lerp(self, other: Self, t: T::Scalar) -> Self

Linear interpolation. See glam::Vec2::lerp().

Trait Implementations§

source§

impl<T: Unit> AbsDiffEq for Size2<T>

§

type Epsilon = <<T as Unit>::Scalar as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
source§

fn default_epsilon() -> Self::Epsilon

The default tolerance to use when testing values that are close together. Read more
source§

fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
source§

fn abs_diff_ne(&self, other: &Self, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
source§

impl<T: Unit> Add for Size2<T>

§

type Output = Size2<T>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl<T: Unit> AddAssign for Size2<T>

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl<T: Unit> AsMut<[<T as Unit>::Scalar]> for Size2<T>

source§

fn as_mut(&mut self) -> &mut [T::Scalar]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T: Unit> AsMut<[<T as Unit>::Scalar; 2]> for Size2<T>

source§

fn as_mut(&mut self) -> &mut [T::Scalar; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<DVec2> for Size2<T>
where T: Unit<Scalar = f64>,

source§

fn as_mut(&mut self) -> &mut DVec2

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<I64Vec2> for Size2<T>
where T: Unit<Scalar = i64>,

source§

fn as_mut(&mut self) -> &mut I64Vec2

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<IVec2> for Size2<T>
where T: Unit<Scalar = i32>,

source§

fn as_mut(&mut self) -> &mut IVec2

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<U64Vec2> for Size2<T>
where T: Unit<Scalar = u64>,

source§

fn as_mut(&mut self) -> &mut U64Vec2

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<UVec2> for Size2<T>
where T: Unit<Scalar = u32>,

source§

fn as_mut(&mut self) -> &mut UVec2

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<Vec2> for Size2<T>
where T: Unit<Scalar = f32>,

source§

fn as_mut(&mut self) -> &mut Vec2

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T: Unit> AsRaw for Size2<T>

source§

fn as_raw(&self) -> &Self::Raw

By-ref conversion to Self::Raw.
source§

fn as_raw_mut(&mut self) -> &mut Self::Raw

By-ref mutable conversion to Self::Raw.
source§

impl<T: Unit> AsRef<[<T as Unit>::Scalar]> for Size2<T>

source§

fn as_ref(&self) -> &[T::Scalar]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: Unit> AsRef<[<T as Unit>::Scalar; 2]> for Size2<T>

source§

fn as_ref(&self) -> &[T::Scalar; 2]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<DVec2> for Size2<T>
where T: Unit<Scalar = f64>,

source§

fn as_ref(&self) -> &DVec2

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<I64Vec2> for Size2<T>
where T: Unit<Scalar = i64>,

source§

fn as_ref(&self) -> &I64Vec2

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<IVec2> for Size2<T>
where T: Unit<Scalar = i32>,

source§

fn as_ref(&self) -> &IVec2

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<U64Vec2> for Size2<T>
where T: Unit<Scalar = u64>,

source§

fn as_ref(&self) -> &U64Vec2

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<UVec2> for Size2<T>
where T: Unit<Scalar = u32>,

source§

fn as_ref(&self) -> &UVec2

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<Vec2> for Size2<T>
where T: Unit<Scalar = f32>,

source§

fn as_ref(&self) -> &Vec2

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Borrow<DVec2> for Size2<T>
where T: Unit<Scalar = f64>,

source§

fn borrow(&self) -> &DVec2

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<I64Vec2> for Size2<T>
where T: Unit<Scalar = i64>,

source§

fn borrow(&self) -> &I64Vec2

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<IVec2> for Size2<T>
where T: Unit<Scalar = i32>,

source§

fn borrow(&self) -> &IVec2

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Size2<T>> for DVec2
where T: Unit<Scalar = f64>,

source§

fn borrow(&self) -> &Size2<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Size2<T>> for I64Vec2
where T: Unit<Scalar = i64>,

source§

fn borrow(&self) -> &Size2<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Size2<T>> for IVec2
where T: Unit<Scalar = i32>,

source§

fn borrow(&self) -> &Size2<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Size2<T>> for U64Vec2
where T: Unit<Scalar = u64>,

source§

fn borrow(&self) -> &Size2<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Size2<T>> for UVec2
where T: Unit<Scalar = u32>,

source§

fn borrow(&self) -> &Size2<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Size2<T>> for Vec2
where T: Unit<Scalar = f32>,

source§

fn borrow(&self) -> &Size2<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<U64Vec2> for Size2<T>
where T: Unit<Scalar = u64>,

source§

fn borrow(&self) -> &U64Vec2

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<UVec2> for Size2<T>
where T: Unit<Scalar = u32>,

source§

fn borrow(&self) -> &UVec2

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Vec2> for Size2<T>
where T: Unit<Scalar = f32>,

source§

fn borrow(&self) -> &Vec2

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<DVec2> for Size2<T>
where T: Unit<Scalar = f64>,

source§

fn borrow_mut(&mut self) -> &mut DVec2

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<I64Vec2> for Size2<T>
where T: Unit<Scalar = i64>,

source§

fn borrow_mut(&mut self) -> &mut I64Vec2

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<IVec2> for Size2<T>
where T: Unit<Scalar = i32>,

source§

fn borrow_mut(&mut self) -> &mut IVec2

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Size2<T>> for DVec2
where T: Unit<Scalar = f64>,

source§

fn borrow_mut(&mut self) -> &mut Size2<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Size2<T>> for I64Vec2
where T: Unit<Scalar = i64>,

source§

fn borrow_mut(&mut self) -> &mut Size2<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Size2<T>> for IVec2
where T: Unit<Scalar = i32>,

source§

fn borrow_mut(&mut self) -> &mut Size2<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Size2<T>> for U64Vec2
where T: Unit<Scalar = u64>,

source§

fn borrow_mut(&mut self) -> &mut Size2<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Size2<T>> for UVec2
where T: Unit<Scalar = u32>,

source§

fn borrow_mut(&mut self) -> &mut Size2<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Size2<T>> for Vec2
where T: Unit<Scalar = f32>,

source§

fn borrow_mut(&mut self) -> &mut Size2<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<U64Vec2> for Size2<T>
where T: Unit<Scalar = u64>,

source§

fn borrow_mut(&mut self) -> &mut U64Vec2

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<UVec2> for Size2<T>
where T: Unit<Scalar = u32>,

source§

fn borrow_mut(&mut self) -> &mut UVec2

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Vec2> for Size2<T>
where T: Unit<Scalar = f32>,

source§

fn borrow_mut(&mut self) -> &mut Vec2

Mutably borrows from an owned value. Read more
source§

impl<T: Unit> Clone for Size2<T>

source§

fn clone(&self) -> Self

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<T: Unit> Debug for Size2<T>

source§

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

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

impl<T: Unit> Default for Size2<T>

source§

fn default() -> Self

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

impl<T: Unit> Div<<T as Unit>::Scalar> for Size2<T>

§

type Output = Size2<T>

The resulting type after applying the / operator.
source§

fn div(self, other: T::Scalar) -> Self

Performs the / operation. Read more
source§

impl<T: Unit> DivAssign<<T as Unit>::Scalar> for Size2<T>

source§

fn div_assign(&mut self, other: T::Scalar)

Performs the /= operation. Read more
source§

impl<T: Unit> From<[<T as Unit>::Scalar; 2]> for Size2<T>

source§

fn from(arr: [T::Scalar; 2]) -> Self

Converts to this type from the input type.
source§

impl<T: Unit> From<(<T as Unit>::Scalar, <T as Unit>::Scalar)> for Size2<T>

source§

fn from(tuple: (T::Scalar, T::Scalar)) -> Size2<T>

Converts to this type from the input type.
source§

impl<T> From<DVec2> for Size2<T>
where T: Unit<Scalar = f64>,

source§

fn from(vec: DVec2) -> Size2<T>

Converts to this type from the input type.
source§

impl<T> From<I64Vec2> for Size2<T>
where T: Unit<Scalar = i64>,

source§

fn from(vec: I64Vec2) -> Size2<T>

Converts to this type from the input type.
source§

impl<T> From<IVec2> for Size2<T>
where T: Unit<Scalar = i32>,

source§

fn from(vec: IVec2) -> Size2<T>

Converts to this type from the input type.
source§

impl<T: Unit> From<Size2<T>> for [T::Scalar; 2]

source§

fn from(v: Size2<T>) -> Self

Converts to this type from the input type.
source§

impl<T: Unit> From<Size2<T>> for (T::Scalar, T::Scalar)

source§

fn from(value: Size2<T>) -> (T::Scalar, T::Scalar)

Converts to this type from the input type.
source§

impl<T> From<Size2<T>> for DVec2
where T: Unit<Scalar = f64>,

source§

fn from(vec: Size2<T>) -> DVec2

Converts to this type from the input type.
source§

impl<T> From<Size2<T>> for I64Vec2
where T: Unit<Scalar = i64>,

source§

fn from(vec: Size2<T>) -> I64Vec2

Converts to this type from the input type.
source§

impl<T> From<Size2<T>> for IVec2
where T: Unit<Scalar = i32>,

source§

fn from(vec: Size2<T>) -> IVec2

Converts to this type from the input type.
source§

impl<T> From<Size2<T>> for U64Vec2
where T: Unit<Scalar = u64>,

source§

fn from(vec: Size2<T>) -> U64Vec2

Converts to this type from the input type.
source§

impl<T> From<Size2<T>> for UVec2
where T: Unit<Scalar = u32>,

source§

fn from(vec: Size2<T>) -> UVec2

Converts to this type from the input type.
source§

impl<T> From<Size2<T>> for Vec2
where T: Unit<Scalar = f32>,

source§

fn from(vec: Size2<T>) -> Vec2

Converts to this type from the input type.
source§

impl<T: Unit> From<Size2<T>> for Vector2<T>

source§

fn from(point: Size2<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<U64Vec2> for Size2<T>
where T: Unit<Scalar = u64>,

source§

fn from(vec: U64Vec2) -> Size2<T>

Converts to this type from the input type.
source§

impl<T> From<UVec2> for Size2<T>
where T: Unit<Scalar = u32>,

source§

fn from(vec: UVec2) -> Size2<T>

Converts to this type from the input type.
source§

impl<T> From<Vec2> for Size2<T>
where T: Unit<Scalar = f32>,

source§

fn from(vec: Vec2) -> Size2<T>

Converts to this type from the input type.
source§

impl<T: Unit> From<Vector2<T>> for Size2<T>

source§

fn from(vec: Vector2<T>) -> Self

Converts to this type from the input type.
source§

impl<T: Unit> FromRaw for Size2<T>

source§

fn from_raw(raw: Self::Raw) -> Self

By-value conversion from Self::Raw.
source§

impl<T> Hash for Size2<T>
where T: Unit, T::Scalar: Hash,

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T: Unit> Index<usize> for Size2<T>

§

type Output = <T as Unit>::Scalar

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<T: Unit> IndexMut<usize> for Size2<T>

source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<T: Unit> IntoIterator for Size2<T>

§

type Item = <T as Unit>::Scalar

The type of the elements being iterated over.
§

type IntoIter = <[<T as Unit>::Scalar; 2] as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T: Unit> Mul<<T as Unit>::Scalar> for Size2<T>

§

type Output = Size2<T>

The resulting type after applying the * operator.
source§

fn mul(self, other: T::Scalar) -> Self

Performs the * operation. Read more
source§

impl<T: Unit> MulAssign<<T as Unit>::Scalar> for Size2<T>

source§

fn mul_assign(&mut self, other: T::Scalar)

Performs the *= operation. Read more
source§

impl<T: Unit> PartialEq<[<T as Unit>::Scalar; 2]> for Size2<T>

source§

fn eq(&self, other: &[T::Scalar; 2]) -> 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: Unit> PartialEq<(<T as Unit>::Scalar, <T as Unit>::Scalar)> for Size2<T>

source§

fn eq(&self, (width, height): &(T::Scalar, T::Scalar)) -> 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: Unit> PartialEq for Size2<T>

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<T: Unit> RelativeEq for Size2<T>
where T::Scalar: RelativeEq,

source§

fn default_max_relative() -> Self::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
source§

fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
source§

fn relative_ne( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool

The inverse of RelativeEq::relative_eq.
source§

impl<T: Unit> Rem<<T as Unit>::Scalar> for Size2<T>

§

type Output = Size2<T>

The resulting type after applying the % operator.
source§

fn rem(self, other: T::Scalar) -> Self

Performs the % operation. Read more
source§

impl<T: Unit> RemAssign<<T as Unit>::Scalar> for Size2<T>

source§

fn rem_assign(&mut self, other: T::Scalar)

Performs the %= operation. Read more
source§

impl<T: Unit> Sub for Size2<T>

§

type Output = Size2<T>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl<T: Unit> SubAssign for Size2<T>

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl<T: Unit> ToRaw for Size2<T>

§

type Raw = <<T as Unit>::Scalar as Scalar>::Vec2

The underlying glam type.
source§

fn to_raw(self) -> Self::Raw

By-value conversion to Self::Raw.
source§

impl<T: Unit> TransparentWrapper<<<T as Unit>::Scalar as Scalar>::Vec2> for Size2<T>

source§

fn wrap(s: Inner) -> Self
where Self: Sized,

Convert the inner type into the wrapper type.
source§

fn wrap_ref(s: &Inner) -> &Self

Convert a reference to the inner type into a reference to the wrapper type.
source§

fn wrap_mut(s: &mut Inner) -> &mut Self

Convert a mutable reference to the inner type into a mutable reference to the wrapper type.
source§

fn wrap_slice(s: &[Inner]) -> &[Self]
where Self: Sized,

Convert a slice to the inner type into a slice to the wrapper type.
source§

fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]
where Self: Sized,

Convert a mutable slice to the inner type into a mutable slice to the wrapper type.
source§

fn peel(s: Self) -> Inner
where Self: Sized,

Convert the wrapper type into the inner type.
source§

fn peel_ref(s: &Self) -> &Inner

Convert a reference to the wrapper type into a reference to the inner type.
source§

fn peel_mut(s: &mut Self) -> &mut Inner

Convert a mutable reference to the wrapper type into a mutable reference to the inner type.
source§

fn peel_slice(s: &[Self]) -> &[Inner]
where Self: Sized,

Convert a slice to the wrapped type into a slice to the inner type.
source§

fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]
where Self: Sized,

Convert a mutable slice to the wrapped type into a mutable slice to the inner type.
source§

impl<T: Unit> UlpsEq for Size2<T>
where T::Scalar: UlpsEq,

source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
source§

fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
source§

fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of UlpsEq::ulps_eq.
source§

impl<T: Unit> Zeroable for Size2<T>

SAFETY: All members are Pod, and we are #[repr(C)].

source§

fn zeroed() -> Self

source§

impl<T: Unit> Copy for Size2<T>

source§

impl<T> Eq for Size2<T>
where T: Unit, T::Scalar: Eq,

source§

impl<T: Unit> Pod for Size2<T>

SAFETY: All members are Pod, and we are #[repr(C)].

Auto Trait Implementations§

§

impl<T> Freeze for Size2<T>
where <T as Unit>::Scalar: Freeze,

§

impl<T> RefUnwindSafe for Size2<T>
where <T as Unit>::Scalar: RefUnwindSafe,

§

impl<T> Send for Size2<T>

§

impl<T> Sync for Size2<T>

§

impl<T> Unpin for Size2<T>
where <T as Unit>::Scalar: Unpin,

§

impl<T> UnwindSafe for Size2<T>
where <T as Unit>::Scalar: UnwindSafe,

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> CheckedBitPattern for T
where T: AnyBitPattern,

§

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.
source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
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.
source§

impl<T> AnyBitPattern for T
where T: Pod,

source§

impl<T> NoUninit for T
where T: Pod,

source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

source§

impl<T> PodValue for T
where T: Copy + Debug + Default + PartialEq + Pod + Send + Sync + Serializable + 'static,

source§

impl<T> Serializable for T