Struct icu::casemapping::provider::CaseMappingExceptions
source · [−]pub struct CaseMappingExceptions<'data> {
pub slots: ZeroVec<'data, u16>,
pub strings: VarZeroVec<'data, str, Index16>,
}
Expand description
This represents case mapping exceptions that can’t be represented as a delta applied to the original code point. Similar to ICU4C, data is stored as a u16 array. The codepoint trie in CaseMapping stores offsets into this array. The u16 at that index contains a set of flags describing the subsequent data.
[idx + 0] Header word: Bits: 0..7 Flag bits indicating which optional slots are present (if any): 0: Lowercase mapping (code point) 1: Case folding (code point) 2: Uppercase mapping (code point) 3: Titlecase mapping (code point) 4: Delta to simple case mapping (code point) (sign stored separately) 5: RESERVED 6: Closure mappings (string; see below) 7: Full mappings (strings; see below) 8 Double-width slots. If set, then each optional slot is stored as two elements of the array (high and low halves of 32-bit values) instead of a single element. 9 Has no simple case folding, even if there is a simple lowercase mapping 10 The value in the delta slot is negative 11 Is case-sensitive (not exposed) 12..13 Dot type 14 Has conditional special casing 15 Has conditional case folding
If double-width slots is false:
[idx + 1] First optional slot [idx + 2] Second optional slot [idx + 3] Third optional slot …
If double-width slots is true:
[idx + 1] First optional slot [idx + 3] Second optional slot [idx + 5] Third optional slot …
In ICU4C, the full mapping and closure strings are stored inline in the data, encoded as UTF-16, and the full mapping and closure slots contain information about the length of those strings. To avoid the need for allocations when converting from UTF-16 to UTF-8, we instead store strings encoded as UTF-8 in a side table. The full mapping and closure slots contain indices into that side table.
Fields
slots: ZeroVec<'data, u16>
strings: VarZeroVec<'data, str, Index16>
Trait Implementations
sourceimpl<'data> Bake for CaseMappingExceptions<'data>
impl<'data> Bake for CaseMappingExceptions<'data>
sourcefn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
Returns a TokenStream
that would evaluate to self
. Read more
sourceimpl<'data> Clone for CaseMappingExceptions<'data>
impl<'data> Clone for CaseMappingExceptions<'data>
sourcefn clone(&self) -> CaseMappingExceptions<'data>
fn clone(&self) -> CaseMappingExceptions<'data>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'data> Debug for CaseMappingExceptions<'data>
impl<'data> Debug for CaseMappingExceptions<'data>
sourceimpl<'de, 'data> Deserialize<'de> for CaseMappingExceptions<'data> where
'de: 'data,
impl<'de, 'data> Deserialize<'de> for CaseMappingExceptions<'data> where
'de: 'data,
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<CaseMappingExceptions<'data>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<CaseMappingExceptions<'data>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'data> PartialEq<CaseMappingExceptions<'data>> for CaseMappingExceptions<'data>
impl<'data> PartialEq<CaseMappingExceptions<'data>> for CaseMappingExceptions<'data>
sourcefn eq(&self, other: &CaseMappingExceptions<'data>) -> bool
fn eq(&self, other: &CaseMappingExceptions<'data>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CaseMappingExceptions<'data>) -> bool
fn ne(&self, other: &CaseMappingExceptions<'data>) -> bool
This method tests for !=
.
sourceimpl<'data> Serialize for CaseMappingExceptions<'data>
impl<'data> Serialize for CaseMappingExceptions<'data>
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
sourceimpl<'a> Yokeable<'a> for CaseMappingExceptions<'static>
impl<'a> Yokeable<'a> for CaseMappingExceptions<'static>
type Output = CaseMappingExceptions<'a>
type Output = CaseMappingExceptions<'a>
This type MUST be Self
with the 'static
replaced with 'a
, i.e. Self<'a>
sourcefn transform(
&'a self
) -> &'a <CaseMappingExceptions<'static> as Yokeable<'a>>::Output
fn transform(
&'a self
) -> &'a <CaseMappingExceptions<'static> as Yokeable<'a>>::Output
This method must cast self
between &'a Self<'static>
and &'a Self<'a>
. Read more
sourcefn transform_owned(
self
) -> <CaseMappingExceptions<'static> as Yokeable<'a>>::Output
fn transform_owned(
self
) -> <CaseMappingExceptions<'static> as Yokeable<'a>>::Output
This method must cast self
between Self<'static>
and Self<'a>
. Read more
sourceunsafe fn make(
this: <CaseMappingExceptions<'static> as Yokeable<'a>>::Output
) -> CaseMappingExceptions<'static>
unsafe fn make(
this: <CaseMappingExceptions<'static> as Yokeable<'a>>::Output
) -> CaseMappingExceptions<'static>
This method can be used to cast away Self<'a>
’s lifetime. Read more
sourcefn transform_mut<F>(&'a mut self, f: F) where
F: 'static + for<'b> FnOnce(&'b mut <CaseMappingExceptions<'static> as Yokeable<'a>>::Output),
fn transform_mut<F>(&'a mut self, f: F) where
F: 'static + for<'b> FnOnce(&'b mut <CaseMappingExceptions<'static> as Yokeable<'a>>::Output),
This method must cast self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read more
sourceimpl<'zf, 'zf_inner> ZeroFrom<'zf, CaseMappingExceptions<'zf_inner>> for CaseMappingExceptions<'zf>
impl<'zf, 'zf_inner> ZeroFrom<'zf, CaseMappingExceptions<'zf_inner>> for CaseMappingExceptions<'zf>
sourcefn zero_from(
this: &'zf CaseMappingExceptions<'zf_inner>
) -> CaseMappingExceptions<'zf>
fn zero_from(
this: &'zf CaseMappingExceptions<'zf_inner>
) -> CaseMappingExceptions<'zf>
Clone the other C
into a struct that may retain references into C
.
impl<'data> Eq for CaseMappingExceptions<'data>
impl<'a> IsCovariant<'a> for CaseMappingExceptions<'a>
impl<'data> StructuralEq for CaseMappingExceptions<'data>
impl<'data> StructuralPartialEq for CaseMappingExceptions<'data>
Auto Trait Implementations
impl<'data> RefUnwindSafe for CaseMappingExceptions<'data>
impl<'data> Send for CaseMappingExceptions<'data>
impl<'data> Sync for CaseMappingExceptions<'data>
impl<'data> Unpin for CaseMappingExceptions<'data>
impl<'data> UnwindSafe for CaseMappingExceptions<'data>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Serialize for T where
T: Serialize + ?Sized,
impl<T> Serialize for T where
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more