pub enum StorageError {
Show 18 variants
NodeNotFound(i64),
RelationshipNotFound(i64),
NodeHasRelationships(i64),
ConstraintViolation(String),
IndexAlreadyExists(String),
IndexNotFound(String),
ConstraintAlreadyExists(String),
ConstraintNotFound(String),
TransactionsUnsupported,
TransactionAlreadyActive,
NoActiveTransaction,
PersistenceOutcomeIndeterminate(String),
Io {
kind: ErrorKind,
message: String,
},
Corruption(String),
Conflict(String),
Locked(String),
ReadOnly(String),
Other(String),
}Expand description
Errors that can occur in the storage layer.
Variants§
NodeNotFound(i64)
A referenced node was not found.
RelationshipNotFound(i64)
A referenced relationship was not found.
NodeHasRelationships(i64)
Cannot delete a node that still has relationships.
ConstraintViolation(String)
A uniqueness or existence constraint was violated.
IndexAlreadyExists(String)
An index with the given name already exists.
IndexNotFound(String)
No index found with the given name.
ConstraintAlreadyExists(String)
A constraint with the given name already exists.
ConstraintNotFound(String)
No constraint found with the given name.
TransactionsUnsupported
The selected backend cannot provide transactional semantics.
TransactionAlreadyActive
A transaction is already active on this store.
NoActiveTransaction
No transaction is active on this store.
PersistenceOutcomeIndeterminate(String)
Persistence was published before a rollback-restoration failure made the durable outcome unknowable. The store is poisoned and must not be used or reopened until its files are explicitly discarded.
Io
A filesystem / I/O failure (open, read, write, sync, rename, remove).
io::Error is neither Clone nor PartialEq, so the raw error is not
carried; instead the classifying std::io::ErrorKind is kept
alongside a fully-rendered message (which already embeds the original
error’s text, so Display is unchanged from the old Other string).
Corruption(String)
A database file could not be decoded: its stored bytes are not the
expected on-disk format (e.g. malformed JSON). Distinct from [Io],
which is a filesystem failure; a Corruption means the file was read
but its contents are unusable.
Conflict(String)
A requested operation conflicts with the store’s current state (e.g. flushing while an explicit transaction is still open).
Locked(String)
The database file is already open (exclusively locked) by another live process. Carries the database path. The store refuses to open rather than risk two writers clobbering each other; there is no read-only fallback.
ReadOnly(String)
A mutation was attempted against a read-only snapshot of the store — today, a backend checked out to a historical MVCC version. Carries a human-readable explanation. The store rejects the write rather than silently destroying history by overwriting HEAD with the snapshot.
Other(String)
A generic error that fits no more specific variant.
Implementations§
Source§impl StorageError
impl StorageError
Sourcepub fn io(error: &Error, message: String) -> Self
pub fn io(error: &Error, message: String) -> Self
Build an StorageError::Io from a raw std::io::Error, capturing
its std::io::ErrorKind and a caller-provided message that already
embeds the error text.
Trait Implementations§
Source§impl Clone for StorageError
impl Clone for StorageError
Source§impl Debug for StorageError
impl Debug for StorageError
Source§impl Display for StorageError
impl Display for StorageError
Source§impl Error for StorageError
impl Error for StorageError
1.30.0 · 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()