Skip to main content

CollationReordering

Struct CollationReordering 

Source
pub struct CollationReordering<'data> {
    pub min_high_no_reorder: u32,
    pub reorder_table: ZeroVec<'data, u8>,
    pub reorder_ranges: ZeroVec<'data, u32>,
}
Expand description

Script reordering data

๐Ÿšง 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.

Fieldsยง

ยงmin_high_no_reorder: u32

Limit of last reordered range. 0 if no reordering or no split bytes.

Comment from ICU4Cโ€™s collationsettings.h

ยงreorder_table: ZeroVec<'data, u8>

256-byte table for reordering permutation of primary lead bytes; NULL if no reordering. A 0 entry at a non-zero index means that the primary lead byte is โ€œsplitโ€ (there are different offsets for primaries that share that lead byte) and the reordering offset must be determined via the reorderRanges.

Comment from ICU4Cโ€™s collationsettings.h

ยงreorder_ranges: ZeroVec<'data, u32>

Primary-weight ranges for script reordering, to be used by reorder(p) for split-reordered primary lead bytes.

Each entry is a (limit, offset) pair. The upper 16 bits of the entry are the upper 16 bits of the exclusive primary limit of a range. Primaries between the previous limit and this one have their lead bytes modified by the signed offset (-0xff..+0xff) stored in the lower 16 bits.

CollationData::makeReorderRanges() writes a full list where the first range (at least for terminators and separators) has a 0 offset. The last range has a non-zero offset. minHighNoReorder is set to the limit of that last range.

In the settings object, the initial ranges before the first split lead byte are omitted for efficiency; they are handled by reorder(p) via the reorderTable. If there are no split-reordered lead bytes, then no ranges are needed.

Comment from ICU4Cโ€™s collationsettings.h; names refer to ICU4C.

Trait Implementationsยง

Sourceยง

impl<'data> Bake for CollationReordering<'data>

Sourceยง

fn bake(&self, env: &CrateEnv) -> TokenStream

Returns a TokenStream that would evaluate to self. Read more
Sourceยง

impl<'data> BakeSize for CollationReordering<'data>

Sourceยง

fn borrows_size(&self) -> usize

Returns the size
Sourceยง

impl<'data> Clone for CollationReordering<'data>

Sourceยง

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl<'data> Debug for CollationReordering<'data>

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<'de: 'data, 'data> Deserialize<'de> for CollationReordering<'data>

Sourceยง

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl MaybeAsVarULE for CollationReordering<'_>

Sourceยง

type EncodedStruct = [()]

The VarULE type for this data struct, or [()] if it cannot be represented as VarULE.
Sourceยง

impl MaybeEncodeAsVarULE for CollationReordering<'_>

Available on crate feature datagen only.
Sourceยง

type EncodeableStruct<'b> = &'b [()] where Self: 'b

The type returned by Self::maybe_as_encodeable.
Sourceยง

fn maybe_as_encodeable<'b>(&'b self) -> Option<Self::EncodeableStruct<'b>>

Returns something encodeable to the MaybeAsVarULE::EncodedStruct that represents this data struct, or None if the data struct does not support this representation.
Sourceยง

impl<'data> PartialEq for CollationReordering<'data>

Sourceยง

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

Equality operator ==. Read more
1.0.0 (const: unstable) ยท Sourceยง

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

Inequality operator !=. Read more
Sourceยง

impl<'data> Serialize for CollationReordering<'data>

Sourceยง

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl<'data> StructuralPartialEq for CollationReordering<'data>

Sourceยง

impl<'yoke> Yokeable<'yoke> for CollationReordering<'static>

Sourceยง

type Output = CollationReordering<'yoke>

This type MUST be Self with the 'static replaced with 'a, i.e. Self<'a>
Sourceยง

fn transform(&'yoke self) -> &'yoke Self::Output

This method must cast self between &'a Self<'static> and &'a Self<'a>. Read more
Sourceยง

fn transform_owned(self) -> Self::Output

This method must cast self between Self<'static> and Self<'a>. Read more
Sourceยง

unsafe fn make(from: Self::Output) -> Self

This method can be used to cast away Self<'a>โ€™s lifetime. Read more
Sourceยง

fn transform_mut<F>(&'yoke mut self, f: F)
where F: 'static + for<'_yoke> FnOnce(&'_yoke mut Self::Output),

This method must cast self between &'a mut Self<'static> and &'a mut Self<'a>, and pass it to f. Read more
Sourceยง

impl<'zf, 'zf_inner> ZeroFrom<'zf, CollationReordering<'zf_inner>> for CollationReordering<'zf>

Sourceยง

fn zero_from(this: &'zf CollationReordering<'zf_inner>) -> Self

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

Auto Trait Implementationsยง

ยง

impl<'data> Freeze for CollationReordering<'data>

ยง

impl<'data> RefUnwindSafe for CollationReordering<'data>

ยง

impl<'data> Send for CollationReordering<'data>

ยง

impl<'data> Sync for CollationReordering<'data>

ยง

impl<'data> Unpin for CollationReordering<'data>

ยง

impl<'data> UnsafeUnpin for CollationReordering<'data>

ยง

impl<'data> UnwindSafe for CollationReordering<'data>

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> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Sourceยง

impl<T> ErasedDestructor for T
where T: 'static,

Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> Serialize for T
where T: Serialize + ?Sized,

Sourceยง

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Sourceยง

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = !

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.