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 top-left corner.
Fields§
§x: TThe x-coordinate
y: TThe y-coordinate
Implementations§
Source§impl<T> Point<T>
impl<T> Point<T>
Sourcepub fn map<R, F>(self, f: F) -> Point<R>where
F: Fn(T) -> R,
pub fn map<R, F>(self, f: F) -> Point<R>where
F: Fn(T) -> R,
Applies the function f to both the x and y
This is used to transform a Point<T> into a Point<R>.
Sourcepub fn get(self, axis: AbstractAxis) -> T
pub fn get(self, axis: AbstractAxis) -> T
Gets the extent of the specified layout axis
Whether this is the width or height depends on the GridAxis provided
Sourcepub fn set(&mut self, axis: AbstractAxis, value: T)
pub fn set(&mut self, axis: AbstractAxis, value: T)
Sets the extent of the specified layout axis
Whether this is the width or height depends on the GridAxis provided
Source§impl<T> Point<T>where
T: TaffyMinContent,
impl<T> Point<T>where
T: TaffyMinContent,
Sourcepub const fn min_content() -> Point<T>
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,
impl<T> Point<T>where
T: TaffyMaxContent,
Sourcepub const fn max_content() -> Point<T>
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,
impl<T> Point<T>where
T: TaffyFitContent,
Sourcepub fn fit_content(argument: LengthPercentage) -> Point<T>
pub fn fit_content(argument: LengthPercentage) -> Point<T>
Returns a Point with x and y set to the same fit-content(…) value
with the given argument.
Source§impl<T> Point<T>where
T: FromLength,
impl<T> Point<T>where
T: FromLength,
Trait Implementations§
Source§impl<T> FromLength for Point<T>where
T: FromLength,
impl<T> FromLength for Point<T>where
T: FromLength,
Source§impl<T> FromPercent for Point<T>where
T: FromPercent,
impl<T> FromPercent for Point<T>where
T: FromPercent,
Source§impl<T> TaffyFitContent for Point<T>where
T: TaffyFitContent,
impl<T> TaffyFitContent for Point<T>where
T: TaffyFitContent,
Source§fn fit_content(argument: LengthPercentage) -> Point<T>
fn fit_content(argument: LengthPercentage) -> Point<T>
Source§impl<T> TaffyMaxContent for Point<T>where
T: TaffyMaxContent,
impl<T> TaffyMaxContent for Point<T>where
T: TaffyMaxContent,
Source§const MAX_CONTENT: Point<T>
const MAX_CONTENT: Point<T>
Source§impl<T> TaffyMinContent for Point<T>where
T: TaffyMinContent,
impl<T> TaffyMinContent for Point<T>where
T: TaffyMinContent,
Source§const MIN_CONTENT: Point<T>
const MIN_CONTENT: Point<T>
impl<T> Copy for Point<T>where
T: Copy,
impl<T> Eq for Point<T>where
T: Eq,
impl<T> StructuralPartialEq for Point<T>
Auto Trait Implementations§
impl<T> Freeze for Point<T>where
T: Freeze,
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> UnsafeUnpin for Point<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Point<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().