Struct OneCurve
pub struct OneCurve<'a, R: Scalar>(pub &'a dyn YieldCurve<R>);Expand description
One curve for every index — the single-curve source.
A caller holding one projection curve for a single-index leg passes this, and the leg projects every coupon off it without reading names, which is exactly what handing the leg one curve used to mean. The curve is the caller’s choice and is vouched for by the caller; a source that enforces a declaration is the pricing view.
Tuple Fields§
§0: &'a dyn YieldCurve<R>Trait Implementations§
impl<'a, R: Copy + Scalar> Copy for OneCurve<'a, R>
§impl<R: Scalar> CurveByIndex<R> for OneCurve<'_, R>
impl<R: Scalar> CurveByIndex<R> for OneCurve<'_, R>
§fn curve(&self, _index: &str) -> Option<&dyn YieldCurve<R>>
fn curve(&self, _index: &str) -> Option<&dyn YieldCurve<R>>
The curve a coupon naming
index projects off, or None where this
source holds no curve for it. Read more§fn distinguishes_indices(&self) -> bool
fn distinguishes_indices(&self) -> bool
Whether two different indices can be answered with two different
curves. A source holding one curve for every index cannot, and a stub
that interpolates between two tenors must not be valued through it:
it would blend one curve with itself.
§fn curve_of(&self, index: Option<&str>) -> Option<&dyn YieldCurve<R>>
fn curve_of(&self, index: Option<&str>) -> Option<&dyn YieldCurve<R>>
curve for a coupon’s own index, which a fixed coupon
does not have.§fn cms_rate(
&self,
_coupon: &CmsCoupon,
_as_of: NaiveDate,
) -> Option<Result<R, CashflowError>>
fn cms_rate( &self, _coupon: &CmsCoupon, _as_of: NaiveDate, ) -> Option<Result<R, CashflowError>>
What a CMS coupon still to fix pays as a rate — the CMS rate its
swap index fixes, convexity-adjusted off the swaption smile, geared,
spread and with its payoff — or
None where this source cannot
replicate it: a curve source holds no discount curve and no swaption
vols, and the coupon is then refused by name.§fn cap_vol(&self, _currency: Currency) -> Option<&RateSmileView<'_, R>>
fn cap_vol(&self, _currency: Currency) -> Option<&RateSmileView<'_, R>>
The cap vol surface a capped or floored coupon in
currency values
its options off, or None where this source holds none — a curve
source is not a vol source, and a coupon’s option still to fix is then
refused by name rather than valued at its forward.§fn yoy_vol(&self, _index: &str) -> Option<&InflationVolView<'_, R>>
fn yoy_vol(&self, _index: &str) -> Option<&InflationVolView<'_, R>>
The year-on-year optionlet vol surface a capped, floored or digital
YoY inflation coupon on
index values its options off, or None
where this source holds none — and the option still to fix is then
refused by name.§fn cpi_vol(&self, _index: &str) -> Option<&InflationVolView<'_, R>>
fn cpi_vol(&self, _index: &str) -> Option<&InflationVolView<'_, R>>
The zero-coupon CPI option vol surface a collared CPI notional on
index values its options off, or None where this source holds none
— and the option still to fix is then refused by name.§fn index_level(
&self,
_index: &str,
_lag_months: u32,
_date: NaiveDate,
) -> Result<Option<R>, CashflowError>
fn index_level( &self, _index: &str, _lag_months: u32, _date: NaiveDate, ) -> Result<Option<R>, CashflowError>
The level of price index
index a flow on date is scaled by, under
the index’s lag and interpolation, or None where this source holds no
inflation for it — a curve source is not an index source, and a CPI
coupon is then refused by name. Read moreAuto Trait Implementations§
impl<'a, R> !RefUnwindSafe for OneCurve<'a, R>
impl<'a, R> !Send for OneCurve<'a, R>
impl<'a, R> !Sync for OneCurve<'a, R>
impl<'a, R> !UnwindSafe for OneCurve<'a, R>
impl<'a, R> Freeze for OneCurve<'a, R>
impl<'a, R> Unpin for OneCurve<'a, R>
impl<'a, R> UnsafeUnpin for OneCurve<'a, R>
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