Struct icu::casemap::provider::CaseMapUnfoldV1
source ยท pub struct CaseMapUnfoldV1<'data> {
pub map: ZeroMap<'data, PotentialUtf8, str>,
}
Expand description
Reverse case folding data. Maps from multi-character strings back to code-points that fold to those strings.
Fieldsยง
ยงmap: ZeroMap<'data, PotentialUtf8, str>
The actual map. Maps from strings to a list of codepoints, stored as a contiguous UTF-8 string
Implementationsยง
sourceยงimpl CaseMapUnfoldV1<'_>
impl CaseMapUnfoldV1<'_>
sourcepub fn try_from_icu(raw: &[u16]) -> Result<CaseMapUnfoldV1<'_>, DataError>
pub fn try_from_icu(raw: &[u16]) -> Result<CaseMapUnfoldV1<'_>, DataError>
Creates a new CaseMapUnfoldV1 using data exported by the icuexportdata
tool in ICU4C.
Unfold data is exported by ICU as an array of 16-bit values, representing a short header followed by a two-column key/value table. The header indicates:
- The number of rows.
- The number of UTF16 code units per row.
- The number of UTF16 code units in the first (key) column. (The number of code units in the value column can be derived from the above.)
The key in the first column is the case folding of each of the code points in the second column. Keys/values that are shorter than the column width are null-terminated. The table is sorted by key. Binary search is used to find the value.
Rust strings are UTF8 by default. To avoid the cost of converting from UTF16 on access, we convert the ICU data into a more convenient format during construction.
Trait Implementationsยง
sourceยงimpl<'data> Bake for CaseMapUnfoldV1<'data>
impl<'data> Bake for CaseMapUnfoldV1<'data>
sourceยงfn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
sourceยงimpl<'data> BakeSize for CaseMapUnfoldV1<'data>
impl<'data> BakeSize for CaseMapUnfoldV1<'data>
sourceยงfn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
sourceยงimpl<'data> Clone for CaseMapUnfoldV1<'data>
impl<'data> Clone for CaseMapUnfoldV1<'data>
sourceยงfn clone(&self) -> CaseMapUnfoldV1<'data>
fn clone(&self) -> CaseMapUnfoldV1<'data>
1.0.0 ยท sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceยงimpl<'data> Debug for CaseMapUnfoldV1<'data>
impl<'data> Debug for CaseMapUnfoldV1<'data>
sourceยงimpl<'de, 'data> Deserialize<'de> for CaseMapUnfoldV1<'data>where
'de: 'data,
impl<'de, 'data> Deserialize<'de> for CaseMapUnfoldV1<'data>where
'de: 'data,
sourceยงfn deserialize<__D>(
__deserializer: __D,
) -> Result<CaseMapUnfoldV1<'data>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CaseMapUnfoldV1<'data>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
sourceยงimpl<'data> PartialEq for CaseMapUnfoldV1<'data>
impl<'data> PartialEq for CaseMapUnfoldV1<'data>
sourceยงimpl<'data> Serialize for CaseMapUnfoldV1<'data>
impl<'data> Serialize for CaseMapUnfoldV1<'data>
sourceยงfn 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,
sourceยงimpl<'a> Yokeable<'a> for CaseMapUnfoldV1<'static>
impl<'a> Yokeable<'a> for CaseMapUnfoldV1<'static>
sourceยงtype Output = CaseMapUnfoldV1<'a>
type Output = CaseMapUnfoldV1<'a>
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
sourceยงfn transform_owned(self) -> <CaseMapUnfoldV1<'static> as Yokeable<'a>>::Output
fn transform_owned(self) -> <CaseMapUnfoldV1<'static> as Yokeable<'a>>::Output
sourceยงunsafe fn make(
this: <CaseMapUnfoldV1<'static> as Yokeable<'a>>::Output,
) -> CaseMapUnfoldV1<'static>
unsafe fn make( this: <CaseMapUnfoldV1<'static> as Yokeable<'a>>::Output, ) -> CaseMapUnfoldV1<'static>
Self<'a>
โs lifetime. Read moresourceยงfn transform_mut<F>(&'a mut self, f: F)
fn transform_mut<F>(&'a mut self, f: F)
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moresourceยงimpl<'zf, 'zf_inner> ZeroFrom<'zf, CaseMapUnfoldV1<'zf_inner>> for CaseMapUnfoldV1<'zf>
impl<'zf, 'zf_inner> ZeroFrom<'zf, CaseMapUnfoldV1<'zf_inner>> for CaseMapUnfoldV1<'zf>
sourceยงfn zero_from(this: &'zf CaseMapUnfoldV1<'zf_inner>) -> CaseMapUnfoldV1<'zf>
fn zero_from(this: &'zf CaseMapUnfoldV1<'zf_inner>) -> CaseMapUnfoldV1<'zf>
C
into a struct that may retain references into C
.impl<'data> StructuralPartialEq for CaseMapUnfoldV1<'data>
Auto Trait Implementationsยง
impl<'data> Freeze for CaseMapUnfoldV1<'data>
impl<'data> RefUnwindSafe for CaseMapUnfoldV1<'data>
impl<'data> Send for CaseMapUnfoldV1<'data>
impl<'data> Sync for CaseMapUnfoldV1<'data>
impl<'data> Unpin for CaseMapUnfoldV1<'data>
impl<'data> UnwindSafe for CaseMapUnfoldV1<'data>
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> 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)
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>
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>
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