Trait Priceable
pub trait Priceable<R: Scalar>: PricingRiskFactors {
// Required methods
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>;
fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>;
// Provided method
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError> { ... }
}Expand description
A product priced through the seam, in one mode.
One implementation per product, generic over R — never one per mode. A
pricing body written against the mode is the whole point of the seam.
Required Methods§
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
Present value against the resolved market view.
§Errors
PricingError for a missing curve, an unresolvable key, an
out-of-range query, or a product arm the entry point does not serve.
fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
Provided Methods§
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".