Struct RepoSpreadView
pub struct RepoSpreadView<'a, R: Scalar> {
data: &'a RepoSpread,
params: Cow<'a, [R]>,
}Expand description
RepoSpread lifted into one pricing mode.
Fields§
§data: &'a RepoSpread§params: Cow<'a, [R]>Implementations§
§impl<R: Scalar> RepoSpreadView<'_, R>
impl<R: Scalar> RepoSpreadView<'_, R>
pub fn parameters(&self) -> &[R]
pub fn parameters(&self) -> &[R]
This mode’s parameters — the spreads.
pub fn basis(&self) -> DayCountFraction
pub fn basis(&self) -> DayCountFraction
The money-market basis the spread accrues on.
pub fn accrual(&self, date: NaiveDate) -> Result<f64, CurveError>
pub fn accrual(&self, date: NaiveDate) -> Result<f64, CurveError>
The year fraction from the reference date to date, in the basis.
§Errors
CurveError::BeforeReference for a date before the reference date.
pub fn spread_at(&self, date: NaiveDate) -> Result<R, CurveError>
pub fn spread_at(&self, date: NaiveDate) -> Result<R, CurveError>
The spread at date: linear between pillars, flat outside them.
§Errors
CurveError::BeforeReference for a date before the reference date.
fn spread_at_tau(&self, tau: f64) -> R
fn accrual_factor(&self, date: NaiveDate) -> Result<R, CurveError>
fn accrual_factor(&self, date: NaiveDate) -> Result<R, CurveError>
1 + s(t)·τ(t), refused where it is not positive.
Trait Implementations§
§impl<'a, R: Clone + Scalar> Clone for RepoSpreadView<'a, R>
impl<'a, R: Clone + Scalar> Clone for RepoSpreadView<'a, R>
§fn clone(&self) -> RepoSpreadView<'a, R>
fn clone(&self) -> RepoSpreadView<'a, R>
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 more§impl<'a, R: Debug + Scalar> Debug for RepoSpreadView<'a, R>
impl<'a, R: Debug + Scalar> Debug for RepoSpreadView<'a, R>
§impl<R: Scalar> YieldCurve<R> for RepoSpreadView<'_, R>
impl<R: Scalar> YieldCurve<R> for RepoSpreadView<'_, R>
§fn discount(&self, date: NaiveDate) -> Result<R, CurveError>
fn discount(&self, date: NaiveDate) -> Result<R, CurveError>
The spread over a unit base: 1/(1 + s·τ).
§fn reference_date(&self) -> NaiveDate
fn reference_date(&self) -> NaiveDate
The date at which the discount factor is 1.
§fn log_discount(&self, date: NaiveDate) -> Result<R, CurveError>
fn log_discount(&self, date: NaiveDate) -> Result<R, CurveError>
The log discount factor to
date. Read more§fn discount_at_ordinal(&self, ordinal: i32) -> Result<R, CurveError>
fn discount_at_ordinal(&self, ordinal: i32) -> Result<R, CurveError>
The discount factor to the proleptic-Gregorian day number
ordinal. Read more§fn log_discount_at_ordinal(&self, ordinal: i32) -> Result<R, CurveError>
fn log_discount_at_ordinal(&self, ordinal: i32) -> Result<R, CurveError>
§fn rate_day_count(&self) -> DayCountFraction
fn rate_day_count(&self) -> DayCountFraction
The day count this curve forms a rate under. Read more
§fn zero_rate(&self, date: NaiveDate) -> Result<R, CurveError>
fn zero_rate(&self, date: NaiveDate) -> Result<R, CurveError>
The continuously-compounded zero rate to
date. Read more§fn forward_rate(
&self,
start: NaiveDate,
end: NaiveDate,
) -> Result<R, CurveError>
fn forward_rate( &self, start: NaiveDate, end: NaiveDate, ) -> Result<R, CurveError>
Auto Trait Implementations§
impl<'a, R> Freeze for RepoSpreadView<'a, R>
impl<'a, R> RefUnwindSafe for RepoSpreadView<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for RepoSpreadView<'a, R>
impl<'a, R> Sync for RepoSpreadView<'a, R>
impl<'a, R> Unpin for RepoSpreadView<'a, R>where
R: Unpin,
impl<'a, R> UnsafeUnpin for RepoSpreadView<'a, R>
impl<'a, R> UnwindSafe for RepoSpreadView<'a, R>where
R: RefUnwindSafe + UnwindSafe,
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