#[non_exhaustive]pub enum Error {
Show 13 variants
Refused {
backend: &'static str,
missing: Vec<Missing>,
},
NotDeclared(Need),
NotFound(String),
AlreadyExists(String),
Backend(String),
Corrupt(String),
KindMismatch {
expected: &'static str,
found: String,
},
SchemaUnsupported {
kind: &'static str,
found: u32,
expected: u32,
},
UpgradeFailed {
kind: &'static str,
from: u32,
expected: u32,
detail: String,
},
Encode(String),
Injected(String),
Panicked(String),
Reentrant,
}Expand description
Everything that can go wrong in PersistAnt.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Refused
The backend cannot give every declared need. Raised at open, before any data is touched.
Fields
NotDeclared(Need)
An operation was used whose need was never declared at open.
NotFound(String)
read or stat found no value at this key (the key is given). A disk or network failure is
Error::Backend instead.
AlreadyExists(String)
create_if_absent found a value already at this key (the key is given); nothing was
written.
Backend(String)
The backend failed; the text is the backend’s own message.
Corrupt(String)
Stored bytes are not a record envelope (not JSON, or fields missing).
KindMismatch
The stored record is of another kind than the one asked for.
SchemaUnsupported
The stored schema version is one the program cannot read: newer than it knows, or older with no upgrade path.
Fields
UpgradeFailed
An older record was upgraded, but the result does not fit the current type. Either the
stored data was damaged, or crate::Record::upgrade did not bring it all the way to
SCHEMA (upgraded data carries no schema marker, so the two cannot be told apart).
Fields
Encode(String)
A record could not be turned into bytes.
Injected(String)
A failure produced on purpose by the fault-injecting fake.
Panicked(String)
An operation panicked on the blocking facade’s worker thread. The text is the panic message when it was a string, otherwise a placeholder. The store stays usable.
Reentrant
A blocking::Store call was made from a thread that is a blocking facade’s own worker.
Waiting there for a reply would park the worker on itself, so the call is refused instead
of deadlocking; use the async crate::Store in code that runs on a worker.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()