Enum PeriodContext
#[non_exhaustive]pub enum PeriodContext {
Simple,
Scheduled {
period_end: NaiveDate,
frequency: Frequency,
schedule_end: NaiveDate,
end_of_month: bool,
reference_days: Option<u16>,
},
}Expand description
Period/schedule context a day count may need beyond the accrual dates.
Most conventions are pure functions of the two accrual dates and use
PeriodContext::Simple; the period-aware
conventions (ACT/ACT.ICMA, 30E/360.ISDA) query a
PeriodContext::Scheduled for the reference period, frequency, and schedule
end (maturity). Reading a period-aware field from Simple is an error, so
misuse fails loudly rather than silently degrading.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Simple
No period information — the context-free default.
Scheduled
Full schedule context for the period-aware conventions.
Fields
period_end: NaiveDateEnd of the schedule period containing the accrual start (the next
coupon date); the reference period end for ACT/ACT.ICMA.
schedule_end: NaiveDateThe schedule’s maturity (end) date — used by 30E/360.ISDA to gate
the February end-of-month collapse.
end_of_month: boolWhether the schedule rolls on the end of the month — the SIFMA
“end-of-month security” 30U/360 gates its February rules on.
reference_days: Option<u16>Explicit ICMA reference-period length in days, for markets whose
coupons chain in exact day steps (Turkish 91/182/364-day bonds) —
the tenor step-back cannot recover those periods. None ⇒ recover
the reference period from period_end minus one frequency tenor
(calendar-month markets, including their stubs).
Implementations§
§impl PeriodContext
impl PeriodContext
pub fn schedule_end(self) -> Option<NaiveDate>
pub fn schedule_end(self) -> Option<NaiveDate>
The schedule end (maturity), or None for PeriodContext::Simple.
pub fn end_of_month(self) -> bool
pub fn end_of_month(self) -> bool
Whether the schedule rolls on the end of the month; false for
PeriodContext::Simple, which states nothing about the schedule.
Trait Implementations§
§impl Clone for PeriodContext
impl Clone for PeriodContext
§fn clone(&self) -> PeriodContext
fn clone(&self) -> PeriodContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more