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§
Implementors§
impl DistFn<f32> for FloatDist
impl DistFn<f32> for ScaledFloatDist<f32>
impl DistFn<f64> for FloatDist
impl DistFn<f64> for ScaledFloatDist<f64>
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<String> for DamerauLevenshtein
impl DistFn<String> for Hamming
impl DistFn<String> for Jaro
impl DistFn<String> for JaroWinkler
impl DistFn<String> for Levenshtein
impl<'a> DistFn<&'a str> for DamerauLevenshtein
impl<'a> DistFn<&'a str> for Hamming
impl<'a> DistFn<&'a str> for Jaro
impl<'a> DistFn<&'a str> for JaroWinkler
impl<'a> DistFn<&'a str> for Levenshtein
impl<T, F> DistFn<T> for F
Simply calls (self)(left, right)