Struct Securities
pub struct Securities {
overlay: HashMap<String, BondStatic>,
floating: HashMap<String, FloatingBondStatic>,
}Expand description
An ISIN-keyed registry resolving a security id to its quote-less static.
Holds two overlays — fixed BondStatics and floating FloatingBondStatics —
so one master resolves both bond kinds, each ISIN to its own kind. The base is
resolved live (base_for, empty for now), so every master shares the one base
and an insert never mutates it. Resolution is overlay ▸ base ▸ absence.
(Not Debug/PartialEq: a FloatingBondStatic carries an IborIndex whose
fixing calendar is a dyn Calendar, which is neither.)
Fields§
§overlay: HashMap<String, BondStatic>§floating: HashMap<String, FloatingBondStatic>Implementations§
§impl Securities
impl Securities
pub fn with_defaults() -> Self
pub fn with_defaults() -> Self
A master seeded from the (empty) base: both overlays start empty and every ISIN falls through to the base until inserted.
pub fn insert(&mut self, isin: impl Into<String>, bond: BondStatic)
pub fn insert(&mut self, isin: impl Into<String>, bond: BondStatic)
Adds a fixed-bond overlay entry for isin, shadowing any base entry. The base
is untouched; another master still resolves isin to the base (absence here).
pub fn insert_floating(
&mut self,
isin: impl Into<String>,
bond: FloatingBondStatic,
)
pub fn insert_floating( &mut self, isin: impl Into<String>, bond: FloatingBondStatic, )
Adds a floating-bond overlay entry for isin.
pub fn resolve(&self, isin: &str) -> Option<BondStatic>
pub fn resolve(&self, isin: &str) -> Option<BondStatic>
The effective fixed BondStatic for isin: the overlay entry if present,
otherwise the base entry, otherwise None (the caller fails loud by id).
pub fn resolve_floating(&self, isin: &str) -> Option<FloatingBondStatic>
pub fn resolve_floating(&self, isin: &str) -> Option<FloatingBondStatic>
The effective floating FloatingBondStatic for isin, or None.
Trait Implementations§
§impl Clone for Securities
impl Clone for Securities
§fn clone(&self) -> Securities
fn clone(&self) -> Securities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more