Trait DistFn

Source
pub trait DistFn<T> {
    // Required method
    fn dist(&self, left: &T, right: &T) -> u64;
}
Expand description

Describes a type which can act as a distance-function for T.

Implemented for Fn(&T, &T) -> u64.

Default implementations are provided for common numeric types.

Required Methods§

Source

fn dist(&self, left: &T, right: &T) -> u64

Return the distance between left and right.

§Note

It is a logic error for this method to return different values for the same operands, regardless of order (i.e. it is required to be idempotent and commutative).

Implementors§