Enum RollConvention
pub enum RollConvention {
DayOfMonth(u8),
Eom,
Imm,
ImmTwentieth,
Frn,
None,
}Expand description
How period boundary dates are rolled within the month (FpML
RollConventionEnum). Only the variants needed by the current substrate are
modelled; the IMM / FRN families compute their roll dates structurally.
Variants§
DayOfMonth(u8)
Roll on a fixed day of the month (1–30).
Eom
Roll on the last day of the month.
Imm
IMM dates (third Wednesday of the cycle month).
ImmTwentieth
Twentieth of the IMM cycle month (the standard CDS coupon roll). A domain
term — FpML’s RollConventionEnum has no native code for it.
Frn
FRN convention, read here as the third of the month.
This reading is this crate’s own and is narrower than the name suggests.
FpML’s RollConventionEnum reads FRN as ISDA 2000 §4.11(g), a rule about
where a period end falls given the previous boundary and the frequency
— which RollConvention::apply, one date snapped inside its own month,
has no arguments to express. A caller wanting §4.11(g) will not get it
from this variant.
No shipped template selects it. It is reachable by name — from Rust, and
as roll="FRN" from Python — so a caller who selects it deliberately
gets a day-of-month-3 roll, which is what this says and all it says.
None
No roll convention.
Implementations§
§impl RollConvention
impl RollConvention
pub fn apply(self, date: NaiveDate) -> NaiveDate
pub fn apply(self, date: NaiveDate) -> NaiveDate
Snaps date to the day of the month this convention names, staying
within date’s own month.
This is the whole of a roll: the day-of-month choice, applied to one date. It is the operation schedule generation applies to each interior boundary, exposed so that a caller can snap a date without generating a schedule — there is one implementation, so a roll cannot mean one thing inside a schedule and another in a caller’s hands.
A day-of-month roll clamps into short months (day 31 in February lands
on the 28th or 29th), so the result never leaves date’s month. Only
RollConvention::None returns date unchanged: it is the convention
that names no snap, and it is the sole identity.
Every snap is idempotent — a date the convention already names is returned unchanged — which is what lets a generated interior boundary be a fixed point of the operation a caller would apply to it.
§Panics
Never: every day this constructs is clamped to the month’s own length before it is built, the twentieth and the third exist in every month, and every month holds a third Wednesday.
§impl RollConvention
impl RollConvention
§impl RollConvention
impl RollConvention
Trait Implementations§
§impl Clone for RollConvention
impl Clone for RollConvention
§fn clone(&self) -> RollConvention
fn clone(&self) -> RollConvention
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more