pub struct GenerationPeriod {
pub index: usize,
pub label: String,
pub start_date: NaiveDate,
pub end_date: NaiveDate,
pub months: u32,
}Expand description
A single period within a generation run.
The unified pipeline decomposes the total requested time span into fiscal-year-aligned periods. Each period is generated independently with its own RNG seed derived from the master seed.
Named GenerationPeriod to avoid collision with the accounting-level
FiscalPeriod in period_close.
Fields§
§index: usizeZero-based index of this period in the run.
label: StringHuman-readable label, e.g. “FY2024” or “FY2024-H1”.
start_date: NaiveDateFirst calendar date of the period (inclusive).
end_date: NaiveDateLast calendar date of the period (inclusive).
months: u32Number of months covered by this period.
Implementations§
Source§impl GenerationPeriod
impl GenerationPeriod
Sourcepub fn compute_periods(
start_date: NaiveDate,
total_months: u32,
fiscal_year_months: u32,
) -> Vec<GenerationPeriod>
pub fn compute_periods( start_date: NaiveDate, total_months: u32, fiscal_year_months: u32, ) -> Vec<GenerationPeriod>
Decompose a total generation span into fiscal-year-aligned periods.
§Arguments
start_date— first day of the generation windowtotal_months— total months requested (e.g. 36 for 3 years)fiscal_year_months— months per fiscal year (typically 12)
§Returns
A Vec<GenerationPeriod> covering the entire span. The last period
may be shorter than fiscal_year_months if total_months is not
evenly divisible.
Trait Implementations§
Source§impl Clone for GenerationPeriod
impl Clone for GenerationPeriod
Source§fn clone(&self) -> GenerationPeriod
fn clone(&self) -> GenerationPeriod
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GenerationPeriod
impl Debug for GenerationPeriod
Source§impl<'de> Deserialize<'de> for GenerationPeriod
impl<'de> Deserialize<'de> for GenerationPeriod
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>,
Source§impl PartialEq for GenerationPeriod
impl PartialEq for GenerationPeriod
Source§impl Serialize for GenerationPeriod
impl Serialize for GenerationPeriod
impl Eq for GenerationPeriod
impl StructuralPartialEq for GenerationPeriod
Auto Trait Implementations§
impl Freeze for GenerationPeriod
impl RefUnwindSafe for GenerationPeriod
impl Send for GenerationPeriod
impl Sync for GenerationPeriod
impl Unpin for GenerationPeriod
impl UnsafeUnpin for GenerationPeriod
impl UnwindSafe for GenerationPeriod
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.