pub trait MetricSpace: Sized {
type Metric: BaseFloat;
// Required method
fn distance2(self, other: Self) -> Self::Metric;
// Provided method
fn distance(self, other: Self) -> Self::Metric { ... }
}
Expand description
A type with a distance function between values.
Examples are vectors, points, and quaternions.
Required Associated Types§
Required Methods§
Provided Methods§
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.