Struct figures::Point

source ·
pub struct Point<Unit> {
    pub x: Unit,
    pub y: Unit,
}
Expand description

A coordinate in a 2d space.

Fields§

§x: Unit

The x-axis component.

§y: Unit

The y-axis component

Implementations§

source§

impl<Unit> Point<Unit>

source

pub const fn new(x: Unit, y: Unit) -> Self

Returns a new point with the provided x and y components.

source

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

Returns a new point with both x and y initialized with i.

source

pub fn cast<NewUnit>(self) -> Point<NewUnit>where Unit: Into<NewUnit>,

Converts the contents of this point to NewUnit using From.

source

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

Converts the contents of this point 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 TryFromIntError.

source

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

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

source

pub fn dot(self, other: Point<Unit>) -> Unitwhere Unit: Mul<Output = Unit> + Add<Output = Unit>,

Returns the dot product of self and other.

source

pub fn magnitude(self) -> Unitwhere Unit: Mul<Output = Unit> + Add<Output = Unit> + Roots + Copy,

Returns the magnitude of self, which is the absolute distance from 0,0.

source

pub fn rotate_around(self, origin: Point<Unit>, angle: Angle) -> Point<Unit>where Unit: Copy + Add<Output = Unit> + Sub<Output = Unit> + Mul<Fraction, Output = Unit>,

Returns self rotated around origin by angle.

source

pub fn rotate_by(self, angle: Angle) -> Point<Unit>where Unit: Zero + Copy + Add<Output = Unit> + Sub<Output = Unit> + Mul<Fraction, Output = Unit>,

Returns self rotated around Point::ZERO by angle.

Trait Implementations§

source§

impl<Unit> Abs for Point<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 Point<Unit>where Unit: Add<Lp, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Add<T, Output = Unit>,

§

type Output = Point<Unit>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Point<T>) -> 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<Point<Unit>> for Rect<Unit>where Unit: Add<Output = Unit>,

§

type Output = Rect<Unit>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

§

type Output = Point<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<Unit> Add<UPx> for Point<Unit>where Unit: Add<UPx, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Add<f32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Add<i32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Add<u32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: AddAssign + Clone,

source§

fn add_assign(&mut self, rhs: Unit)

Performs the += operation. Read more
source§

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

source§

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

Performs the += operation. Read more
source§

impl<Unit: Clone> Clone for Point<Unit>

source§

fn clone(&self) -> Point<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 Point<Unit>

source§

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

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

impl<Unit: Default> Default for Point<Unit>

source§

fn default() -> Point<Unit>

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

impl<'de, Unit> Deserialize<'de> for Point<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 Point<Unit>where Unit: Div<Lp, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Div<T, Output = Unit>,

§

type Output = Point<Unit>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Point<T>) -> 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 Point<Unit>where Unit: Div<Px, Output = Unit>,

§

type Output = Point<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<Unit> Div<UPx> for Point<Unit>where Unit: Div<UPx, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Div<f32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Div<i32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Div<u32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: DivAssign + Clone,

source§

fn div_assign(&mut self, rhs: Unit)

Performs the /= operation. Read more
source§

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

source§

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

Performs the /= operation. Read more
source§

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

§

type Float = Point<<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<Unit> From<PhysicalPosition<f64>> for Point<Unit>where Unit: FloatConversion<Float = f32>,

source§

fn from(point: PhysicalPosition<f64>) -> Self

Converts to this type from the input type.
source§

impl From<PhysicalPosition<i32>> for Point<Px>

source§

fn from(point: PhysicalPosition<i32>) -> Self

Converts to this type from the input type.
source§

impl From<PhysicalPosition<u32>> for Point<UPx>

source§

fn from(point: PhysicalPosition<u32>) -> Self

Converts to this type from the input type.
source§

impl From<Point<Px>> for PhysicalPosition<i32>

source§

fn from(point: Point<Px>) -> Self

Converts to this type from the input type.
source§

impl From<Point<UPx>> for Origin3d

source§

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

Converts to this type from the input type.
source§

impl From<Point<UPx>> for PhysicalPosition<u32>

source§

fn from(point: Point<UPx>) -> Self

Converts to this type from the input type.
source§

impl<Unit> From<Point<Unit>> for Point2D<f32, UnknownUnit>where Unit: FloatConversion<Float = f32>,

source§

fn from(point: Point<Unit>) -> 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<Unit> From<Point2D<f32, UnknownUnit>> for Point<Unit>where Unit: FloatConversion<Float = f32>,

source§

fn from(point: Point2D<f32, UnknownUnit>) -> 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> FromComponents<Unit> for Point<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 Point<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 Point<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 Point<Unit>where Unit: IntoSigned,

§

type Signed = Point<<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 Point<Unit>where Unit: IntoUnsigned,

§

type Unsigned = Point<<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 Point<Unit>where Unit: Mul<Lp, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Mul<T, Output = Unit>,

§

type Output = Point<Unit>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Point<T>) -> 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 Point<Unit>where Unit: Mul<Px, Output = Unit>,

§

type Output = Point<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<Unit> Mul<UPx> for Point<Unit>where Unit: Mul<UPx, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Mul<f32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Mul<i32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Mul<u32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: MulAssign + Clone,

source§

fn mul_assign(&mut self, rhs: Unit)

Performs the *= operation. Read more
source§

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

source§

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

Performs the *= operation. Read more
source§

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

§

type Output = Point<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 Point<Unit>where Unit: Ord + Copy + Mul<Output = Unit>,

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 Point<Unit>

source§

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

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 Point<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 Point<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 Point<Unit>where Unit: Rem<Lp, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Rem<T, Output = Unit>,

§

type Output = Point<Unit>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Point<T>) -> 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 Point<Unit>where Unit: Rem<Px, Output = Unit>,

§

type Output = Point<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<Unit> Rem<UPx> for Point<Unit>where Unit: Rem<UPx, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Rem<f32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Rem<i32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Rem<u32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: RemAssign + Clone,

source§

fn rem_assign(&mut self, rhs: Unit)

Performs the %= operation. Read more
source§

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

source§

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

Performs the %= operation. Read more
source§

impl<Unit> Round for Point<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 Point<Unit>where Unit: ScreenScale<Lp = Lp, Px = Px, UPx = UPx>,

§

type Lp = Point<Lp>

This type when measuring with Lp.
§

type Px = Point<Px>

This type when measuring with Px.
§

type UPx = Point<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 Point<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 Point<Unit>where Unit: Sub<Lp, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Sub<T, Output = Unit>,

§

type Output = Point<Unit>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Point<T>) -> 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<Point<Unit>> for Rect<Unit>where Unit: Sub<Output = Unit>,

§

type Output = Rect<Unit>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

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

§

type Output = Point<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<Unit> Sub<UPx> for Point<Unit>where Unit: Sub<UPx, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Sub<f32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Sub<i32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: Sub<u32, Output = Unit>,

§

type Output = Point<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 Point<Unit>where Unit: SubAssign + Clone,

source§

fn sub_assign(&mut self, rhs: Unit)

Performs the -= operation. Read more
source§

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

source§

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

Performs the -= operation. Read more
source§

impl<Unit> Zero for Point<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 Point<Lp>

§

fn zeroed() -> Self

source§

impl Zeroable for Point<Px>

§

fn zeroed() -> Self

source§

impl Zeroable for Point<f32>

§

fn zeroed() -> Self

source§

impl Zeroable for Point<i32>

§

fn zeroed() -> Self

source§

impl Zeroable for Point<u32>

§

fn zeroed() -> Self

source§

impl<Unit: Copy> Copy for Point<Unit>

source§

impl<Unit: Eq> Eq for Point<Unit>

source§

impl Pod for Point<Lp>

source§

impl Pod for Point<Px>

source§

impl Pod for Point<f32>

source§

impl Pod for Point<i32>

source§

impl Pod for Point<u32>

source§

impl<Unit> StructuralEq for Point<Unit>

source§

impl<Unit> StructuralPartialEq for Point<Unit>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<Unit> UnwindSafe for Point<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,