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: TaffyMinContent> Point<T>
impl<T: TaffyMinContent> Point<T>
sourcepub const fn min_content() -> Self
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>
impl<T: TaffyMaxContent> Point<T>
sourcepub const fn max_content() -> Self
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>
impl<T: TaffyFitContent> Point<T>
sourcepub fn fit_content(argument: LengthPercentage) -> Self
pub fn fit_content(argument: LengthPercentage) -> Self
Returns a Point with x and y set to the same fit-content(…) value
with the given argument.