Struct figures::Size

source ·
pub struct Size<Unit> {
    pub width: Unit,
    pub height: Unit,
}
Expand description

A width and a height measurement.

Fields§

§width: Unit

The width component

§height: Unit

The height component

Implementations§

source§

impl<Unit> Size<Unit>

source

pub const fn new(width: Unit, height: Unit) -> Self

Returns a new size of the given width and height.

source

pub fn squared(dimension: Unit) -> Selfwhere Unit: Clone,

Returns a new size using dimension for both width and height.

source

pub fn area(&self) -> <Unit as Mul>::Outputwhere Unit: Mul + Copy,

Returns the area of the rectangle.

source

pub fn cast<NewUnit>(self) -> Size<NewUnit>where NewUnit: From<Unit>,

Converts the contents of this size to NewUnit using From.

source

pub fn map<NewUnit>(self, map: impl FnMut(Unit) -> NewUnit) -> Size<NewUnit>

Maps each component to map and returns a new value with the mapped components.

source

pub fn try_cast<NewUnit>(self) -> Result<Size<NewUnit>, NewUnit::Error>where NewUnit: TryFrom<Unit>,

Converts the contents of this size to NewUnit using TryFrom.

Errors

Returns <NewUnit as TryFrom>::Error when the inner type cannot be converted. For this crate’s types, this genenerally will be

Trait Implementations§

source§

impl<Unit> Abs for Size<Unit>where Unit: Abs,

source§

fn abs(&self) -> Self

Returns the positive difference between this value and 0. Read more
source§

impl<Unit> Add<Lp> for Size<Unit>where Unit: Add<Lp, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Lp) -> Self::Output

Performs the + operation. Read more
source§

impl<T, Unit> Add<Point<T>> for Size<Unit>where Unit: Add<T, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Point<T>) -> Self::Output

Performs the + operation. Read more
source§

impl<Unit> Add<Px> for Size<Unit>where Unit: Add<Px, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Px) -> Self::Output

Performs the + operation. Read more
source§

impl<T, Unit> Add<Size<T>> for Point<Unit>where Unit: Add<T, Output = Unit>,

§

type Output = Point<Unit>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Size<T>) -> Self::Output

Performs the + operation. Read more
source§

impl<T, Unit> Add<Size<T>> for Size<Unit>where Unit: Add<T, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Size<T>) -> Self::Output

Performs the + operation. Read more
source§

impl<Unit> Add<UPx> for Size<Unit>where Unit: Add<UPx, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the + operator.
source§

fn add(self, rhs: UPx) -> Self::Output

Performs the + operation. Read more
source§

impl<Unit> Add<f32> for Size<Unit>where Unit: Add<f32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the + operator.
source§

fn add(self, rhs: f32) -> Self::Output

Performs the + operation. Read more
source§

impl<Unit> Add<i32> for Size<Unit>where Unit: Add<i32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the + operator.
source§

fn add(self, rhs: i32) -> Self::Output

Performs the + operation. Read more
source§

impl<Unit> Add<u32> for Size<Unit>where Unit: Add<u32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the + operator.
source§

fn add(self, rhs: u32) -> Self::Output

Performs the + operation. Read more
source§

impl<Unit> AddAssign<Point<Unit>> for Size<Unit>where Unit: AddAssign,

source§

fn add_assign(&mut self, rhs: Point<Unit>)

Performs the += operation. Read more
source§

impl<Unit> AddAssign<Size<Unit>> for Point<Unit>where Unit: AddAssign,

source§

fn add_assign(&mut self, rhs: Size<Unit>)

Performs the += operation. Read more
source§

impl<Unit> AddAssign<Unit> for Size<Unit>where Unit: AddAssign + Clone,

source§

fn add_assign(&mut self, rhs: Unit)

Performs the += operation. Read more
source§

impl<Unit> AddAssign for Size<Unit>where Unit: AddAssign,

source§

fn add_assign(&mut self, rhs: Size<Unit>)

Performs the += operation. Read more
source§

impl<Unit: Clone> Clone for Size<Unit>

source§

fn clone(&self) -> Size<Unit>

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

source§

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

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

impl<Unit: Default> Default for Size<Unit>

source§

fn default() -> Size<Unit>

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

impl<'de, Unit> Deserialize<'de> for Size<Unit>where Unit: Deserialize<'de>,

source§

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<Unit> Div<Lp> for Size<Unit>where Unit: Div<Lp, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Lp) -> Self::Output

Performs the / operation. Read more
source§

impl<T, Unit> Div<Point<T>> for Size<Unit>where Unit: Div<T, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Point<T>) -> Self::Output

Performs the / operation. Read more
source§

impl<Unit> Div<Px> for Size<Unit>where Unit: Div<Px, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Px) -> Self::Output

Performs the / operation. Read more
source§

impl<T, Unit> Div<Size<T>> for Point<Unit>where Unit: Div<T, Output = Unit>,

§

type Output = Point<Unit>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Size<T>) -> Self::Output

Performs the / operation. Read more
source§

impl<T, Unit> Div<Size<T>> for Size<Unit>where Unit: Div<T, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Size<T>) -> Self::Output

Performs the / operation. Read more
source§

impl<Unit> Div<UPx> for Size<Unit>where Unit: Div<UPx, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the / operator.
source§

fn div(self, rhs: UPx) -> Self::Output

Performs the / operation. Read more
source§

impl<Unit> Div<f32> for Size<Unit>where Unit: Div<f32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the / operator.
source§

fn div(self, rhs: f32) -> Self::Output

Performs the / operation. Read more
source§

impl<Unit> Div<i32> for Size<Unit>where Unit: Div<i32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the / operator.
source§

fn div(self, rhs: i32) -> Self::Output

Performs the / operation. Read more
source§

impl<Unit> Div<u32> for Size<Unit>where Unit: Div<u32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the / operator.
source§

fn div(self, rhs: u32) -> Self::Output

Performs the / operation. Read more
source§

impl<Unit> DivAssign<Point<Unit>> for Size<Unit>where Unit: DivAssign,

source§

fn div_assign(&mut self, rhs: Point<Unit>)

Performs the /= operation. Read more
source§

impl<Unit> DivAssign<Size<Unit>> for Point<Unit>where Unit: DivAssign,

source§

fn div_assign(&mut self, rhs: Size<Unit>)

Performs the /= operation. Read more
source§

impl<Unit> DivAssign<Unit> for Size<Unit>where Unit: DivAssign + Clone,

source§

fn div_assign(&mut self, rhs: Unit)

Performs the /= operation. Read more
source§

impl<Unit> DivAssign for Size<Unit>where Unit: DivAssign,

source§

fn div_assign(&mut self, rhs: Size<Unit>)

Performs the /= operation. Read more
source§

impl<T> FloatConversion for Size<T>where T: FloatConversion,

§

type Float = Size<<T as FloatConversion>::Float>

The type that represents this type in floating point form.
source§

fn into_float(self) -> Self::Float

Returns this value in floating point form.
source§

fn from_float(float: Self::Float) -> Self

Converts from floating point to this form.
source§

impl From<PhysicalSize<i32>> for Size<Px>

source§

fn from(value: PhysicalSize<i32>) -> Self

Converts to this type from the input type.
source§

impl From<PhysicalSize<u32>> for Size<UPx>

source§

fn from(value: PhysicalSize<u32>) -> Self

Converts to this type from the input type.
source§

impl<Unit> From<Point<Unit>> for Size<Unit>

source§

fn from(value: Point<Unit>) -> Self

Converts to this type from the input type.
source§

impl From<Size<Px>> for PhysicalSize<i32>

source§

fn from(size: Size<Px>) -> Self

Converts to this type from the input type.
source§

impl From<Size<UPx>> for Extent3d

source§

fn from(value: Size<UPx>) -> Self

Converts to this type from the input type.
source§

impl From<Size<UPx>> for PhysicalSize<u32>

source§

fn from(size: Size<UPx>) -> Self

Converts to this type from the input type.
source§

impl<Unit> From<Size<Unit>> for Point<Unit>

source§

fn from(value: Size<Unit>) -> Self

Converts to this type from the input type.
source§

impl<Unit> From<Size<Unit>> for Rect<Unit>where Unit: Default,

source§

fn from(size: Size<Unit>) -> Self

Converts to this type from the input type.
source§

impl<Unit> FromComponents<Unit> for Size<Unit>

source§

fn from_components(components: (Unit, Unit)) -> Self

Returns a new instance from the 2d vector components provided.
source§

fn from_vec<Type>(other: Type) -> Selfwhere Type: IntoComponents<Unit>,

Converts this type to another type using FromComponents and IntoComponents.
source§

impl<Unit: Hash> Hash for Size<Unit>

source§

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

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<Unit> IntoComponents<Unit> for Size<Unit>

source§

fn into_components(self) -> (Unit, Unit)

Extracts this type’s 2d vector components.
source§

fn to_vec<Type>(self) -> Typewhere Type: FromComponents<Unit>,

Converts this type to another type using FromComponents and IntoComponents.
source§

impl<Unit> IntoSigned for Size<Unit>where Unit: IntoSigned,

§

type Signed = Size<<Unit as IntoSigned>::Signed>

The signed representation of this type.
source§

fn into_signed(self) -> Self::Signed

Returns this value as an unsigned value. Values that are larger than can fit in an i32 are converted to i32::MAX.
source§

impl<Unit> IntoUnsigned for Size<Unit>where Unit: IntoUnsigned,

§

type Unsigned = Size<<Unit as IntoUnsigned>::Unsigned>

The unsigned representation of this type.
source§

fn into_unsigned(self) -> Self::Unsigned

Returns this value as an unsigned value. Negative values will be converted to 0.
source§

impl<Unit> Mul<Lp> for Size<Unit>where Unit: Mul<Lp, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Lp) -> Self::Output

Performs the * operation. Read more
source§

impl<T, Unit> Mul<Point<T>> for Size<Unit>where Unit: Mul<T, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Point<T>) -> Self::Output

Performs the * operation. Read more
source§

impl<Unit> Mul<Px> for Size<Unit>where Unit: Mul<Px, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Px) -> Self::Output

Performs the * operation. Read more
source§

impl<T, Unit> Mul<Size<T>> for Point<Unit>where Unit: Mul<T, Output = Unit>,

§

type Output = Point<Unit>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Size<T>) -> Self::Output

Performs the * operation. Read more
source§

impl<T, Unit> Mul<Size<T>> for Size<Unit>where Unit: Mul<T, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Size<T>) -> Self::Output

Performs the * operation. Read more
source§

impl<Unit> Mul<UPx> for Size<Unit>where Unit: Mul<UPx, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: UPx) -> Self::Output

Performs the * operation. Read more
source§

impl<Unit> Mul<f32> for Size<Unit>where Unit: Mul<f32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: f32) -> Self::Output

Performs the * operation. Read more
source§

impl<Unit> Mul<i32> for Size<Unit>where Unit: Mul<i32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i32) -> Self::Output

Performs the * operation. Read more
source§

impl<Unit> Mul<u32> for Size<Unit>where Unit: Mul<u32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: u32) -> Self::Output

Performs the * operation. Read more
source§

impl<Unit> MulAssign<Point<Unit>> for Size<Unit>where Unit: MulAssign,

source§

fn mul_assign(&mut self, rhs: Point<Unit>)

Performs the *= operation. Read more
source§

impl<Unit> MulAssign<Size<Unit>> for Point<Unit>where Unit: MulAssign,

source§

fn mul_assign(&mut self, rhs: Size<Unit>)

Performs the *= operation. Read more
source§

impl<Unit> MulAssign<Unit> for Size<Unit>where Unit: MulAssign + Clone,

source§

fn mul_assign(&mut self, rhs: Unit)

Performs the *= operation. Read more
source§

impl<Unit> MulAssign for Size<Unit>where Unit: MulAssign,

source§

fn mul_assign(&mut self, rhs: Size<Unit>)

Performs the *= operation. Read more
source§

impl<Unit> Neg for Size<Unit>where Unit: Neg<Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<Unit> Ord for Size<Unit>where Unit: Ord + Mul<Output = Unit> + Copy,

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
source§

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

Restrict a value to a certain interval. Read more
source§

impl<Unit: PartialEq> PartialEq for Size<Unit>

source§

fn eq(&self, other: &Size<Unit>) -> 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<Unit> PartialOrd for Size<Unit>where Unit: Ord + Mul<Output = Unit> + Copy,

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Unit> Pow for Size<Unit>where Unit: Pow,

source§

fn pow(&self, exp: u32) -> Self

Returns the saturating result of raising self to the exp power.
source§

impl<Unit> Ranged for Size<Unit>where Unit: Ranged,

source§

const MAX: Self = _

The maximum value for this type.
source§

const MIN: Self = _

The minimum value for this type.
source§

impl<Unit> Rem<Lp> for Size<Unit>where Unit: Rem<Lp, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Lp) -> Self::Output

Performs the % operation. Read more
source§

impl<T, Unit> Rem<Point<T>> for Size<Unit>where Unit: Rem<T, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Point<T>) -> Self::Output

Performs the % operation. Read more
source§

impl<Unit> Rem<Px> for Size<Unit>where Unit: Rem<Px, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Px) -> Self::Output

Performs the % operation. Read more
source§

impl<T, Unit> Rem<Size<T>> for Point<Unit>where Unit: Rem<T, Output = Unit>,

§

type Output = Point<Unit>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Size<T>) -> Self::Output

Performs the % operation. Read more
source§

impl<T, Unit> Rem<Size<T>> for Size<Unit>where Unit: Rem<T, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Size<T>) -> Self::Output

Performs the % operation. Read more
source§

impl<Unit> Rem<UPx> for Size<Unit>where Unit: Rem<UPx, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: UPx) -> Self::Output

Performs the % operation. Read more
source§

impl<Unit> Rem<f32> for Size<Unit>where Unit: Rem<f32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: f32) -> Self::Output

Performs the % operation. Read more
source§

impl<Unit> Rem<i32> for Size<Unit>where Unit: Rem<i32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: i32) -> Self::Output

Performs the % operation. Read more
source§

impl<Unit> Rem<u32> for Size<Unit>where Unit: Rem<u32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: u32) -> Self::Output

Performs the % operation. Read more
source§

impl<Unit> RemAssign<Point<Unit>> for Size<Unit>where Unit: RemAssign,

source§

fn rem_assign(&mut self, rhs: Point<Unit>)

Performs the %= operation. Read more
source§

impl<Unit> RemAssign<Size<Unit>> for Point<Unit>where Unit: RemAssign,

source§

fn rem_assign(&mut self, rhs: Size<Unit>)

Performs the %= operation. Read more
source§

impl<Unit> RemAssign<Unit> for Size<Unit>where Unit: RemAssign + Clone,

source§

fn rem_assign(&mut self, rhs: Unit)

Performs the %= operation. Read more
source§

impl<Unit> RemAssign for Size<Unit>where Unit: RemAssign,

source§

fn rem_assign(&mut self, rhs: Size<Unit>)

Performs the %= operation. Read more
source§

impl<Unit> Round for Size<Unit>where Unit: Round,

source§

fn round(self) -> Self

Returns self rounded to the nearest whole number.
source§

fn ceil(self) -> Self

Returns self raised to the next whole number further away from 0.
source§

fn floor(self) -> Self

Returns self lowered to the next whole number closer to 0.
source§

impl<Unit> ScreenScale for Size<Unit>where Unit: ScreenScale<Lp = Lp, Px = Px, UPx = UPx>,

§

type Lp = Size<Lp>

This type when measuring with Lp.
§

type Px = Size<Px>

This type when measuring with Px.
§

type UPx = Size<UPx>

This type when measuring with UPx.
source§

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

Converts from pixels into this type, using the provided scale factor.
source§

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

Converts from Lp into this type, using the provided scale factor.
source§

fn into_upx(self, scale: Fraction) -> Self::UPx

Converts this value from its current unit into device pixels (UPx) using the provided scale factor.
source§

fn from_upx(px: Self::UPx, scale: Fraction) -> Self

Converts from unsigned pixels into this type, using the provided scale factor.
source§

impl<Unit> Serialize for Size<Unit>where Unit: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<Unit> Sub<Lp> for Size<Unit>where Unit: Sub<Lp, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Lp) -> Self::Output

Performs the - operation. Read more
source§

impl<T, Unit> Sub<Point<T>> for Size<Unit>where Unit: Sub<T, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Point<T>) -> Self::Output

Performs the - operation. Read more
source§

impl<Unit> Sub<Px> for Size<Unit>where Unit: Sub<Px, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Px) -> Self::Output

Performs the - operation. Read more
source§

impl<T, Unit> Sub<Size<T>> for Point<Unit>where Unit: Sub<T, Output = Unit>,

§

type Output = Point<Unit>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Size<T>) -> Self::Output

Performs the - operation. Read more
source§

impl<T, Unit> Sub<Size<T>> for Size<Unit>where Unit: Sub<T, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Size<T>) -> Self::Output

Performs the - operation. Read more
source§

impl<Unit> Sub<UPx> for Size<Unit>where Unit: Sub<UPx, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: UPx) -> Self::Output

Performs the - operation. Read more
source§

impl<Unit> Sub<f32> for Size<Unit>where Unit: Sub<f32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: f32) -> Self::Output

Performs the - operation. Read more
source§

impl<Unit> Sub<i32> for Size<Unit>where Unit: Sub<i32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: i32) -> Self::Output

Performs the - operation. Read more
source§

impl<Unit> Sub<u32> for Size<Unit>where Unit: Sub<u32, Output = Unit>,

§

type Output = Size<Unit>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: u32) -> Self::Output

Performs the - operation. Read more
source§

impl<Unit> SubAssign<Point<Unit>> for Size<Unit>where Unit: SubAssign,

source§

fn sub_assign(&mut self, rhs: Point<Unit>)

Performs the -= operation. Read more
source§

impl<Unit> SubAssign<Size<Unit>> for Point<Unit>where Unit: SubAssign,

source§

fn sub_assign(&mut self, rhs: Size<Unit>)

Performs the -= operation. Read more
source§

impl<Unit> SubAssign<Unit> for Size<Unit>where Unit: SubAssign + Clone,

source§

fn sub_assign(&mut self, rhs: Unit)

Performs the -= operation. Read more
source§

impl<Unit> SubAssign for Size<Unit>where Unit: SubAssign,

source§

fn sub_assign(&mut self, rhs: Size<Unit>)

Performs the -= operation. Read more
source§

impl<Unit> Zero for Size<Unit>where Unit: Zero,

source§

const ZERO: Self = _

The zero value for this type.
source§

fn is_zero(&self) -> bool

Returns true if self represents 0.
source§

impl Zeroable for Size<Lp>

§

fn zeroed() -> Self

source§

impl Zeroable for Size<Px>

§

fn zeroed() -> Self

source§

impl Zeroable for Size<f32>

§

fn zeroed() -> Self

source§

impl Zeroable for Size<i32>

§

fn zeroed() -> Self

source§

impl Zeroable for Size<u32>

§

fn zeroed() -> Self

source§

impl<Unit: Copy> Copy for Size<Unit>

source§

impl<Unit: Eq> Eq for Size<Unit>

source§

impl Pod for Size<Lp>

source§

impl Pod for Size<Px>

source§

impl Pod for Size<f32>

source§

impl Pod for Size<i32>

source§

impl Pod for Size<u32>

source§

impl<Unit> StructuralEq for Size<Unit>

source§

impl<Unit> StructuralPartialEq for Size<Unit>

Auto Trait Implementations§

§

impl<Unit> RefUnwindSafe for Size<Unit>where Unit: RefUnwindSafe,

§

impl<Unit> Send for Size<Unit>where Unit: Send,

§

impl<Unit> Sync for Size<Unit>where Unit: Sync,

§

impl<Unit> Unpin for Size<Unit>where Unit: Unpin,

§

impl<Unit> UnwindSafe for Size<Unit>where Unit: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

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

Mutably borrows from an owned value. Read more
§

impl<A> Cast for A

§

fn cast<To>(self) -> Towhere To: CastFrom<A>,

Casts self to the To type. This may be a lossy operation.
§

impl<A> CastFrom<A> for A

§

fn from_cast(from: A) -> A

Returns from as Self.
§

impl<A, B> CastInto<A> for Bwhere A: CastFrom<B>,

§

fn cast_into(self) -> A

Returns self as To.
§

impl<T> CheckedBitPattern for Twhere 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.
§

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> Comparable<K> for Qwhere Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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<Unit> IntoComponents<Unit> for Unitwhere Unit: Copy,

source§

fn into_components(self) -> (Unit, Unit)

Extracts this type’s 2d vector components.
source§

fn to_vec<Type>(self) -> Typewhere Type: FromComponents<Unit>,

Converts this type to another type using FromComponents and IntoComponents.
source§

impl<T> Lp2D for Twhere T: FromComponents<Lp>,

source§

fn points(x: impl Into<FloatOrInt>, y: impl Into<FloatOrInt>) -> Self

Returns a new value containing the x and y components converted into Lp using Lp::points/Lp::points_f.
source§

fn cm(x: impl Into<FloatOrInt>, y: impl Into<FloatOrInt>) -> Self

Returns a new value containing the x and y components converted into Lp using Lp::cm/Lp::cm_f.
source§

fn mm(x: impl Into<FloatOrInt>, y: impl Into<FloatOrInt>) -> Self

Returns a new value containing the x and y components converted into Lp using Lp::mm/Lp::mm_f.
source§

fn inches(x: impl Into<FloatOrInt>, y: impl Into<FloatOrInt>) -> Self

Returns a new value containing the x and y components converted into Lp using Lp::inches/Lp::inches_f.
source§

impl<T> Px2D for Twhere T: FromComponents<Px>,

source§

fn px(x: impl Into<Px>, y: impl Into<Px>) -> Self

Returns a new value containing the x and y components converted into Px.
source§

impl<T> ToOwned for Twhere 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 Twhere 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 Twhere 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> UPx2D for Twhere T: FromComponents<UPx>,

source§

fn upx(x: impl Into<UPx>, y: impl Into<UPx>) -> Self

Returns a new value containing the x and y components converted into UPx.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> AnyBitPattern for Twhere T: Pod,

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

§

impl<T> NoUninit for Twhere T: Pod,

source§

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

source§

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

§

impl<T> WasmNotSend for Twhere T: Send,

§

impl<T> WasmNotSendSync for Twhere T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for Twhere T: Sync,