pub trait SpellChecker {
// Required methods
fn misspelled_words(&self, text: &str, cx: &App) -> Vec<Range<usize>>;
fn guesses(&self, word: &str, cx: &App) -> Vec<SharedString>;
fn learn(&self, word: &str, cx: &mut App);
}Expand description
What tells an input’s words spelled right from wrong: the platform’s spell checker, a dictionary the app ships, or anything else that can.
Give one to an input with InputBaseState::spell_checker. An input
without one checks nothing.
Required Methods§
Sourcefn misspelled_words(&self, text: &str, cx: &App) -> Vec<Range<usize>>
fn misspelled_words(&self, text: &str, cx: &App) -> Vec<Range<usize>>
The UTF-8 byte ranges of the words in text that are misspelled, in
order.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".