#[non_exhaustive]pub enum HostError {
Locked {
path: PathBuf,
},
Io {
path: PathBuf,
source: Error,
},
NeedsCheckpoint {
path: PathBuf,
},
Engine(Error),
Embed(String),
}Expand description
Every way the host layer can fail. Engine failures pass through as
HostError::Engine; everything filesystem- or network-shaped is
typed here.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Locked
The database file is exclusively locked by another process (or another handle in this process). One local database has one owner — open a different file, or drop the other handle.
Io
A filesystem operation failed.
NeedsCheckpoint
There is no published snapshot generation to map: the database has
never been checkpointed, so a read-only open ([crate::Database:: open_readonly]) or a crate::Database::scrub has nothing to point
at. Open it read-write once and checkpoint, then retry.
A dirty journal is not this error. A reader maps the published generation and never reads the journal, which is snapshot isolation: it answers as of the last checkpoint rather than refusing until you take one.
Engine(Error)
The engine returned a typed error.
Embed(String)
The embedder transport or response was unusable (the message names what exactly: status, dimension mismatch, malformed JSON).
Implementations§
Source§impl HostError
impl HostError
Sourcepub fn capacity_hint(&self) -> Option<&'static str>
pub fn capacity_hint(&self) -> Option<&'static str>
The follow-up line for a pool that ran out of room, or None when this
error is something else.
The number in the message is a setting; the setting has a name and one specific trade-off. Callers that talk to a person should print this after the error itself.
Trait Implementations§
Source§impl Error for HostError
impl Error for HostError
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()