pub trait Curves<C> {
// Required methods
fn new(dates: &[Date], rates: &[f64]) -> Self;
fn initial_date(&self) -> Date;
fn terminal_date(&self) -> Date;
fn get_rate(&mut self, date: Date) -> f64;
fn get_rates(&mut self, dates: &[Date]) -> Vec<f64>;
fn insert_rate(&mut self, date: Date, rate: f64);
fn fit(&mut self) -> Result<(), Error>;
fn plot(&self);
}Expand description
Generic trait for curves.
Required Methods§
Sourcefn new(dates: &[Date], rates: &[f64]) -> Self
fn new(dates: &[Date], rates: &[f64]) -> Self
Create a new curve from a set of Dates and rates (f64s).
Sourcefn initial_date(&self) -> Date
fn initial_date(&self) -> Date
Get the initial date of the curve.
Sourcefn terminal_date(&self) -> Date
fn terminal_date(&self) -> Date
Get the terminal date of the curve.
Sourcefn insert_rate(&mut self, date: Date, rate: f64)
fn insert_rate(&mut self, date: Date, rate: f64)
Insert a new rate into the curve.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.