pub(crate) trait EditDistance {
// Required method
fn edit_distance(&self, other: &Self) -> usize;
}Expand description
Trait for calculating edit distance between two types.
Required Methods§
Sourcefn edit_distance(&self, other: &Self) -> usize
fn edit_distance(&self, other: &Self) -> usize
Calculate edit distance between self and other.
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 EditDistance for &str
impl EditDistance for &str
Source§fn edit_distance(&self, other: &Self) -> usize
fn edit_distance(&self, other: &Self) -> usize
Calculate edit distance between self and other.
Delegates to the byte slice implementation.
Source§impl EditDistance for &[u8]
impl EditDistance for &[u8]
Source§fn edit_distance(&self, other: &Self) -> usize
fn edit_distance(&self, other: &Self) -> usize
Calculate edit distance between self and other using the Levenshtein distance algorithm.
Source§impl EditDistance for String
impl EditDistance for String
Source§fn edit_distance(&self, other: &Self) -> usize
fn edit_distance(&self, other: &Self) -> usize
Calculate edit distance between self and other.
Delegates to the byte slice implementation.