#[non_exhaustive]pub enum Error {
Id(IdError),
Codec(CodecError),
Store(StoreError),
Object(ObjectError),
Repo(RepoError),
Sign(SignError),
}Expand description
Top-level error type returned by mnem-core public APIs.
Variants are intentionally coarse-grained. Each module’s native error type carries the detail; this top-level enum exists so callers can match on category without depending on every sub-module’s error shape.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Id(IdError)
An identity primitive (stable ID, multihash, CID, link) was malformed.
Codec(CodecError)
A canonical-encoding round-trip failed.
Store(StoreError)
A blockstore operation (has/get/put/delete) failed.
Object(ObjectError)
An object (Node/Edge/Tree/Commit/…) was malformed or invalid.
Repo(RepoError)
A repository-level operation failed (init, open, commit, …).
Sign(SignError)
A signing or verification operation failed.
Implementations§
Source§impl Error
impl Error
Sourcepub const fn is_uninitialized(&self) -> bool
pub const fn is_uninitialized(&self) -> bool
true iff this error means “the op-heads store is empty; call
crate::repo::ReadonlyRepo::init first”. Callers typically
use it to decide whether to auto-initialise vs. propagate.
Prefer this over stringly-typed format!("{e}").contains(...)
matches: the latter silently breaks on any wording change.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()