Struct icu_casemap::provider::CaseMapV1
source ยท pub struct CaseMapV1<'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<'data> CaseMapV1<'data>
impl<'data> CaseMapV1<'data>
pub(crate) fn lookup_data(&self, c: char) -> CaseMapData
sourceยงimpl<'data> CaseMapV1<'data>
impl<'data> CaseMapV1<'data>
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
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_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>(
&'a self,
src: &'a str,
locale: CaseMapLocale,
mapping: MappingKind,
titlecase_tail_casing: TrailingCase,
) -> FullCaseWriteable<'a, IS_TITLE_CONTEXT>
pub(crate) fn full_helper_writeable<'a: 'data, const IS_TITLE_CONTEXT: bool>( &'a self, src: &'a str, locale: CaseMapLocale, mapping: MappingKind, titlecase_tail_casing: TrailingCase, ) -> FullCaseWriteable<'a, 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: &CaseMapUnfoldV1<'_>,
) -> bool
pub(crate) fn add_string_case_closure_to<S: ClosureSink>( &self, s: &str, set: &mut S, unfold_data: &CaseMapUnfoldV1<'_>, ) -> 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<'data> PartialEq for CaseMapV1<'data>
impl<'data> PartialEq for CaseMapV1<'data>
sourceยงimpl<'a> Yokeable<'a> for CaseMapV1<'static>
impl<'a> Yokeable<'a> for CaseMapV1<'static>
ยงtype Output = CaseMapV1<'a>
type Output = CaseMapV1<'a>
Self
with the 'static
replaced with 'a
, i.e. Self<'a>