Skip to main content

Distance

Trait Distance 

Source
pub trait Distance {
    // Required method
    fn distance(&self, other: &Self) -> u64;
}
Expand description

This trait used by BKTree to tell how close are 2 objects when fuzzy searching. In case of strings, the distance function could be something like Levenshtein distance, Damerau–Levenshtein distance, Optimal string alignment distance or anything similar.

Required Methods§

Source

fn distance(&self, other: &Self) -> u64

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.

Implementations on Foreign Types§

Source§

impl Distance for String

Source§

fn distance(&self, other: &Self) -> u64

Implementors§