Trait SymbolIter

Source
pub trait SymbolIter {
    type Item: Eq;
    type Iter<'a>: Iterator<Item = Self::Item>
       where Self: 'a;

    // Required methods
    fn symbol_count(&self) -> usize;
    fn symbol_iter(&self) -> Self::Iter<'_>;
}
Expand description

helper trait for computing edit distances by iteration

Required Associated Types§

Source

type Item: Eq

the item type

Source

type Iter<'a>: Iterator<Item = Self::Item> where Self: 'a

the iterator type

Required Methods§

Source

fn symbol_count(&self) -> usize

returns the length of the sequence

Source

fn symbol_iter(&self) -> Self::Iter<'_>

returns an iterator for comparing characters for an edit distance. Since the computation may require multiple iterations, the returned iterator shouldn’t change length or sequence without self being mutated

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 SymbolIter for str

Source§

type Item = char

Source§

type Iter<'a> = Chars<'a> where Self: 'a

Source§

fn symbol_count(&self) -> usize

Source§

fn symbol_iter(&self) -> Self::Iter<'_>

Source§

impl SymbolIter for String

Source§

type Item = char

Source§

type Iter<'a> = Chars<'a> where Self: 'a

Source§

fn symbol_count(&self) -> usize

Source§

fn symbol_iter(&self) -> Self::Iter<'_>

Source§

impl<E: Copy + Eq> SymbolIter for [E]

Source§

type Item = E

Source§

type Iter<'a> = Copied<Iter<'a, E>> where Self: 'a

Source§

fn symbol_count(&self) -> usize

Source§

fn symbol_iter(&self) -> Self::Iter<'_>

Source§

impl<E: Copy + Eq> SymbolIter for Vec<E>

Source§

type Item = E

Source§

type Iter<'a> = Copied<Iter<'a, E>> where Self: 'a

Source§

fn symbol_count(&self) -> usize

Source§

fn symbol_iter(&self) -> Self::Iter<'_>

Source§

impl<E: Copy + Eq, const N: usize> SymbolIter for [E; N]

Source§

type Item = E

Source§

type Iter<'a> = Copied<Iter<'a, E>> where Self: 'a

Source§

fn symbol_count(&self) -> usize

Source§

fn symbol_iter(&self) -> Self::Iter<'_>

Source§

impl<T: ?Sized + SymbolIter> SymbolIter for &T

Source§

type Item = <T as SymbolIter>::Item

Source§

type Iter<'a> = <T as SymbolIter>::Iter<'a> where Self: 'a

Source§

fn symbol_count(&self) -> usize

Source§

fn symbol_iter(&self) -> Self::Iter<'_>

Implementors§