devela::all

Type Alias Point2d

Source
pub type Point2d<T> = Point<T, 2>;
Available on crate feature geom only.
Expand description

A specific position in 2d-space without a size.

Aliased Type§

struct Point2d<T> {
    pub coords: [T; 2],
}

Fields§

§coords: [T; 2]

The D-dimensional coordinates.

Implementations§

Source§

impl<T> Point2d<T>

Source

pub const fn x(self) -> T
where T: Copy,

Returns a copy of the first dimension x.

Source

pub const fn y(self) -> T
where T: Copy,

Returns a copy of the second dimension y.

Source

pub const fn x_ref(&self) -> &T

Returns a shared reference to the first dimension x.

Source

pub const fn y_ref(&self) -> &T

Returns a shared reference to the second dimension y.

Source

pub fn x_mut(&mut self) -> &mut T

Returns an exclusive reference to the first dimension x.

Source

pub fn y_mut(&mut self) -> &mut T

Returns an exclusive reference to the second dimension y.