Enum AnyIndex
#[non_exhaustive]pub enum AnyIndex {
Overnight(OvernightIndex),
Ibor(IborIndex),
Fx(FxIndex),
Price(PriceIndex),
}Expand description
A registry-resolved index definition, tagged by kind.
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.
Overnight(OvernightIndex)
An overnight (RFR) index.
Ibor(IborIndex)
A term (IBOR) index.
Fx(FxIndex)
An FX-pair index.
Price(PriceIndex)
A price (inflation) index.
Implementations§
§impl AnyIndex
impl AnyIndex
pub fn forecast<R: Scalar>(
&self,
curve: &dyn YieldCurve<R>,
date: NaiveDate,
) -> Result<R, CurveError>
pub fn forecast<R: Scalar>( &self, curve: &dyn YieldCurve<R>, date: NaiveDate, ) -> Result<R, CurveError>
The rate this index quotes for date, projected off curve.
Defined for the two rate kinds only. A price index projects off an
inflation curve under an observation lag and an interpolation rule, and
an FX index off a covered-interest-parity relation
(MarketContext::fx_fixing); each is a
separate seam. Asking either for a rate here is refused naming the
kind rather than answered under a rule that is not theirs — a number
computed by the wrong rule is worse than no number.
§Errors
CurveError::Malformed for a price or FX index; otherwise as
IborIndex::forecast and OvernightIndex::forecast.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AnyIndex
impl !UnwindSafe for AnyIndex
impl Freeze for AnyIndex
impl Send for AnyIndex
impl Sync for AnyIndex
impl Unpin for AnyIndex
impl UnsafeUnpin for AnyIndex
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