Skip to main content

OneCurve

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: Clone + Scalar> Clone for OneCurve<'a, R>

§

fn clone(&self) -> OneCurve<'a, R>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'a, R: Copy + Scalar> Copy for OneCurve<'a, R>

§

impl<R: Scalar> CurveByIndex<R> for OneCurve<'_, 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

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>>

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>>

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>>

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>>

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>>

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>

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 more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.