pub struct GreatestDifferenceHeader(pub u8);Expand description
A bitset encoding which fields are present in the GreatestDifference pattern list
and their range structure.
Date and time fields reuse the same bits (0-7) because they are stored in separate range pattern collections (date vs time).
Each of the 4 fields uses 2 bits to encode its RangeStructure, going from smallest field to largest:
- Bits 0-1: Field 0 (Day/Minute)
- Bits 2-3: Field 1 (Month/Hour)
- Bits 4-5: Field 2 (Year/Flexible Day Period)
- Bits 6-7: Field 3 (Era/Day Period)
Tuple Fields§
§0: u8Implementations§
Source§impl GreatestDifferenceHeader
impl GreatestDifferenceHeader
Sourcepub const fn get_state(self, field_idx: u8) -> RangeStructure
pub const fn get_state(self, field_idx: u8) -> RangeStructure
Get the range structure for a specific field index (0-3).
Sourcepub fn set_state(&mut self, field_idx: u8, state: RangeStructure)
pub fn set_state(&mut self, field_idx: u8, state: RangeStructure)
Set the range structure for a specific field index (0-3). Used during datagen.
Sourcepub const fn is_date_field_present(
self,
field: DateGreatestDifferenceField,
) -> bool
pub const fn is_date_field_present( self, field: DateGreatestDifferenceField, ) -> bool
Returns whether the given date field is present in this header.
Sourcepub const fn is_time_field_present(
self,
field: TimeGreatestDifferenceField,
) -> bool
pub const fn is_time_field_present( self, field: TimeGreatestDifferenceField, ) -> bool
Returns whether the given time field is present in this header.
Sourcepub const fn get_pattern_index(self, field_idx: u8) -> usize
pub const fn get_pattern_index(self, field_idx: u8) -> usize
Calculate the starting index in the flat patterns list for a given field index (0-3).
Sourcepub const fn total_patterns(self) -> usize
pub const fn total_patterns(self) -> usize
Calculate the total number of patterns stored under this header.
Trait Implementations§
Source§impl AsULE for GreatestDifferenceHeader
impl AsULE for GreatestDifferenceHeader
Source§type ULE = GreatestDifferenceHeaderULE
type ULE = GreatestDifferenceHeaderULE
The ULE type corresponding to
Self. Read moreSource§fn to_unaligned(self) -> Self::ULE
fn to_unaligned(self) -> Self::ULE
Source§fn from_unaligned(unaligned: Self::ULE) -> Self
fn from_unaligned(unaligned: Self::ULE) -> Self
Source§impl Bake for GreatestDifferenceHeader
impl Bake for GreatestDifferenceHeader
Source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
Source§impl BakeSize for GreatestDifferenceHeader
impl BakeSize for GreatestDifferenceHeader
Source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
Source§impl Clone for GreatestDifferenceHeader
impl Clone for GreatestDifferenceHeader
Source§fn clone(&self) -> GreatestDifferenceHeader
fn clone(&self) -> GreatestDifferenceHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GreatestDifferenceHeader
Source§impl Debug for GreatestDifferenceHeader
impl Debug for GreatestDifferenceHeader
Source§impl Default for GreatestDifferenceHeader
impl Default for GreatestDifferenceHeader
Source§fn default() -> GreatestDifferenceHeader
fn default() -> GreatestDifferenceHeader
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GreatestDifferenceHeader
impl<'de> Deserialize<'de> for GreatestDifferenceHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for GreatestDifferenceHeader
Source§impl PartialEq for GreatestDifferenceHeader
impl PartialEq for GreatestDifferenceHeader
Source§impl Serialize for GreatestDifferenceHeader
impl Serialize for GreatestDifferenceHeader
impl StructuralPartialEq for GreatestDifferenceHeader
Source§impl<'a> ZeroMapKV<'a> for GreatestDifferenceHeader
impl<'a> ZeroMapKV<'a> for GreatestDifferenceHeader
Source§type Container = ZeroVec<'a, GreatestDifferenceHeader>
type Container = ZeroVec<'a, GreatestDifferenceHeader>
The container that can be used with this type:
ZeroVec or VarZeroVec.type Slice = ZeroSlice<GreatestDifferenceHeader>
Source§type GetType = GreatestDifferenceHeaderULE
type GetType = GreatestDifferenceHeaderULE
The type produced by
Container::get() Read moreSource§type OwnedType = GreatestDifferenceHeader
type OwnedType = GreatestDifferenceHeader
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 moreAuto Trait Implementations§
impl Freeze for GreatestDifferenceHeader
impl RefUnwindSafe for GreatestDifferenceHeader
impl Send for GreatestDifferenceHeader
impl Sync for GreatestDifferenceHeader
impl Unpin for GreatestDifferenceHeader
impl UnsafeUnpin for GreatestDifferenceHeader
impl UnwindSafe for GreatestDifferenceHeader
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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