#[non_exhaustive]pub enum StorageError {
Show 16 variants
Open,
Read,
Write,
Delete,
Scan,
Flush,
Codec,
Meta,
Migrate,
Path,
Depth,
CommitFailed,
Taken,
Closed,
Notify,
Reentrant,
}Expand description
What a store operation failed at.
Each variant names the operation that failed. Which engine said what is the frame below this one in the report, and the particulars - which path, which file, which prefix - are attachments put there by whoever knew them. Two engines failing to write are the same kind of failure, told apart by the frames underneath.
non_exhaustive where the sets that carry it are not: this one is the
disk’s own list and grows with the engines, and nobody is meant to match it
arm by arm. The sets are the opposite - a match over one is meant to be
complete, and gaining a way to fail is meant to break it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Open
Opening or creating the store.
Read
Reading a value.
Write
Writing a value.
Delete
Removing a key or a subtree.
Scan
Listing what is under a prefix.
Flush
Getting what is buffered onto disk.
Codec
Turning a value into the store’s format, or reading it back.
Meta
Reading or writing the schema bookkeeping - versions, snapshots, the migration log, the initialization markers.
Migrate
Bringing stored data up to the schema the code declares.
Path
A name that cannot be a level, so nothing can be stored under it.
Depth
A path or a value that nests deeper than this store reads back.
Told apart from StorageError::Path because the names are all fine:
what is wrong is how many of them there are, and the facts say which
budget ran out and by how much.
CommitFailed
The flush this commit was waiting on did not complete.
Taken
Two owners want the same place, so one would write over the other.
Closed
The store was closed and has let go of its file.
A close hands the file to whoever asked for it - another process, a backup, a rename - and it stays theirs, so every later read, write, scan and delete answers with this.
Notify
The change was stored, and somebody subscribed to it could not take it.
The write landed: this is about what happened while telling people. A field that cannot read back what was just written to its path answers with this, which is how the writer finds out that what it stored is not what that field holds.
Reentrant
Asked for from inside something the store is already doing, where doing it would mean waiting for the caller to finish.
Closing from on_persist_failure is the one that reaches here: that
callback runs on the thread a close has to wait for.
Trait Implementations§
Source§impl Clone for StorageError
impl Clone for StorageError
impl Copy for StorageError
Source§impl Debug for StorageError
impl Debug for StorageError
Source§impl Display for StorageError
impl Display for StorageError
impl Eq 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()