Skip to main content

CorrectionProvider

Trait CorrectionProvider 

Source
pub trait CorrectionProvider: Send + Sync {
    // Required method
    fn check<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        text: &'life1 str,
        ctx: &'life2 Context,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Correction>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

A spelling/typo correction backend.

Required Methods§

Source

fn check<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, text: &'life1 str, ctx: &'life2 Context, ) -> Pin<Box<dyn Future<Output = Result<Vec<Correction>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Check text and return the corrections this provider would make.

ctx carries the focused-application id and the text’s locale, which contextual providers may use.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§