Struct quantmath::data::fixings::FixingTable [−][src]
pub struct FixingTable { /* fields omitted */ }
A fixing table is a collection of fixing curves, keyed by instrument id.
Methods
impl FixingTable
[src]
impl FixingTable
pub fn from_fixings(
fixings_known_until: Date,
fixings: &[(&str, &[(DateTime, f64)])]
) -> Result<FixingTable, Error>
[src]
pub fn from_fixings(
fixings_known_until: Date,
fixings: &[(&str, &[(DateTime, f64)])]
) -> Result<FixingTable, Error>
Creates a fixing table, given a date to which fixings are known and an array of fixing curve data keyed by instrument id.
pub fn from_iter_known_until<T, U, V>(
fixings_known_until: Date,
iter: T
) -> Result<FixingTable, Error> where
T: IntoIterator<Item = (U, V)>,
U: AsRef<str>,
V: AsRef<[(DateTime, f64)]>,
[src]
pub fn from_iter_known_until<T, U, V>(
fixings_known_until: Date,
iter: T
) -> Result<FixingTable, Error> where
T: IntoIterator<Item = (U, V)>,
U: AsRef<str>,
V: AsRef<[(DateTime, f64)]>,
Creates a fixing table from a source such as a HashMap iterator, or an iterator from a slice of pairs of ids and slices of Date
pub fn new(fixings_known_until: Date) -> FixingTable
[src]
pub fn new(fixings_known_until: Date) -> FixingTable
Creates an empty fixing table, given a date to which fixings are known.
pub fn insert(&mut self, id: &str, fixings: Fixings) -> Result<(), Error>
[src]
pub fn insert(&mut self, id: &str, fixings: Fixings) -> Result<(), Error>
Adds a fixings curve
pub fn get(&self, id: &str, date_time: DateTime) -> Result<Option<f64>, Error>
[src]
pub fn get(&self, id: &str, date_time: DateTime) -> Result<Option<f64>, Error>
Tries to get a fixing for the given instrument and date. Returns None if it was absent today, or an error if it was absent in the past.
pub fn get_optional(&self, id: &str, date_time: DateTime) -> Option<f64>
[src]
pub fn get_optional(&self, id: &str, date_time: DateTime) -> Option<f64>
Tries to get a fixing for the given instrument and date. Returns None if the fixing is not found.
pub fn get_fixings(&self, id: &str) -> Option<&Fixings>
[src]
pub fn get_fixings(&self, id: &str) -> Option<&Fixings>
Tries to get an entire fixing curve by id. Return None if there is none.
pub fn fixings_known_until(&self) -> Date
[src]
pub fn fixings_known_until(&self) -> Date
Gets the date to which fixings are known. Fixings on this date may or may not be known.
Trait Implementations
impl Debug for FixingTable
[src]
impl Debug for FixingTable
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for FixingTable
[src]
impl Clone for FixingTable
fn clone(&self) -> FixingTable
[src]
fn clone(&self) -> FixingTable
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for FixingTable
impl Send for FixingTable
impl Sync for FixingTable
impl Sync for FixingTable