Struct plasmo::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: Point<f32> = _

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

source§

impl Point<Option<f32>>

source

pub const NONE: Point<Option<f32>> = _

A Point with values (None, None)

source§

impl<T> Point<T>
where T: TaffyZero,

source

pub const fn zero() -> Point<T>

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> Point<T>
where T: TaffyAuto,

source

pub const fn auto() -> Point<T>

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> Point<T>
where T: TaffyMinContent,

source

pub const fn min_content() -> Point<T>

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> Point<T>
where T: TaffyMaxContent,

source

pub const fn max_content() -> Point<T>

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> Point<T>
where T: TaffyFitContent,

source

pub fn fit_content(argument: LengthPercentage) -> Point<T>

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> Point<T>
where T: FromPoints,

source

pub fn points<Input>(points_value: Input) -> Point<T>
where Input: Into<f32> + Copy,

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> Point<T>
where T: FromPercent,

source

pub fn percent<Input>(percent_value: Input) -> Point<T>
where Input: Into<f32> + Copy,

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

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

source§

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

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

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

source§

fn from_percent<Input>(percent: Input) -> Point<T>
where Input: Into<f32> + Copy,

Converts into an Into<f32> into Self
source§

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

source§

fn from_points<Input>(points: Input) -> Point<T>
where Input: Into<f32> + Copy,

Converts into an Into<f32> into Self
source§

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

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 for Point<T>
where T: TaffyAuto,

source§

const AUTO: Point<T> = _

The auto value for type implementing TaffyZero
source§

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

source§

fn fit_content(argument: LengthPercentage) -> Point<T>

Converts into a LengthPercentage into Self
source§

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

source§

const MAX_CONTENT: Point<T> = _

The max_content value for type implementing TaffyZero
source§

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

source§

const MIN_CONTENT: Point<T> = _

The min_content value for type implementing TaffyZero
source§

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

source§

const ZERO: Point<T> = _

The zero value for type implementing TaffyZero
source§

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

source§

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

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
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
§

impl<Q, K> Equivalent<K> for Q
where 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
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

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

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

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

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
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> WithSubscriber for T

source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> CloneAny for T
where T: Any + Clone,