Enum ScenarioError
#[non_exhaustive]pub enum ScenarioError {
Show 14 variants
UnsupportedSelector {
selector: String,
},
TriangulatedCurve {
selector: String,
sources: Vec<String>,
},
UnsupportedShape {
selector: String,
shape: &'static str,
},
UnquotedPair {
pair: CurrencyPair,
},
NonPositiveVol {
selector: String,
shift: f64,
},
UnsupportedShiftType {
selector: String,
shift_type: ShiftType,
},
NonPositiveSpot {
selector: String,
shift: f64,
},
UnquotedFuture {
selector: String,
},
NonPositivePrice {
selector: String,
shift: f64,
},
NoQuotes {
selector: String,
},
Refit {
selector: String,
source: Box<CalibrationError>,
},
CreditModel {
selector: String,
source: CreditError,
},
Curve(CurveError),
Pricing(PricingError),
}Expand description
Why a scenario cannot be applied to a market.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnsupportedSelector
The leg selects an input kind no shock transform reaches.
TriangulatedCurve
The leg names a triangulated discount key, which holds nothing to move: it is composed from its sources, and moves when they do.
Fields
UnsupportedShape
The selected family cannot carry the shape the leg asks for.
UnquotedPair
An FX leg names a pair the market quotes in neither direction — a cross it only derives, which cannot move alone without breaking the triangulation it is derived by.
Fields
pair: CurrencyPairThe pair as written.
NonPositiveVol
A vol leg takes a node to zero or below.
Fields
UnsupportedShiftType
The selected input cannot move the way the leg’s shift type asks: a curve relatively, or an FX spot absolutely.
NonPositiveSpot
An FX leg moves a spot by −100% or more.
UnquotedFuture
A futures price leg names a contract the market quotes no price for.
NonPositivePrice
A futures price leg takes a price to zero or below.
NoQuotes
A quote leg names a curve pinned with no ladder — a bare curve, a
fitted or jointly solved one, or one re-pinned bare — so it has no
quotes to move. Its hazards move under credit(ENTITY), a rate
curve’s zero rates under its own curve id, instead.
Refit
A curve’s ladder does not solve again at the quotes a leg moved it to, or holds a rung that cannot be re-struck at a quote.
Fields
source: Box<CalibrationError>What the calibration refused.
CreditModel
A tranche model input a leg moved out of its range — a recovery floor
outside [0, 1), a degree of freedom not in (2, ∞).
Curve(CurveError)
A shock curve could not be built.
Pricing(PricingError)
The shocked market could not be valued.
Trait Implementations§
§impl Clone for ScenarioError
impl Clone for ScenarioError
§fn clone(&self) -> ScenarioError
fn clone(&self) -> ScenarioError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ScenarioError
impl Debug for ScenarioError
§impl Display for ScenarioError
impl Display for ScenarioError
§impl Error for ScenarioError
impl Error for ScenarioError
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()