Trait CoreError
pub(crate) trait CoreError: Display {
// Required method
fn raise(&self, message: String) -> PyErr;
// Provided methods
fn is_caller_input(&self) -> bool { ... }
fn cause(&self) -> Option<&(dyn Error + 'static)> { ... }
}Expand description
A core error that knows which exception it raises as.
The mapping is by type, then by the core’s own classifiers, so the
compiler — not a string match — decides the exception class: a new core
error type is a compile error here until it is placed, and a new variant is
a compile error in the core’s exhaustive classifier (missing_input,
is_unsolved, is_unconverged, lacks_ladder) until it is classified.
The message is the core’s own rendering: a typed core error already names
the curve, the date or the key it is about, and restating it here would
give the Python user a worse message than the Rust one.
Required Methods§
Provided Methods§
fn is_caller_input(&self) -> bool
fn is_caller_input(&self) -> bool
Whether this failure is the caller’s input rather than the layer’s own
— raised as ValueError whatever the layer, with the core’s text.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".