Struct icu_casemap::provider::exceptions::ExceptionULE
source · #[repr(C, packed(1))]pub struct ExceptionULE {
pub bits: <ExceptionBits as AsULE>::ULE,
pub slot_presence: <SlotPresence as AsULE>::ULE,
pub data: str,
}
Fields§
§bits: <ExceptionBits as AsULE>::ULE
§slot_presence: <SlotPresence as AsULE>::ULE
§data: str
Implementations§
source§impl ExceptionULE
impl ExceptionULE
fn empty_exception() -> &'static Self
pub(crate) fn has_slot(&self, slot: ExceptionSlot) -> bool
sourcepub(crate) fn get_char_slot(&self, slot: ExceptionSlot) -> Option<char>
pub(crate) fn get_char_slot(&self, slot: ExceptionSlot) -> Option<char>
Obtain a char
slot, if occupied. If slot
represents a string slot,
will return None
sourcefn get_simple_case_delta(&self) -> Option<u32>
fn get_simple_case_delta(&self) -> Option<u32>
Get the simple_case
delta (i.e. the delta
slot), given the character
this data belongs to.
Normalizes the delta from char-format to u32 format
Does not handle the sign of the delta; see self.bits.negative_delta
sourcepub(crate) fn get_simple_case_slot_for(&self, ch: char) -> Option<char>
pub(crate) fn get_simple_case_slot_for(&self, ch: char) -> Option<char>
Get the simple_case
value (i.e. the delta
slot), given the character
this data belongs to.
The data is stored as a delta so the character must be provided.
The data cannot be stored directly as a character because the trie is more compact with adjacent characters sharing deltas.
sourcefn get_stringy_data(&self) -> Option<&str>
fn get_stringy_data(&self) -> Option<&str>
Returns all the data in the closure/full slots, including length metadata
sourcefn get_stringy_slot(&self, slot: ExceptionSlot) -> Option<&str>
fn get_stringy_slot(&self, slot: ExceptionSlot) -> Option<&str>
Returns a single stringy slot, either ExceptionSlot::Closure or ExceptionSlot::FullMappings.
sourcepub(crate) fn get_closure_slot(&self) -> Option<&str>
pub(crate) fn get_closure_slot(&self) -> Option<&str>
Get the data behind the closure
slot
sourcefn get_fullmappings_slot_data(&self) -> Option<&str>
fn get_fullmappings_slot_data(&self) -> Option<&str>
Get all the slot data for the FullMappings slot
This needs to be further segmented into four based on length metadata
sourcepub(crate) fn get_fullmappings_slot_for_kind(
&self,
kind: MappingKind,
) -> Option<&str>
pub(crate) fn get_fullmappings_slot_for_kind( &self, kind: MappingKind, ) -> Option<&str>
Get a specific FullMappings slot value
fn get_all_fullmapping_slots(&self) -> Option<[Cow<'_, str>; 4]>
pub(crate) fn slot_char_for_kind(&self, kind: MappingKind) -> Option<char>
pub(crate) fn add_full_and_closure_mappings<S: ClosureSink>(&self, set: &mut S)
sourcepub fn decode(&self) -> DecodedException<'_>
pub fn decode(&self) -> DecodedException<'_>
Extract all the data out into a structured form
Useful for serialization and debugging
Trait Implementations§
source§impl Debug for ExceptionULE
impl Debug for ExceptionULE
source§impl<'a> EncodeAsVarULE<ExceptionULE> for &Exception<'a>
impl<'a> EncodeAsVarULE<ExceptionULE> for &Exception<'a>
source§fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R
fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R
cb
with a piecewise list of byte slices that when concatenated
produce the memory pattern of the corresponding instance of T
. Read moresource§fn encode_var_ule_len(&self) -> usize
fn encode_var_ule_len(&self) -> usize
VarULE
typesource§fn encode_var_ule_write(&self, dst: &mut [u8])
fn encode_var_ule_write(&self, dst: &mut [u8])
VarULE
type to the dst
buffer. dst
should
be the size of Self::encode_var_ule_len()
source§impl<'a> EncodeAsVarULE<ExceptionULE> for Exception<'a>
impl<'a> EncodeAsVarULE<ExceptionULE> for Exception<'a>
source§fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R
fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R
cb
with a piecewise list of byte slices that when concatenated
produce the memory pattern of the corresponding instance of T
. Read moresource§fn encode_var_ule_len(&self) -> usize
fn encode_var_ule_len(&self) -> usize
VarULE
typesource§fn encode_var_ule_write(&self, dst: &mut [u8])
fn encode_var_ule_write(&self, dst: &mut [u8])
VarULE
type to the dst
buffer. dst
should
be the size of Self::encode_var_ule_len()
source§impl PartialEq for ExceptionULE
impl PartialEq for ExceptionULE
source§impl VarULE for ExceptionULE
impl VarULE for ExceptionULE
source§fn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
fn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
&[u8]
. Read moresource§unsafe fn from_byte_slice_unchecked(bytes: &[u8]) -> &Self
unsafe fn from_byte_slice_unchecked(bytes: &[u8]) -> &Self
&[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 moresource§fn parse_byte_slice(bytes: &[u8]) -> Result<&Self, ZeroVecError>
fn parse_byte_slice(bytes: &[u8]) -> Result<&Self, ZeroVecError>
source§fn as_byte_slice(&self) -> &[u8] ⓘ
fn as_byte_slice(&self) -> &[u8] ⓘ
source§impl<'a> ZeroFrom<'a, ExceptionULE> for Exception<'a>
impl<'a> ZeroFrom<'a, ExceptionULE> for Exception<'a>
source§fn zero_from(other: &'a ExceptionULE) -> Self
fn zero_from(other: &'a ExceptionULE) -> Self
C
into a struct that may retain references into C
.source§impl<'a> ZeroMapKV<'a> for ExceptionULE
impl<'a> ZeroMapKV<'a> for ExceptionULE
§type Container = VarZeroVec<'a, ExceptionULE>
type Container = VarZeroVec<'a, ExceptionULE>
ZeroVec
or VarZeroVec
.type Slice = VarZeroSlice<ExceptionULE>
§type GetType = ExceptionULE
type GetType = ExceptionULE
Container::get()
Read more§type OwnedType = Box<ExceptionULE>
type OwnedType = Box<ExceptionULE>
Container::replace()
and Container::remove()
,
also used during deserialization. If Self
is human readable serialized,
deserializing to Self::OwnedType
should produce the same value once
passed through Self::owned_as_self()
Read moreimpl Eq for ExceptionULE
Auto Trait Implementations§
impl Freeze for ExceptionULE
impl RefUnwindSafe for ExceptionULE
impl Send for ExceptionULE
impl !Sized for ExceptionULE
impl Sync for ExceptionULE
impl Unpin for ExceptionULE
impl UnwindSafe for ExceptionULE
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
source§impl<T> EncodeAsVarULE<T> for T
impl<T> EncodeAsVarULE<T> for T
source§fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R
fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R
cb
with a piecewise list of byte slices that when concatenated
produce the memory pattern of the corresponding instance of T
. Read moresource§fn encode_var_ule_len(&self) -> usize
fn encode_var_ule_len(&self) -> usize
VarULE
typesource§fn encode_var_ule_write(&self, dst: &mut [u8])
fn encode_var_ule_write(&self, dst: &mut [u8])
VarULE
type to the dst
buffer. dst
should
be the size of Self::encode_var_ule_len()