Trait harper_core::Dictionary

source ·
pub trait Dictionary: Clone {
    // Required methods
    fn contains_word(&self, word: &[char]) -> bool;
    fn contains_word_str(&self, word: &str) -> bool;
    fn words_iter(&self) -> impl Iterator<Item = &[char]>;
    fn words_with_len_iter(
        &self,
        len: usize,
    ) -> Box<dyn Iterator<Item = &[char]> + '_>;
    fn get_word_metadata(&self, word: &[char]) -> WordMetadata;
    fn get_word_metadata_str(&self, word: &str) -> WordMetadata;
}

Required Methods§

source

fn contains_word(&self, word: &[char]) -> bool

Check if the dictionary contains a given word.

source

fn contains_word_str(&self, word: &str) -> bool

Check if the dictionary contains a given word.

source

fn words_iter(&self) -> impl Iterator<Item = &[char]>

Produce an iterator over all words in the dictionary.

source

fn words_with_len_iter( &self, len: usize, ) -> Box<dyn Iterator<Item = &[char]> + '_>

Iterate over all the words in the dictionary of a given length

source

fn get_word_metadata(&self, word: &[char]) -> WordMetadata

Get the associated WordMetadata for a given word. If the word isn’t in the dictionary, the resulting metadata will be empty.

source

fn get_word_metadata_str(&self, word: &str) -> WordMetadata

Get the associated WordMetadata for a given word. If the word isn’t in the dictionary, the resulting metadata will be empty.

Object Safety§

This trait is not object safe.

Implementors§