pub struct CaseMap<'data> {
pub trie: CodePointTrie<'data, CaseMapData>,
pub exceptions: CaseMapExceptions<'data>,
}Expand description
This type contains all of the casemapping data
The methods in the provider module are primarily about accessing its data,
however the full algorithms are also implemented as methods on this type in
the internals module of this crate.
Fieldsยง
ยงtrie: CodePointTrie<'data, CaseMapData>Case mapping data
exceptions: CaseMapExceptions<'data>Exceptions to the case mapping data
Implementationsยง
Sourceยงimpl CaseMap<'_>
impl CaseMap<'_>
pub(crate) fn lookup_data(&self, c: char) -> CaseMapData
Sourceยงimpl<'data> CaseMap<'data>
impl<'data> CaseMap<'data>
const I_DOT: &'static str = "\u{69}\u{307}"
const J_DOT: &'static str = "\u{6a}\u{307}"
const I_OGONEK_DOT: &'static str = "\u{12f}\u{307}"
const I_DOT_GRAVE: &'static str = "\u{69}\u{307}\u{300}"
const I_DOT_ACUTE: &'static str = "\u{69}\u{307}\u{301}"
const I_DOT_TILDE: &'static str = "\u{69}\u{307}\u{303}"
fn simple_helper(&self, c: char, kind: MappingKind) -> char
pub(crate) fn simple_lower(&self, c: char) -> char
pub(crate) fn simple_upper(&self, c: char) -> char
pub(crate) fn simple_title(&self, c: char) -> char
pub(crate) fn simple_fold(&self, c: char, options: FoldOptions) -> char
fn dot_type(&self, c: char) -> DotType
fn is_case_sensitive(&self, c: char) -> bool
fn full_helper<const IS_TITLE_CONTEXT: bool, W: Write + ?Sized>( &self, c: char, context: ContextIterator<'_>, locale: CaseMapLocale, kind: MappingKind, sink: &mut W, ) -> Result
fn simple_fold_special_case(&self, c: char, options: FoldOptions) -> char
fn full_lower_special_case<const IS_TITLE_CONTEXT: bool>( &self, c: char, context: ContextIterator<'_>, locale: CaseMapLocale, ) -> Option<FullMappingResult<'_>>
fn full_upper_or_title_special_case<const IS_TITLE_CONTEXT: bool>( &self, c: char, context: ContextIterator<'_>, locale: CaseMapLocale, ) -> Option<FullMappingResult<'_>>
fn full_fold_special_case( &self, c: char, _context: ContextIterator<'_>, locale: CaseMapLocale, ) -> Option<FullMappingResult<'_>>
Sourcepub(crate) fn full_helper_writeable<'a: 'data, const IS_TITLE_CONTEXT: bool>(
&'data self,
src: &'a str,
locale: CaseMapLocale,
mapping: MappingKind,
titlecase_tail_casing: TrailingCase,
) -> FullCaseWriteable<'a, 'data, IS_TITLE_CONTEXT>
pub(crate) fn full_helper_writeable<'a: 'data, const IS_TITLE_CONTEXT: bool>( &'data self, src: &'a str, locale: CaseMapLocale, mapping: MappingKind, titlecase_tail_casing: TrailingCase, ) -> FullCaseWriteable<'a, 'data, IS_TITLE_CONTEXT>
IS_TITLE_CONTEXT is true iff the mapping is MappingKind::Title, primarily exists to avoid perf impacts on other more common modes of operation
titlecase_tail_casing is only read in IS_TITLE_CONTEXT
Sourcepub(crate) fn add_case_closure_to<S: ClosureSink>(&self, c: char, set: &mut S)
pub(crate) fn add_case_closure_to<S: ClosureSink>(&self, c: char, set: &mut S)
Adds all simple case mappings and the full case folding for c to set.
Also adds special case closure mappings.
The character itself is not added.
For example, the mappings
- for s include long s
- for sharp s include ss
- for k include the Kelvin sign
Sourcepub(crate) fn add_string_case_closure_to<S: ClosureSink>(
&self,
s: &str,
set: &mut S,
unfold_data: &CaseMapUnfold<'_>,
) -> bool
pub(crate) fn add_string_case_closure_to<S: ClosureSink>( &self, s: &str, set: &mut S, unfold_data: &CaseMapUnfold<'_>, ) -> bool
Maps the string to single code points and adds the associated case closure mappings.
(see docs on CaseMapper::add_string_case_closure_to)
Trait Implementationsยง
Sourceยงimpl MaybeAsVarULE for CaseMap<'_>
impl MaybeAsVarULE for CaseMap<'_>
Sourceยงimpl<'data> PartialEq for CaseMap<'data>
impl<'data> PartialEq for CaseMap<'data>
Sourceยงimpl<'yoke> Yokeable<'yoke> for CaseMap<'static>
impl<'yoke> Yokeable<'yoke> for CaseMap<'static>
Sourceยงtype Output = CaseMap<'yoke>
type Output = CaseMap<'yoke>
Self with the 'static replaced with 'a, i.e. Self<'a>