pub enum CoreError {
Cancelled(Option<String>),
Encoding(String),
MissingEnv(String),
Io(Error),
}Expand description
The closed error vocabulary for indusagi-core primitives.
Variants§
Cancelled(Option<String>)
A cooperative cancellation was observed. Carries an optional reason for
diagnostics; the byte-exact Display is cancelled when no reason is set
(mirrors the Python CancelledByToken default message).
Encoding(String)
A value could not be canonically encoded for hashing (a non-finite number
is not an error — it folds to null — so this is reserved for shapes
the encoder genuinely cannot represent).
MissingEnv(String)
A required environment variable was absent or empty.
Io(Error)
A filesystem location could not be prepared.
Implementations§
Source§impl CoreError
impl CoreError
Sourcepub fn cancelled() -> Self
pub fn cancelled() -> Self
Construct a CoreError::Cancelled with no reason.
Sourcepub fn cancelled_with(reason: impl Into<String>) -> Self
pub fn cancelled_with(reason: impl Into<String>) -> Self
Construct a CoreError::Cancelled carrying reason.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
True iff this is a cancellation error. Lets call sites branch on
“was this a cancel?” without a full match.
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
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()