Skip to main content

Settings

Struct Settings 

Source
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>

Source

pub fn new() -> Self

Creates settings with no explicit evaluation date set.

Source

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.

Source

pub fn set_evaluation_date(&self, date: D)
where D: Copy + PartialEq,

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.

Source

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.

Source

pub fn register_eval_date_observer( &self, observer: &SharedMut<dyn Observer>, ) -> bool

Registers an observer to be notified on evaluation-date changes.

Source

pub fn include_reference_date_events(&self) -> bool

Whether events on the reference date are, by default, treated as not yet occurred.

Source

pub fn set_include_reference_date_events(&self, value: bool)

Source

pub fn include_todays_cash_flows(&self) -> Option<bool>

Whether cash flows on today’s date enter the NPV, when set.

Source

pub fn set_include_todays_cash_flows(&self, value: Option<bool>)

Source

pub fn enforces_todays_historic_fixings(&self) -> bool

Whether today’s historic fixings are enforced.

Source

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.

Source

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.

Source

pub fn set_using_at_par_coupons(&self, value: bool)

Sets the using_at_par_coupons flag.

Source

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.

Source

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.

Source

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.

Source

pub fn fixing(&self, index_name: &str, date: Date) -> Option<Rate>

The stored fixing of index_name on date, if one was recorded.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<D> Default for Settings<D>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<D> !Freeze for Settings<D>

§

impl<D> !RefUnwindSafe for Settings<D>

§

impl<D> !Send for Settings<D>

§

impl<D> !Sync for Settings<D>

§

impl<D> !UnwindSafe for Settings<D>

§

impl<D> Unpin for Settings<D>
where D: Unpin,

§

impl<D> UnsafeUnpin for Settings<D>
where D: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.