Struct RecipeSpec
pub struct RecipeSpec {
pub key: CollateralSpec,
pub currency: String,
pub discount: Vec<(Role, String)>,
pub projection: BTreeMap<String, ProjectionSpec>,
pub windows: Vec<WindowSpec>,
pub via: Option<String>,
}Expand description
A curve recipe stated as data: the collateral key it builds under, the currency, the discount segments in order, a source per projection index, the windows, and an optional triangulation hub.
Fields§
§key: CollateralSpecThe collateral key the recipe builds the discount curve for.
currency: StringThe currency the recipe builds for.
discount: Vec<(Role, String)>The discount segments, in the order the sheet reads them.
projection: BTreeMap<String, ProjectionSpec>Per projection index, how it is sourced.
windows: Vec<WindowSpec>The windows fixed whatever the sheet says.
via: Option<String>The hub a triangulated discount is derived through.
Implementations§
§impl RecipeSpec
impl RecipeSpec
pub fn new(key: CollateralSpec, currency: impl Into<String>) -> Self
pub fn new(key: CollateralSpec, currency: impl Into<String>) -> Self
An empty spec for currency under key.
pub fn to_recipe(&self) -> Result<CurveRecipe, RecipeSpecError>
pub fn to_recipe(&self) -> Result<CurveRecipe, RecipeSpecError>
The recipe this spec states, built through the recipe’s own builder.
A strip whose template is an NDS is declared as an NDS strip; any other as a swap strip — which is the only way the builder says either.
§Errors
RecipeSpecError::Template where the builder refuses a template.
pub fn of(key: CollateralSpec, recipe: &CurveRecipe) -> Self
pub fn of(key: CollateralSpec, recipe: &CurveRecipe) -> Self
The spec stating recipe under key — the inverse of
to_recipe.
Trait Implementations§
§impl Clone for RecipeSpec
impl Clone for RecipeSpec
§fn clone(&self) -> RecipeSpec
fn clone(&self) -> RecipeSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more