pub struct HYPHENATION;Expand description
Hyphenation service.
Note that dictionary data is required to support a language, if the feature "hyphenation_embed_all" is enabled
dictionaries for all supported languages is embedded, otherwise dictionaries must be loaded using a HyphenationDataSource.
You can use the HyphenationDataDir to use external files, see the hyphenation
for more details about the data files.
Implementations§
Source§impl HYPHENATION
impl HYPHENATION
Sourcepub fn init_data_source(&self, source: impl HyphenationDataSource)
pub fn init_data_source(&self, source: impl HyphenationDataSource)
Set the hyphenation dictionaries source and clear cache.
Note that this applies immediately and does not notify, it should only be called once during app init.
Sourcepub fn hyphenate(&self, lang: &Lang, word: &str) -> Vec<usize>
pub fn hyphenate(&self, lang: &Lang, word: &str) -> Vec<usize>
Try to hyphenate the word using the lang dictionary and rules.
Returns a vector of indexes that allow a line break.
Sourcepub fn hyphenate_opt(&self, lang: &Lang, word: &str) -> Option<Vec<usize>>
pub fn hyphenate_opt(&self, lang: &Lang, word: &str) -> Option<Vec<usize>>
Try to hyphenate the word using the lang dictionary and rules.
Returns a vector of indexes that allow a line break. Returns None if the lang is not supported or the
word contains non-word characters.
Sourcepub fn lang_to_hyphenation_language(&self, lang: &Lang) -> Option<Language>
pub fn lang_to_hyphenation_language(&self, lang: &Lang) -> Option<Language>
Get the best hyphenation::Language for the lang.
Auto Trait Implementations§
impl Freeze for HYPHENATION
impl RefUnwindSafe for HYPHENATION
impl Send for HYPHENATION
impl Sync for HYPHENATION
impl Unpin for HYPHENATION
impl UnwindSafe for HYPHENATION
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more