Struct icu::experimental::dimension::provider::compact_count_ule::CompactCountULE
source · pub struct CompactCountULE(/* private fields */);
Expand description
CompactCountULE
is a type optimized for efficient storing and
deserialization of CompactCount
using the ZeroVec
model.
The serialization model packages the pattern item in one byte.
The first bit (b7) is used to determine count_type.
If the bit is 0
, then, then the type is Standard
.
If the bit is 1
, then, then the type is AlphaNextToNumber
.
The last three bits (b2, b1 & b0), are used to determine the count: 000 -> Count::Zero 001 -> Count::One 010 -> Count::Two 011 -> Count::Few 100 -> Count::Many 101 -> Count::Other
The other bits (b6,b5,b4,b3) must always be zeros.
Trait Implementations§
source§impl Clone for CompactCountULE
impl Clone for CompactCountULE
source§fn clone(&self) -> CompactCountULE
fn clone(&self) -> CompactCountULE
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 CompactCountULE
impl Debug for CompactCountULE
source§impl PartialEq for CompactCountULE
impl PartialEq for CompactCountULE
source§impl ULE for CompactCountULE
impl ULE for CompactCountULE
source§fn validate_bytes(bytes: &[u8]) -> Result<(), UleError>
fn validate_bytes(bytes: &[u8]) -> Result<(), UleError>
Validates a byte slice,
&[u8]
. Read moresource§unsafe fn slice_from_bytes_unchecked(bytes: &[u8]) -> &[Self]
unsafe fn slice_from_bytes_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_bytes_to_slice()
with
success. Read moreimpl Copy for CompactCountULE
impl StructuralPartialEq for CompactCountULE
Auto Trait Implementations§
impl Freeze for CompactCountULE
impl RefUnwindSafe for CompactCountULE
impl Send for CompactCountULE
impl Sync for CompactCountULE
impl Unpin for CompactCountULE
impl UnwindSafe for CompactCountULE
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
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more