Skip to main content

StorageError

Enum StorageError 

Source
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).

Fields

§message: 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

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StorageError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for StorageError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for StorageError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<StorageError> for EngineError

Source§

fn from(e: StorageError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for StorageError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StorageError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.