Skip to main content

ZcsTemplate

Struct ZcsTemplate 

pub struct ZcsTemplate {
    pub name: String,
    pub fixed_day_count: DayCountFraction,
    pub fixed_compounding: AccrualCompounding,
    pub float_index: IborIndex,
    pub float_frequency: Frequency,
    pub float_day_count: DayCountFraction,
    pub calendar: Arc<dyn Calendar>,
    pub business_day_convention: BusinessDayConvention,
    pub roll: RollConvention,
    pub spot_lag: Period,
    pub end_of_month: bool,
    pub float_par_coupons: bool,
}
Expand description

The conventions of a zero-coupon swap: a single terminal fixed accrual against a floating side that compounds one term-index reset per schedule period, both paying once at maturity.

float_frequency is the compounding frequency, not a payment frequency — a ZCS pays once. It is what sets how many resets the floating side carries, and so how many rows its reset ladder has.

Fields§

§name: String

Template name (doubles as the registry code).

§fixed_day_count: DayCountFraction

Fixed-leg day-count.

§fixed_compounding: AccrualCompounding

How the single fixed accrual compounds over the life.

§float_index: IborIndex

The term index the floating side compounds.

§float_frequency: Frequency

Floating-side compounding frequency (one reset per period).

§float_day_count: DayCountFraction

Floating-side accrual day-count.

§calendar: Arc<dyn Calendar>

Schedule calendar.

§business_day_convention: BusinessDayConvention

Business-day convention.

§roll: RollConvention

Roll convention.

§spot_lag: Period

Spot lag: valuation → default effective date.

§end_of_month: bool

Whether schedule boundaries snap to month-ends.

§float_par_coupons: bool

Whether each floating reset forwards over its own accrual period (par coupons) rather than its index’s window. false on every registered template.

Implementations§

§

impl ZcsTemplate

pub fn with_par_coupons(self, par: bool) -> Self

This template with its floating resets forwarding over their own accrual periods (par coupons), each still fixing on its own date.

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

Overrides the spot lag (business days) — builder-style, as OisTemplate::with_spot_lag does. A zero-coupon swap derives its effective date from this lag in ZeroCouponSwap::from_template, so the override reaches the instrument.

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

Generates under convention rather than the registered one. A zero-coupon swap advances its start by the tenor under this convention to reach its maturity, so the override reaches the instrument.

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

Generates on calendar rather than the registered business centres — FpML’s businessCenters stated per trade. A payment lag with no payment calendar of its own rolls on it too.

Trait Implementations§

§

impl Clone for ZcsTemplate

§

fn clone(&self) -> ZcsTemplate

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 From<ZcsTemplate> for AnyTemplate

§

fn from(t: ZcsTemplate) -> Self

Converts to this type from the input type.

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.