Skip to main content

CashflowError

Enum CashflowError 

#[non_exhaustive]
pub enum CashflowError {
Show 13 variants Curve(CurveError), MarketData(MarketDataError), MissingContractRate, NoCurveForIndex { index: String, }, InterpolatedStubOnOneCurve { tenors: Box<(String, String)>, }, PayoffWithoutCapVols { currency: Currency, }, PayoffWithoutYoyVols { index: String, }, PayoffWithoutCpiVols { index: String, }, PayoffNotLognormal, NoIndexForCoupon { index: String, }, MalformedPayoff(PayoffError), CmsWithoutSwaptionVols { currency: Currency, }, CmsRefused { detail: String, },
}
Expand description

A cashflow that cannot be produced or valued.

Two sources, kept apart: a curve that could not answer a query, and market data that was never supplied. A missing historical reset is the second, and conflating it with the first would make it look like an extrapolation problem.

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

Curve(CurveError)

A curve could not answer a query.

§

MarketData(MarketDataError)

A market-data lookup could not be answered.

§

MissingContractRate

A leg accruing one contract rate over its period holds a coupon that carries no such rate — a floating coupon on a fixed zero leg.

§

NoCurveForIndex

An unfixed floating coupon must project, and the curves it was priced against hold none for its index. Named so a leg on two indices says which one it lacked.

Fields

§index: String

The index the coupon names.

§

InterpolatedStubOnOneCurve

A stub electing ISDA 2006 §8.3 Linear Interpolation reads two tenors’ curves, and it was valued through one. Refused rather than blending one curve with itself.

Fields

§tenors: Box<(String, String)>

The Designated Maturities next shorter and next longer than the stub. Boxed: the error rides every query’s Result, which is kept narrow.

§

PayoffWithoutCapVols

A coupon still to fix with an option on its rate — a cap, a floor, a digital — is worth its optionlets, and the source it was valued through holds no cap vols for its currency.

Fields

§currency: Currency

The coupon’s currency.

§

PayoffWithoutYoyVols

A year-on-year inflation coupon still to fix with an option on its rate is worth its YoY optionlets, and the source it was valued through holds no YoY vols for its price index.

Fields

§index: String

The price index the coupon names.

§

PayoffWithoutCpiVols

A CPI notional still to fix with an option on its growth is worth its zero-coupon optionlets, and the source it was valued through holds no zero-coupon CPI vols for its price index.

Fields

§index: String

The price index the notional names.

§

PayoffNotLognormal

A coupon’s option could not be valued: a lognormal surface met a non-positive forward or strike.

§

NoIndexForCoupon

A CPI coupon reads a price index, and the source it was valued through holds neither a print nor a curve for it.

Fields

§index: String

The price index the coupon names.

§

MalformedPayoff(PayoffError)

A coupon’s option on its rate is not a payoff — built around its checked constructor with a floor above its cap, say.

§

CmsWithoutSwaptionVols

A CMS coupon still to fix is worth its replication off the swaption smile, and the source it was valued through holds no swaption vols for its currency — a curve source is not a vol source.

Fields

§currency: Currency

The coupon’s currency.

§

CmsRefused

A CMS coupon’s valuation was refused for a reason the pricing view named: an unregistered swap index, a lognormal smile on a non-positive forward.

Fields

§detail: String

What the view said.

Trait Implementations§

§

impl Clone for CashflowError

§

fn clone(&self) -> CashflowError

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 CashflowError

§

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

Formats the value using the given formatter. Read more
§

impl Display for CashflowError

§

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

Formats the value using the given formatter. Read more
§

impl Error for CashflowError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
§

impl From<CashflowError> for PricingError

§

fn from(e: CashflowError) -> Self

Converts to this type from the input type.
§

impl From<CurveError> for CashflowError

§

fn from(e: CurveError) -> Self

Converts to this type from the input type.
§

impl From<MarketDataError> for CashflowError

§

fn from(e: MarketDataError) -> Self

Converts to this type from the input type.
§

impl PartialEq for CashflowError

§

fn eq(&self, other: &CashflowError) -> 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 CashflowError

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.