[][src]Struct rspell::LangProvider

pub struct LangProvider<'a> { /* fields omitted */ }

A structure to ensure that the data files for the given language are available.

It can look for files on the disk or download directly from internet when possible.

Methods

impl<'_> LangProvider<'_>[src]

pub fn new<'a>(lang: &'a str, config: &'a Config) -> LangProvider<'a>[src]

Creates a new LanguageProvider for the given language and configuration.

The configuration can be loaded using load_config().

pub fn aff(&self) -> &Path[src]

Location of the .aff dictionary.

pub fn aff_on_disk(&self) -> Vec<PathBuf>[src]

Search for corresponding .aff dictionaries on the disk.

pub fn dic(&self) -> &Path[src]

Location of the .dic dictionary.

pub fn dic_on_disk(&self) -> Vec<PathBuf>[src]

Search for corresponding .dic dictionaries on the disk.

pub fn ensure_data(&self) -> Result<(), SpellError>[src]

Ensures that the dictionaries are present in the dictionaries directory.

If one of the dictionaries is absent it will be fetched from the disk or directly from internet when possible.

pub fn remove_data(&self) -> Result<(), SpellError>[src]

Removes the dictionaries from the dictionaries directory.

Trait Implementations

impl<'_> Into<Hunspell> for LangProvider<'_>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for LangProvider<'a>

impl<'a> Send for LangProvider<'a>

impl<'a> Sync for LangProvider<'a>

impl<'a> Unpin for LangProvider<'a>

impl<'a> UnwindSafe for LangProvider<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.