pub trait Point:
Add<Self, Output = Self>
+ Sub<Self, Output = Self>
+ Mul<Self::Scalar, Output = Self>
+ Mul<f64, Output = Self>
+ Copy
+ PartialEq
+ Default
+ IntoIterator {
type Scalar: Float + Default + PartialEq + From<f64> + Into<f64> + Add<f64, Output = Self::Scalar> + Sub<f64, Output = Self::Scalar> + Mul<f64, Output = Self::Scalar> + Div<f64, Output = Self::Scalar> + Sum<f64>;
const DIM: usize;
// Required methods
fn axis(&self, index: usize) -> Self::Scalar;
fn squared_length(&self) -> Self::Scalar;
}Expand description
The Point trait is the only interface on which the library relies. The associated constant DIM is necessary so that the memory layout of its implementing type can be made known to the library, whenever new instances are returned.
Required Associated Constants§
Required Associated Types§
type Scalar: Float + Default + PartialEq + From<f64> + Into<f64> + Add<f64, Output = Self::Scalar> + Sub<f64, Output = Self::Scalar> + Mul<f64, Output = Self::Scalar> + Div<f64, Output = Self::Scalar> + Sum<f64>
Required Methods§
Sourcefn axis(&self, index: usize) -> Self::Scalar
fn axis(&self, index: usize) -> Self::Scalar
Panics if index is greater than implementors dimension
fn squared_length(&self) -> Self::Scalar
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.