pub struct Settings<D> { /* private fields */ }Expand description
Run-time settings governing pricing.
D is the evaluation-date payload (a Date once EPIC-2 is ported).
Implementations§
Source§impl<D> Settings<D>
impl<D> Settings<D>
Sourcepub fn evaluation_date(&self) -> Option<D>where
D: Copy,
pub fn evaluation_date(&self) -> Option<D>where
D: Copy,
The currently set evaluation date, if any.
None corresponds to QuantLib’s “use today’s date” default; the
concrete today’s-date fallback is resolved by the caller once Date
exists.
Sourcepub fn set_evaluation_date(&self, date: D)
pub fn set_evaluation_date(&self, date: D)
Sets the evaluation date, notifying observers only if it actually changed.
The new date is in place before the notification goes out, so an
observer reading it back through evaluation_date
sees the value that triggered its update.
Sourcepub fn reset_evaluation_date(&self)
pub fn reset_evaluation_date(&self)
Resets the evaluation date to the floating “use today’s date” state, notifying observers only if a concrete date had been set.
Mirrors QuantLib’s resetEvaluationDate() (which assigns the null
Date()). Its companion anchorEvaluationDate() is deferred until
EPIC-2 provides a concrete today’s-date for the payload type.
Sourcepub fn register_eval_date_observer(
&self,
observer: &SharedMut<dyn Observer>,
) -> bool
pub fn register_eval_date_observer( &self, observer: &SharedMut<dyn Observer>, ) -> bool
Registers an observer to be notified on evaluation-date changes.
Sourcepub fn include_reference_date_events(&self) -> bool
pub fn include_reference_date_events(&self) -> bool
Whether events on the reference date are, by default, treated as not yet occurred.
Sourcepub fn set_include_reference_date_events(&self, value: bool)
pub fn set_include_reference_date_events(&self, value: bool)
Sets the include_reference_date_events flag.
Sourcepub fn include_todays_cash_flows(&self) -> Option<bool>
pub fn include_todays_cash_flows(&self) -> Option<bool>
Whether cash flows on today’s date enter the NPV, when set.
Sourcepub fn set_include_todays_cash_flows(&self, value: Option<bool>)
pub fn set_include_todays_cash_flows(&self, value: Option<bool>)
Sets the include_todays_cash_flows flag.
Sourcepub fn enforces_todays_historic_fixings(&self) -> bool
pub fn enforces_todays_historic_fixings(&self) -> bool
Whether today’s historic fixings are enforced.
Sourcepub fn set_enforces_todays_historic_fixings(&self, value: bool)
pub fn set_enforces_todays_historic_fixings(&self, value: bool)
Sets the enforces_todays_historic_fixings flag.
The today’s-fixing rule this flag governs (whether a missing fixing on
the evaluation date is an error or a forecast) is applied by the index
layer that reads the store, not by the store itself - as in QuantLib,
where IndexManager records fixings and InterestRateIndex::fixing
consults the flag.
Sourcepub fn using_at_par_coupons(&self) -> bool
pub fn using_at_par_coupons(&self) -> bool
Whether ibor coupons forecast as par coupons rather than indexed coupons.
The explicit, per-Settings port of QuantLib’s IborCoupon::Settings
singleton (iborcoupon.hpp:110), which D5 forbids: the mode lives here
alongside the evaluation date and the D11 fixing store rather than in
global state. The default is true (par), matching this tree’s
compile-time default (usingAtParCoupons_ = true), so forecast-over-curve
oracles reproduce out of the box. The par/indexed split governs only the
forecast branch of IborCoupon;
a determined fixing is mode-independent.
Sourcepub fn set_using_at_par_coupons(&self, value: bool)
pub fn set_using_at_par_coupons(&self, value: bool)
Sets the using_at_par_coupons flag.
Sourcepub fn register_fixing_observer(
&self,
index_name: &str,
observer: &SharedMut<dyn Observer>,
) -> bool
pub fn register_fixing_observer( &self, index_name: &str, observer: &SharedMut<dyn Observer>, ) -> bool
Registers an observer to be notified when a fixing of index_name is
added or cleared.
Sourcepub fn add_fixing(
&self,
index_name: &str,
date: Date,
rate: Rate,
) -> QlResult<()>
pub fn add_fixing( &self, index_name: &str, date: Date, rate: Rate, ) -> QlResult<()>
Records a single past fixing for index_name, notifying its observers.
See add_fixings for the overwrite rule.
Sourcepub fn add_fixings(
&self,
index_name: &str,
fixings: impl IntoIterator<Item = (Date, Rate)>,
) -> QlResult<()>
pub fn add_fixings( &self, index_name: &str, fixings: impl IntoIterator<Item = (Date, Rate)>, ) -> QlResult<()>
Records several past fixings for index_name, notifying its observers once.
A fixing that repeats an existing date with a close value is a no-op;
one that conflicts with a stored value is rejected (mirroring
IndexManager::addFixings’ duplicated-fixing guard) and leaves the store
unchanged. The observers of index_name are notified only once the store
has been updated and its borrow released, so an observer reading a fixing
back from its update sees the new value.
Sourcepub fn fixing(&self, index_name: &str, date: Date) -> Option<Rate>
pub fn fixing(&self, index_name: &str, date: Date) -> Option<Rate>
The stored fixing of index_name on date, if one was recorded.
Sourcepub fn has_historical_fixing(&self, index_name: &str, date: Date) -> bool
pub fn has_historical_fixing(&self, index_name: &str, date: Date) -> bool
Whether a fixing of index_name is on record for date.
Mirrors IndexManager::hasHistoricalFixing.
Sourcepub fn clear_fixing(&self, index_name: &str)
pub fn clear_fixing(&self, index_name: &str)
Clears the recorded fixings of a single index, notifying its observers.
Mirrors IndexManager::clearHistory, which notifies unconditionally.
Sourcepub fn clear_fixings(&self)
pub fn clear_fixings(&self)
Clears every recorded fixing, notifying the observers of each index that had a history.
Mirrors IndexManager::clearHistories. The per-index notifiers survive,
so an observer registered before the clear still hears later fixings.