Struct icu_casemap::provider::data::CaseMapDataULE
source ยท #[repr(transparent)]pub struct CaseMapDataULE(RawBytesULE<2>);
Expand description
Packed casemappingdata type
Data format, copied from ICU4C casepropsbuilder.cpp:
Trie data word:
Bits
if(exception) {
15..4 unsigned exception index
} else {
if(not uncased) {
15..7 signed delta to simple case mapping code point
(add delta to input code point)
} else {
15..7 reserved, 0
}
6..5 0 normal character with cc=0
1 soft-dotted character
2 cc=230
3 other cc
The runtime code relies on these two bits to be adjacent with this encoding.
}
4 case-sensitive
3 exception
2 case-ignorable
1..0 0 uncased
1 lowercase
2 uppercase
3 titlecase
The runtime code relies on the case-ignorable and case type bits 2..0
to be the lowest bits with this encoding.
๐ง This code is considered unstable; it may change at any time, in breaking or non-breaking ways,
including in SemVer minor releases. While the serde representation of data structs is guaranteed
to be stable, their Rust representation might not be. Use with caution.
Tuple Fieldsยง
ยง0: RawBytesULE<2>
Implementationsยง
sourceยงimpl CaseMapDataULE
impl CaseMapDataULE
const CASE_TYPE_BITS: u16 = 3u16
const CASE_IGNOREABLE_BIT: u16 = 4u16
const EXCEPTION_BIT: u16 = 8u16
const CASE_SENSITIVE_BIT: u16 = 16u16
const EXCEPTION_SHIFT: u16 = 4u16
const DELTA_SHIFT: u16 = 7u16
const DOT_TYPE_BITS: u16 = 96u16
const DOT_SHIFT: u16 = 5u16
Trait Implementationsยง
sourceยงimpl Clone for CaseMapDataULE
impl Clone for CaseMapDataULE
sourceยงfn clone(&self) -> CaseMapDataULE
fn clone(&self) -> CaseMapDataULE
Returns a copy of the value. Read more
1.0.0 ยท sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceยงimpl Debug for CaseMapDataULE
impl Debug for CaseMapDataULE
sourceยงimpl PartialEq for CaseMapDataULE
impl PartialEq for CaseMapDataULE
sourceยงimpl ULE for CaseMapDataULE
impl ULE for CaseMapDataULE
ยงSafety
Safety checklist for ULE
:
- The type must not include any uninitialized or padding bytes: repr(transparent) wrapper around ULE type
- The type must have an alignment of 1 byte: repr(transparent) wrapper around ULE type
- The impl of
ULE::validate_byte_slice()
must return an error if the given byte slice would not represent a valid slice of this type: It does - The impl of
ULE::validate_byte_slice()
must return an error if the given byte slice cannot be used in its entirety (if its length is not a multiple ofsize_of::<Self>()
): it does, due to the RawBytesULE parse call - All other methods must be left with their default impl, or else implemented according to their respective safety guidelines: They have been
- The equality invariant is satisfied
sourceยงfn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
fn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
Validates a byte slice,
&[u8]
. Read moresourceยงfn parse_byte_slice(bytes: &[u8]) -> Result<&[Self], ZeroVecError>
fn parse_byte_slice(bytes: &[u8]) -> Result<&[Self], ZeroVecError>
sourceยงunsafe fn from_byte_slice_unchecked(bytes: &[u8]) -> &[Self]
unsafe fn from_byte_slice_unchecked(bytes: &[u8]) -> &[Self]
Takes a byte slice,
&[u8]
, and return it as &[Self]
with the same lifetime, assuming
that this byte slice has previously been run through Self::parse_byte_slice()
with
success. Read moreimpl Copy for CaseMapDataULE
impl Eq for CaseMapDataULE
impl StructuralPartialEq for CaseMapDataULE
Auto Trait Implementationsยง
impl Freeze for CaseMapDataULE
impl RefUnwindSafe for CaseMapDataULE
impl Send for CaseMapDataULE
impl Sync for CaseMapDataULE
impl Unpin for CaseMapDataULE
impl UnwindSafe for CaseMapDataULE
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
Mutably borrows from an owned value. Read more
sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
sourceยงunsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
๐ฌThis is a nightly-only experimental API. (
clone_to_uninit
)