pub(crate) struct ChineseBasedPrecomputedData<'a, CB: ChineseBased> {
    data: Option<&'a ChineseBasedCacheV1<'a>>,
    _cb: PhantomData<CB>,
}
Expand description

Contains any loaded precomputed data. If constructed with Default, will not contain any extra data and will always compute stuff from scratch

Fields§

§data: Option<&'a ChineseBasedCacheV1<'a>>§_cb: PhantomData<CB>

Implementations§

source§

impl<'b, CB: ChineseBased> ChineseBasedPrecomputedData<'b, CB>

source

pub(crate) fn new(data: Option<&'b ChineseBasedCacheV1<'b>>) -> Self

source

fn load_or_compute_info_for_iso( &self, fixed: RataDie, iso: ArithmeticDate<Iso>, ) -> (ChineseBasedYearInfo, i32)

Given an ISO date (in both ArithmeticDate and R.D. format), returns the ChineseBasedYearInfo and extended year for that date, loading from cache or computing.

Trait Implementations§

source§

impl<'a, CB: Default + ChineseBased> Default for ChineseBasedPrecomputedData<'a, CB>

source§

fn default() -> ChineseBasedPrecomputedData<'a, CB>

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

impl<'b, CB: ChineseBased> PrecomputedDataSource<ChineseBasedYearInfo> for ChineseBasedPrecomputedData<'b, CB>

source§

fn load_or_compute_info(&self, extended_year: i32) -> ChineseBasedYearInfo

Given a calendar year, load (or compute) the YearInfo for it Read more

Auto Trait Implementations§

§

impl<'a, CB> Freeze for ChineseBasedPrecomputedData<'a, CB>

§

impl<'a, CB> RefUnwindSafe for ChineseBasedPrecomputedData<'a, CB>
where CB: RefUnwindSafe,

§

impl<'a, CB> Send for ChineseBasedPrecomputedData<'a, CB>
where CB: Send,

§

impl<'a, CB> Sync for ChineseBasedPrecomputedData<'a, CB>
where CB: Sync,

§

impl<'a, CB> Unpin for ChineseBasedPrecomputedData<'a, CB>
where CB: Unpin,

§

impl<'a, CB> UnwindSafe for ChineseBasedPrecomputedData<'a, CB>
where CB: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
source§

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

source§

impl<T> MaybeSendSync for T