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§
sourcefn contains_word(&self, word: &[char]) -> bool
fn contains_word(&self, word: &[char]) -> bool
Check if the dictionary contains a given word.
sourcefn contains_word_str(&self, word: &str) -> bool
fn contains_word_str(&self, word: &str) -> bool
Check if the dictionary contains a given word.
sourcefn words_iter(&self) -> impl Iterator<Item = &[char]>
fn words_iter(&self) -> impl Iterator<Item = &[char]>
Produce an iterator over all words in the dictionary.
sourcefn words_with_len_iter(
&self,
len: usize,
) -> Box<dyn Iterator<Item = &[char]> + '_>
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
sourcefn get_word_metadata(&self, word: &[char]) -> WordMetadata
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.
sourcefn get_word_metadata_str(&self, word: &str) -> WordMetadata
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.