Enum MarketDataError
#[non_exhaustive]pub enum MarketDataError {
MissingFixing {
index: Box<str>,
date: NaiveDate,
},
MissingFxRate {
pair: Box<str>,
},
ParameterCountMismatch {
expected: usize,
given: usize,
},
Malformed(&'static str),
UnknownFixingIndex(Box<UnknownFixingIndexError>),
}Expand description
A market-data lookup that cannot be answered.
Distinct from a curve error: this is about a value that was never supplied, not a query a curve could not answer. Both are typed, and neither is a panic.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingFixing
No fixing was published for this index on this date.
The name is a Box<str> rather than a String: it is never grown,
and the narrower field keeps this enum — and every Result carrying
it through a coupon projection — at 24 bytes.
MissingFxRate
No FX rate was supplied for this pair.
ParameterCountMismatch
A substituted lift was handed a parameter vector of the wrong length.
Malformed(&'static str)
The store was built with contradictory or malformed entries.
UnknownFixingIndex(Box<UnknownFixingIndexError>)
An observation was published under a spelling that keys nothing: not a
registered index code in its registered casing, and not a well-formed
FX key. Boxed for the same reason MissingFixing narrows its field —
the enum, and every Result carrying it, stays at 24 bytes.
Implementations§
§impl MarketDataError
impl MarketDataError
pub fn missing_input(&self) -> Option<(&'static str, String)>
pub fn missing_input(&self) -> Option<(&'static str, String)>
The value this lookup found missing, as the (kind, key) row
MarketContext::contents
lists once it is supplied: ("fixing", "INDEX@DATE") or
("fx", "BASE/QUOTE"). None for a refusal that is not a missing
value. Exhaustive, so a new variant does not compile until someone
decides.
Trait Implementations§
§impl Clone for MarketDataError
impl Clone for MarketDataError
§fn clone(&self) -> MarketDataError
fn clone(&self) -> MarketDataError
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 MarketDataError
impl Debug for MarketDataError
§impl Display for MarketDataError
impl Display for MarketDataError
impl Eq for MarketDataError
§impl Error for MarketDataError
impl Error for MarketDataError
1.30.0 · Source§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()