pub struct LangProvider<'a> { /* private fields */ }Expand description
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.
Implementations§
Source§impl LangProvider<'_>
impl LangProvider<'_>
Sourcepub fn new<'a>(lang: &'a str, config: &'a Config) -> LangProvider<'a>
pub fn new<'a>(lang: &'a str, config: &'a Config) -> LangProvider<'a>
Creates a new LanguageProvider for the given language and configuration.
The configuration can be loaded using load_config().
Sourcepub fn aff_on_disk(&self) -> Vec<PathBuf>
pub fn aff_on_disk(&self) -> Vec<PathBuf>
Search for corresponding .aff dictionaries on the disk.
Sourcepub fn dic_on_disk(&self) -> Vec<PathBuf>
pub fn dic_on_disk(&self) -> Vec<PathBuf>
Search for corresponding .dic dictionaries on the disk.
Sourcepub fn ensure_data(&self) -> Result<(), SpellError>
pub fn ensure_data(&self) -> Result<(), SpellError>
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.
Sourcepub fn remove_data(&self) -> Result<(), SpellError>
pub fn remove_data(&self) -> Result<(), SpellError>
Removes the dictionaries from the dictionaries directory.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for LangProvider<'a>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more