pub struct MatchOptions {
pub case_sensitive: bool,
pub diacritic_sensitive: bool,
pub whole_word: bool,
pub locale: FoldLocale,
}Expand description
How to match.
Fields§
§case_sensitive: boolfalse (the default) folds case — which is why the index map is not optional.
diacritic_sensitive: boolfalse (the default) folds diacritics, ligatures and Arabic orthography, so that
aurelien finds Aurélien and احمد finds أَحْمَد.
whole_word: boolOnly match when the occurrence begins and ends on a word boundary.
locale: FoldLocaleThe language of the text being searched — per scene, not per search. One pass can fold a French chapter and a Turkish one under different rules; the user’s toggles above stay global, and the language only decides what folding means.
Implementations§
Source§impl MatchOptions
impl MatchOptions
Sourcepub fn fold_spec(&self) -> FoldSpec
pub fn fold_spec(&self) -> FoldSpec
The subset of these options that decides how text folds.
whole_word is deliberately not part of it: it decides which matches survive, not
how a single character folds. Keeping that distinction in the types is what lets
FoldedText answer both kinds of query from one fold — so a host app caching the
fold of a whole manuscript does not throw it away when the writer ticks a checkbox.
Trait Implementations§
Source§impl Clone for MatchOptions
impl Clone for MatchOptions
Source§fn clone(&self) -> MatchOptions
fn clone(&self) -> MatchOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more