pub enum CurveInput {
Flat {
rate: f64,
compounding: Compounding,
day_count: DayCountConvention,
},
ZeroRates {
tenors: Vec<Tenor>,
rates: Vec<f64>,
compounding: Compounding,
day_count: DayCountConvention,
interpolation: InterpolationMethod,
},
DiscountFactors {
tenors: Vec<Tenor>,
dfs: Vec<f64>,
compounding: Compounding,
day_count: DayCountConvention,
interpolation: InterpolationMethod,
},
ForwardRates {
tenors: Vec<Tenor>,
forwards: Vec<f64>,
compounding: Compounding,
day_count: DayCountConvention,
interpolation: InterpolationMethod,
},
}Expand description
The accepted input forms for a curve. This is what deserializes from
JSON; every form is canonicalized to discount factors at construction
(YieldCurve::from_input), so pricing code sees a single representation.
Variants§
Flat
A single constant rate for all maturities.
ZeroRates
Zero rates quoted in compounding at the given tenors.
DiscountFactors
Discount factors at the given tenors (compounding only sets the
quoting convention for rate queries on the resulting curve).
ForwardRates
Forward rates, each applying from the previous tenor (or the reference date for the first) to its own tenor.
Trait Implementations§
Source§impl Clone for CurveInput
impl Clone for CurveInput
Source§fn clone(&self) -> CurveInput
fn clone(&self) -> CurveInput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CurveInput
impl Debug for CurveInput
Source§impl<'de> Deserialize<'de> for CurveInput
impl<'de> Deserialize<'de> for CurveInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CurveInput
impl RefUnwindSafe for CurveInput
impl Send for CurveInput
impl Sync for CurveInput
impl Unpin for CurveInput
impl UnsafeUnpin for CurveInput
impl UnwindSafe for CurveInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more