Trait vec_vp_tree::dist::DistFn
[−]
[src]
pub trait DistFn<T> { fn dist(&self, left: &T, right: &T) -> u64; }
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
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
impl DistFn<i8> for SignedDist
impl DistFn<i16> for SignedDist
impl DistFn<i32> for SignedDist
impl DistFn<i64> for SignedDist
impl DistFn<isize> for SignedDist
impl DistFn<u8> for UnsignedDist
impl DistFn<u16> for UnsignedDist
impl DistFn<u32> for UnsignedDist
impl DistFn<u64> for UnsignedDist
impl DistFn<usize> for UnsignedDist
impl DistFn<f32> for FloatDist
impl DistFn<f32> for ScaledFloatDist<f32>
impl DistFn<f64> for FloatDist
impl DistFn<f64> for ScaledFloatDist<f64>
impl<'a> DistFn<&'a str> for Hamming
impl DistFn<String> for Hamming
impl<'a> DistFn<&'a str> for Levenshtein
impl DistFn<String> for Levenshtein
impl<'a> DistFn<&'a str> for DamerauLevenshtein
impl DistFn<String> for DamerauLevenshtein
impl<'a> DistFn<&'a str> for Jaro
impl DistFn<String> for Jaro
impl<'a> DistFn<&'a str> for JaroWinkler
impl DistFn<String> for JaroWinkler
impl<T, F> DistFn<T> for F where F: Fn(&T, &T) -> u64