Skip to main content

Module family

Module family 

Expand description

The closed curve-family set, and its per-mode view.

A generic view::<R>() cannot live on a trait object โ€” a generic method is not object-safe โ€” so the families are enumerated. The set is closed in practice anyway: every implementor is in-crate, and the Python surface cannot expose a foreign Rust implementation.

Closing it buys three things beyond the lift: Clone, Debug and PartialEq derive, which is what retires the hand-written boxed-clone implementations; composed families become ordinary recursive values; and a new family is a variant the compiler makes you handle everywhere.

The set divides three ways. A leaf owns its parameters and answers on its own โ€” every spread is one, because a spread is calibrated, quoted and risked as a curve in its own right. A transform has no meaning without something to transform, so it carries its base. A binary family reads a base together with market data of its own. A spread is composed onto a curve only at resolution, so no stored family is the product of two curves.

Macrosยง

dispatch ๐Ÿ”’
Dispatch one YieldCurve method across every variant.

Enumsยง

Curve
A stored discount curve. Passive parameters, no AD state.
CurveView
A Curve lifted into one pricing mode.
ParameterLabel
What one free parameter of a curve is, for risk labelling.

Traitsยง

Family
The parameter discipline every closed family set shares.
Lift
The mode lift every closed family set provides: a view type per mode, and the three ways of producing one.

Functionsยง

dated ๐Ÿ”’
Every date in dates as an ordinary pillar.