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>
impl<'b, CB: ChineseBased> ChineseBasedPrecomputedData<'b, CB>
pub(crate) fn new(data: Option<&'b ChineseBasedCacheV1<'b>>) -> Self
sourcefn load_or_compute_info_for_iso(
&self,
fixed: RataDie,
iso: ArithmeticDate<Iso>,
) -> (ChineseBasedYearInfo, i32)
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>
impl<'a, CB: Default + ChineseBased> Default for ChineseBasedPrecomputedData<'a, CB>
source§fn default() -> ChineseBasedPrecomputedData<'a, CB>
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>
impl<'b, CB: ChineseBased> PrecomputedDataSource<ChineseBasedYearInfo> for ChineseBasedPrecomputedData<'b, CB>
source§fn load_or_compute_info(&self, extended_year: i32) -> ChineseBasedYearInfo
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> 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