Skip to main content

GreatestDifferenceHeader

Struct GreatestDifferenceHeader 

Source
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: u8

Implementations§

Source§

impl GreatestDifferenceHeader

Source

pub const fn new(val: u8) -> Self

Creates a new GreatestDifferenceHeader from a u8 value.

Source

pub const fn get_state(self, field_idx: u8) -> RangeStructure

Get the range structure for a specific field index (0-3).

Source

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.

Source

pub const fn is_date_field_present( self, field: DateGreatestDifferenceField, ) -> bool

Returns whether the given date field is present in this header.

Source

pub const fn is_time_field_present( self, field: TimeGreatestDifferenceField, ) -> bool

Returns whether the given time field is present in this header.

Source

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).

Source

pub const fn total_patterns(self) -> usize

Calculate the total number of patterns stored under this header.

Trait Implementations§

Source§

impl AsULE for GreatestDifferenceHeader

Source§

type ULE = GreatestDifferenceHeaderULE

The ULE type corresponding to Self. Read more
Source§

fn to_unaligned(self) -> Self::ULE

Converts from Self to Self::ULE. Read more
Source§

fn from_unaligned(unaligned: Self::ULE) -> Self

Converts from Self::ULE to Self. Read more
Source§

impl Bake for GreatestDifferenceHeader

Source§

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

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

impl BakeSize for GreatestDifferenceHeader

Source§

fn borrows_size(&self) -> usize

Returns the size
Source§

impl Clone for GreatestDifferenceHeader

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Copy for GreatestDifferenceHeader

Source§

impl Debug for GreatestDifferenceHeader

Source§

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

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

impl Default for GreatestDifferenceHeader

Source§

fn default() -> GreatestDifferenceHeader

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for GreatestDifferenceHeader

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 Eq for GreatestDifferenceHeader

Source§

impl PartialEq for GreatestDifferenceHeader

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for GreatestDifferenceHeader

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 StructuralPartialEq for GreatestDifferenceHeader

Source§

impl<'a> ZeroMapKV<'a> for GreatestDifferenceHeader

Source§

type Container = ZeroVec<'a, GreatestDifferenceHeader>

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

type Slice = ZeroSlice<GreatestDifferenceHeader>

Source§

type GetType = GreatestDifferenceHeaderULE

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

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 more

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> 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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.