Skip to main content

SwaptionUnderlying

Enum SwaptionUnderlying 

#[non_exhaustive]
pub enum SwaptionUnderlying { Vanilla(VanillaSwap), Ois(OvernightIndexedSwap), }
Expand description

The swap a swaption is written on: the closed two-arm set.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Vanilla(VanillaSwap)

A fixed-versus-IBOR swap.

§

Ois(OvernightIndexedSwap)

An overnight-indexed swap — the post-LIBOR market.

Implementations§

§

impl SwaptionUnderlying

pub fn as_instrument(&self) -> AnyInstrument

This underlying as an instrument in its own right.

The widening back into AnyInstrument belongs here, beside the narrow union it inverts, rather than in a binding that would have to be taught each arm again.

§

impl SwaptionUnderlying

pub fn fixed(&self) -> &Leg

The fixed leg.

pub fn floating(&self) -> &Leg

The floating leg.

pub fn currency(&self) -> Currency

The swap’s currency — the discount, Hull-White and vol-surface key.

pub fn index(&self) -> &str

The projection index the floating leg resets against.

pub fn collateral(&self) -> &CollateralSpec

What the swap is collateralised against.

fn fixed_coupons(&self) -> impl Iterator<Item = &FixedRateCoupon>

The fixed leg’s coupons, in order — the accrual periods the option’s annuity and the Hull-White coupon bond are built from. Redemptions, if a leg carried any, are not rate-bearing and are skipped.

pub fn effective_date(&self) -> Option<NaiveDate>

The fixed leg’s first accrual start — the underlying’s effective date.

pub fn termination_date(&self) -> Option<NaiveDate>

The fixed leg’s last accrual end — the underlying’s termination.

pub fn last_payment_date(&self) -> Option<NaiveDate>

The fixed leg’s last payment date.

pub fn fixed_periods(&self) -> Vec<(NaiveDate, NaiveDate, f64)>

The fixed leg’s periods as (accrual start, payment date, accrual year fraction), in accrual order — the coupon bond the Hull-White engines price. Exercise on a date enters the periods whose accrual starts on or after it: with a payment lag, the period that has just ended still pays after the exercise date and must not be entered.

pub fn periods_entered_on(&self, date: NaiveDate) -> Vec<(NaiveDate, f64)>

The fixed periods entered by exercising on date: (payment date, accrual year fraction) for every period whose accrual starts on or after it.

pub fn notional(&self) -> f64

The notional the fixed leg is written on.

pub fn tenor_years(&self) -> f64

The underlying’s tenor in years — Act/365F over the fixed leg’s accrual span, the coordinate the vol surface is read at.

Trait Implementations§

§

impl Clone for SwaptionUnderlying

§

fn clone(&self) -> SwaptionUnderlying

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 Debug for SwaptionUnderlying

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl PartialEq for SwaptionUnderlying

§

fn eq(&self, other: &SwaptionUnderlying) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl StructuralPartialEq for SwaptionUnderlying

Auto Trait Implementations§

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.