pub enum BackendError {
Sealed,
Io(Error),
HashMismatch {
current: CommitId,
},
Path(String),
Other(String),
ParentMismatch {
expected: String,
actual: String,
},
}Expand description
Errors surfaced by MemBackend.
The Sealed variant is the typed read-only signal — backends
that physically cannot write (archive) return it from every
mutating method. Callers (the engine’s mutation pipeline) branch
on the discriminant before reaching the backend; a Sealed
reaching this layer is a programming error in the upstream
capability check.
Variants§
Sealed
Backend physically rejects writes. Returned by the archive backend and any future read-only backend (e.g. registry pin).
Io(Error)
Filesystem IO failure.
HashMismatch
Commit-time CAS conflict: the backend snapshotted parent commit
X at write time, but by commit time the underlying store has
advanced to current. Raised by backends that perform
commit-tip CAS (the git-tree backend); the engine maps it onto
its HashMismatch envelope so agents see one HASH_MISMATCH
code whether the conflict was detected at the entity-hash level
or at the commit level.
Fields
Path(String)
Path-related rejection that does not map onto the IO case: an empty relative path, a path that escapes the mem root, a move whose source is missing or whose target is already pending.
Other(String)
Backend-specific failure not modelled by the variants above. Carries an agent-readable message; structured backend errors add their own variant.
ParentMismatch
Parent-ref pinning guard tripped on
MemBackend::commit_with_expected_parent — the backend’s
current head no longer matches the caller’s expected_parent.
A sibling writer (another Engine instance, an out-of-band
git pull, a manual git operation) advanced the on-disk state
between the snapshot the caller pinned and now. The engine
layer maps this into MEM_RELOADED /
RENAME_PARTIAL_FAILURE depending on whether other mems
already committed in the same logical operation. Today only
the git-branch backend (planned override) produces this
variant; folder and archive backends inherit the default impl
of commit_with_expected_parent which delegates to commit
without parent checking.
Trait Implementations§
Source§impl Debug for BackendError
impl Debug for BackendError
Source§impl Display for BackendError
impl Display for BackendError
Source§impl Error for BackendError
impl Error for BackendError
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()
Source§impl From<BackendError> for EngineError
impl From<BackendError> for EngineError
Source§fn from(e: BackendError) -> Self
fn from(e: BackendError) -> Self
One HASH_MISMATCH for both detection levels: a commit-tip CAS
conflict raised by the backend (the git-tree backend’s
commit) maps onto the entity-level envelope, carrying the
live tip as current; the entity id is unknown at the backend
layer, so the envelope names the mem-level conflict instead.
Everything else stays a typed backend failure.
Auto Trait Implementations§
impl !RefUnwindSafe for BackendError
impl !UnwindSafe for BackendError
impl Freeze for BackendError
impl Send for BackendError
impl Sync for BackendError
impl Unpin for BackendError
impl UnsafeUnpin for BackendError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more