pub trait Point: Clone {
type Coord: Num + Copy + PartialOrd;
const DIM: usize;
// Required methods
fn coord(&self, axis: usize) -> Self::Coord;
fn build<F>(f: F) -> Self
where F: FnMut(usize) -> Self::Coord;
// Provided methods
fn min(&self, other: &Self) -> Self { ... }
fn max(&self, other: &Self) -> Self { ... }
}
Expand description
Defines a finite-dimensional space in terms of coordinate values along a chosen set of axes
Required Associated Types§
sourcetype Coord: Num + Copy + PartialOrd
type Coord: Num + Copy + PartialOrd
The type of the coordinate values
Required Associated Constants§
Required Methods§
Provided Methods§
sourcefn min(&self, other: &Self) -> Self
fn min(&self, other: &Self) -> Self
Computes the point which has the minimum coordinate values of self
and other
along each axis
The default implementation is based on build
and PartialOrd
and assumes that coordinate values are finite.
sourcefn max(&self, other: &Self) -> Self
fn max(&self, other: &Self) -> Self
Computes the point which has the maximum coordinate values of self
and other
along each axis
The default implementation is based on build
and PartialOrd
and assumes that coordinate values are finite.
Object Safety§
This trait is not object safe.