Struct taffy::geometry::Point

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

A 2-dimensional coordinate.

When used in association with a Rect, represents the bottom-left corner.

Fields§

§x: T

The x-coordinate

§y: T

The y-coordinate

Implementations§

source§

impl Point<f32>

source

pub const ZERO: Self = _

A Point with values (0,0), representing the origin

source§

impl Point<Option<f32>>

source

pub const NONE: Self = _

A Point with values (None, None)

source§

impl<T: TaffyZero> Point<T>

source

pub const fn zero() -> Self

Returns a Point where both the x and y values are the zero value of the contained type (e.g. 0.0, Some(0.0), or Dimension::Points(0.0))

source§

impl<T: TaffyAuto> Point<T>

source

pub const fn auto() -> Self

Returns a Point where both the x and y values are the auto value of the contained type (e.g. Dimension::Auto or LengthPercentageAuto::Auto)

source§

impl<T: TaffyMinContent> Point<T>

source

pub const fn min_content() -> Self

Returns a Point where both the x and y values are the min_content value of the contained type (e.g. Dimension::Auto or LengthPercentageAuto::Auto)

source§

impl<T: TaffyMaxContent> Point<T>

source

pub const fn max_content() -> Self

Returns a Point where both the x and y values are the max_content value of the contained type (e.g. Dimension::Auto or LengthPercentageAuto::Auto)

source§

impl<T: TaffyFitContent> Point<T>

source

pub fn fit_content(argument: LengthPercentage) -> Self

Returns a Point where both the x and y values are the constant points value of the contained type (e.g. 2.1, Some(2.1), or Dimension::Points(2.1))

source§

impl<T: FromPoints> Point<T>

source

pub fn points<Input: Into<f32> + Copy>(points_value: Input) -> Self

Returns a Point where both the x and y values are the constant points value of the contained type (e.g. 2.1, Some(2.1), or Dimension::Points(2.1))

source§

impl<T: FromPercent> Point<T>

source

pub fn percent<Input: Into<f32> + Copy>(percent_value: Input) -> Self

Returns a Point where both the x and y values are the constant percent value of the contained type (e.g. 2.1, Some(2.1), or Dimension::Points(2.1))

Trait Implementations§

source§

impl<T: Clone> Clone for Point<T>

source§

fn clone(&self) -> Point<T>

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

source§

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

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

impl<T: FromPercent> FromPercent for Point<T>

source§

fn from_percent<Input: Into<f32> + Copy>(percent: Input) -> Self

Converts into an Into<f32> into Self
source§

impl<T: FromPoints> FromPoints for Point<T>

source§

fn from_points<Input: Into<f32> + Copy>(points: Input) -> Self

Converts into an Into<f32> into Self
source§

impl<T: PartialEq> PartialEq for Point<T>

source§

fn eq(&self, other: &Point<T>) -> 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: TaffyAuto> TaffyAuto for Point<T>

source§

const AUTO: Point<T> = _

The auto value for type implementing TaffyZero
source§

impl<T: TaffyFitContent> TaffyFitContent for Point<T>

source§

fn fit_content(argument: LengthPercentage) -> Self

Converts into a LengthPercentage into Self
source§

impl<T: TaffyMaxContent> TaffyMaxContent for Point<T>

source§

const MAX_CONTENT: Point<T> = _

The max_content value for type implementing TaffyZero
source§

impl<T: TaffyMinContent> TaffyMinContent for Point<T>

source§

const MIN_CONTENT: Point<T> = _

The min_content value for type implementing TaffyZero
source§

impl<T: TaffyZero> TaffyZero for Point<T>

source§

const ZERO: Point<T> = _

The zero value for type implementing TaffyZero
source§

impl<T: Copy> Copy for Point<T>

source§

impl<T: Eq> Eq for Point<T>

source§

impl<T> StructuralEq for Point<T>

source§

impl<T> StructuralPartialEq for Point<T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for Point<T>
where T: 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> 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.