MetricSpace

Trait MetricSpace 

Source
pub trait MetricSpace<S>: Sized {
    // Required method
    fn distance_squared(self, other: Self) -> S;

    // Provided method
    fn distance(self, other: Self) -> S
       where S: Sqrt { ... }
}
Expand description

Set of points with distance function

Required Methods§

Source

fn distance_squared(self, other: Self) -> S

Provided Methods§

Source

fn distance(self, other: Self) -> S
where S: Sqrt,

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.

Implementors§

Source§

impl<V, S> MetricSpace<S> for V
where V: NormedVectorSpace<S>, S: Field,