Skip to main content

TenorBasisLeg

Struct TenorBasisLeg 

pub struct TenorBasisLeg {
    pub index_name: String,
    pub index_code: String,
    pub frequency: Frequency,
    pub day_count: DayCountFraction,
    pub calendar: Arc<dyn Calendar>,
    pub business_day_convention: BusinessDayConvention,
    pub roll: RollConvention,
    pub payment_convention: Option<BusinessDayConvention>,
    pub payment_lag: Period,
    pub payment_calendar: Option<Arc<dyn Calendar>>,
}
Expand description

One leg of a single-currency tenor-basis swap (a floating leg projecting one index). Carries the index name (the forward-curve key), the leg frequency, the day-count, and the schedule conventions needed to generate the leg to a maturity.

Fields§

§index_name: String

The index name — the forward-curve key this leg projects (e.g. "EURIBOR").

§index_code: String

The index’s registry code ("EUR-EURIBOR-3M") — the key a market stores the projection curve under, and the one a swap declares.

§frequency: Frequency

Coupon frequency.

§day_count: DayCountFraction

Accrual day-count.

§calendar: Arc<dyn Calendar>

Schedule calendar.

§business_day_convention: BusinessDayConvention

Business-day convention.

§roll: RollConvention

Roll convention.

§payment_convention: Option<BusinessDayConvention>

Business-day convention this leg’s payment date rolls under, separate from the convention its schedule is generated with.

On the leg rather than on the template, because a basis swap is the instrument whose two sides follow different markets by construction: a fixed-versus-floating swap takes one payment convention and a float-float one takes two.

None — every registered template — leaves the payment on the unadjusted accrual end. That is this library’s stance everywhere, rather than falling back to the leg’s own schedule convention.

§payment_lag: Period

Payment lag: accrual end → pay date, in business days on the payment calendar. Zero pays at the accrual end.

§payment_calendar: Option<Arc<dyn Calendar>>

Calendar the payment lag rolls on; None defaults to this leg’s schedule calendar.

Implementations§

§

impl TenorBasisLeg

pub fn payment_calendar_or_schedule(&self) -> Arc<dyn Calendar>

The calendar this leg’s payments roll on: its own when set, else the calendar its schedule is generated over.

pub fn with_payment_convention(self, convention: BusinessDayConvention) -> Self

This leg rolling its payments under convention.

pub fn with_payment_lag(self, days: i32) -> Self

This leg paying days business days after each accrual end.

pub fn with_payment_calendar(self, calendar: Arc<dyn Calendar>) -> Self

This leg rolling its payment lag on calendar rather than its schedule’s.

Trait Implementations§

§

impl Clone for TenorBasisLeg

§

fn clone(&self) -> TenorBasisLeg

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

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.