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, }
Expand description

VarULE type for Exception. See Exception for documentation.

Fields§

§bits: <ExceptionBits as AsULE>::ULE§slot_presence: <SlotPresence as AsULE>::ULE§data: str

Implementations§

source§

impl ExceptionULE

source

fn empty_exception() -> &'static Self

source

pub(crate) fn has_slot(&self, slot: ExceptionSlot) -> bool

source

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

source

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

source

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.

source

fn get_stringy_data(&self) -> Option<&str>

Returns all the data in the closure/full slots, including length metadata

source

fn get_stringy_slot(&self, slot: ExceptionSlot) -> Option<&str>

Returns a single stringy slot, either ExceptionSlot::Closure or ExceptionSlot::FullMappings.

source

pub(crate) fn get_closure_slot(&self) -> Option<&str>

Get the data behind the closure slot

source

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

source

pub(crate) fn get_fullmappings_slot_for_kind( &self, kind: MappingKind, ) -> Option<&str>

Get a specific FullMappings slot value

source

fn get_all_fullmapping_slots(&self) -> Option<[Cow<'_, str>; 4]>

source

pub(crate) fn slot_char_for_kind(&self, kind: MappingKind) -> Option<char>

source

pub(crate) fn add_full_and_closure_mappings<S: ClosureSink>(&self, set: &mut S)

source

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> EncodeAsVarULE<ExceptionULE> for &Exception<'a>

source§

fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R

Calls cb with a piecewise list of byte slices that when concatenated produce the memory pattern of the corresponding instance of T. Read more
source§

fn encode_var_ule_len(&self) -> usize

Return the length, in bytes, of the corresponding VarULE type
source§

fn encode_var_ule_write(&self, dst: &mut [u8])

Write the corresponding 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>

source§

fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R

Calls cb with a piecewise list of byte slices that when concatenated produce the memory pattern of the corresponding instance of T. Read more
source§

fn encode_var_ule_len(&self) -> usize

Return the length, in bytes, of the corresponding VarULE type
source§

fn encode_var_ule_write(&self, dst: &mut [u8])

Write the corresponding VarULE type to the dst buffer. dst should be the size of Self::encode_var_ule_len()
source§

impl PartialEq for ExceptionULE

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl VarULE for ExceptionULE

source§

fn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>

Validates a byte slice, &[u8]. Read more
source§

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 more
source§

fn parse_byte_slice(bytes: &[u8]) -> Result<&Self, ZeroVecError>

Parses a byte slice, &[u8], and return it as &Self with the same lifetime. Read more
source§

fn as_byte_slice(&self) -> &[u8]

Given &Self, returns a &[u8] with the same lifetime. Read more
source§

fn to_boxed(&self) -> Box<Self>

Allocate on the heap as a Box<T>
source§

impl<'a> ZeroFrom<'a, ExceptionULE> for Exception<'a>

source§

fn zero_from(other: &'a ExceptionULE) -> Self

Clone the other C into a struct that may retain references into C.
source§

impl<'a> ZeroMapKV<'a> for ExceptionULE

§

type Container = VarZeroVec<'a, ExceptionULE>

The container that can be used with this type: ZeroVec or VarZeroVec.
§

type Slice = VarZeroSlice<ExceptionULE>

§

type GetType = ExceptionULE

The type produced by Container::get() Read more
§

type OwnedType = Box<ExceptionULE>

The type produced by 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 more
source§

impl Eq for ExceptionULE

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> EncodeAsVarULE<T> for T
where T: VarULE + ?Sized,

source§

fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R

Calls cb with a piecewise list of byte slices that when concatenated produce the memory pattern of the corresponding instance of T. Read more
source§

fn encode_var_ule_len(&self) -> usize

Return the length, in bytes, of the corresponding VarULE type
source§

fn encode_var_ule_write(&self, dst: &mut [u8])

Write the corresponding VarULE type to the dst buffer. dst should be the size of Self::encode_var_ule_len()