pub enum BootstrapError {
InstrumentsNotOrdered {
at_index: usize,
},
NonIncreasingAnchor {
at_index: usize,
},
LegDidNotConverge {
at_index: usize,
residual: f64,
},
NoBracket {
at_index: usize,
},
InvalidInstrument {
at_index: usize,
reason: &'static str,
},
Curve(CurveError),
Type(TypeError),
}Expand description
Error returned by the bootstrap engine.
§Examples
use regit_curves::errors::BootstrapError;
let err = BootstrapError::LegDidNotConverge { at_index: 3, residual: 1.2e-9 };
let msg = format!("{err}");
assert!(msg.contains("3"));
assert!(msg.contains("converge"));Variants§
InstrumentsNotOrdered
Instruments are not ordered by their primary anchor time, or two instruments share an anchor with no resolution rule.
NonIncreasingAnchor
An instrument’s primary anchor is on or before the previous anchor.
LegDidNotConverge
The leg solver did not converge to a discount factor that re-prices
the instrument within tolerance after max_iterations.
Fields
NoBracket
Brent could not bracket a root for the leg.
InvalidInstrument
An instrument quote violates a domain constraint (rate not finite, negative when a positive value is required, etc.).
Fields
Curve(CurveError)
A curve error surfaced while building the interim curve.
Type(TypeError)
A type error surfaced.
Trait Implementations§
Source§impl Clone for BootstrapError
impl Clone for BootstrapError
Source§fn clone(&self) -> BootstrapError
fn clone(&self) -> BootstrapError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BootstrapError
Source§impl Debug for BootstrapError
impl Debug for BootstrapError
Source§impl Display for BootstrapError
impl Display for BootstrapError
Source§impl Error for BootstrapError
impl Error for BootstrapError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<CurveError> for BootstrapError
impl From<CurveError> for BootstrapError
Source§fn from(e: CurveError) -> Self
fn from(e: CurveError) -> Self
Converts to this type from the input type.
Source§impl From<TypeError> for BootstrapError
impl From<TypeError> for BootstrapError
Source§impl PartialEq for BootstrapError
impl PartialEq for BootstrapError
impl StructuralPartialEq for BootstrapError
Auto Trait Implementations§
impl Freeze for BootstrapError
impl RefUnwindSafe for BootstrapError
impl Send for BootstrapError
impl Sync for BootstrapError
impl Unpin for BootstrapError
impl UnsafeUnpin for BootstrapError
impl UnwindSafe for BootstrapError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more