pub enum PimdirError {
Show 13 variants
Sql(Error),
Io(Error),
Json(Error),
Action(PimdirActionError),
Rebind {
collection: String,
link_id: String,
source: String,
bound: String,
incoming: String,
},
Version {
found: i64,
},
Uncreated,
VersionMismatch {
user_version: i64,
store_meta: i64,
},
Unreconcilable {
table: &'static str,
},
HashAlgo {
found: String,
declared: Option<&'static str>,
},
Busy,
Owned(PathBuf),
Staging(PathBuf),
}client only.Expand description
Everything that can go wrong servicing the seam.
Variants§
Sql(Error)
The SQLite index refused a statement, or the connection itself failed.
Io(Error)
The blob directory refused a read, a write or a rename.
Json(Error)
JSON encoding failed at the storage seam, the link id array a
lookup hands to SQLite; a malformed queue payload reports as
Action.
Action(PimdirActionError)
A queue action payload is malformed or unsupported (spec §15.3).
Rebind
A write resolved an existing (collection, link_id, source)
binding to a different handle, and was refused (spec §10).
A binding pins one handle, so applying it would repoint the
binding from the copy it held to another, which is where the
evidence of a source holding one identity twice used to die. The
second copy is an item of its own under a minted key (spec §9),
which is what makes refusing a complete answer: nothing is
recorded in the incoming handle’s place. The one licensed rebind
is the handle-space rebuild (spec §12), whose Superseded drop
names the handle it replaces.
Fields
Version
The store’s schema version is not one this crate services: it was written by a newer crate, or by a draft this one no longer reads. Such a store is recreated, never migrated.
Uncreated
The store has no schema yet, and this opener does not create one. A producer and a reader both require the owner to have opened it first, which is the write that creates the database.
VersionMismatch
The store’s two schema stamps disagree, which spec §4.2 defines as
corruption: PRAGMA user_version and store_meta.version mirror
one another, so a store where they differ was half-written.
Fields
Unreconcilable
The store was created by a draft whose foreign keys lack the
ON UPDATE CASCADE a rename depends on (spec §14), which no
ALTER TABLE can add. Spec §6’s other branch applies: the
operator recreates the store, a resync of a derived cache.
HashAlgo
The store’s store_meta.hash_algo is not one this crate computes,
or not the one the caller declared. Either way the handle would
name bodies the store does not use, so it is refused (spec §5).
Fields
Busy
Another writer holds the store’s single write lock (§8); the caller retries once that writer is done.
Owned(PathBuf)
Another process owns the store (§8), which this one asked to own too. Reported as soon as the lock is refused rather than waited out: a wait long enough to outlast a sync is a stall with no signal, and the caller is the only layer that can choose between retrying, backing off, queueing the intent and telling the user.
Staging(PathBuf)
A producer is between its blob write and the enqueue that pins it (§8), so a collector cannot run: the body it just wrote is referenced by nothing yet. Reported rather than waited out, since a producer holds its lock for as long as its handle lives.
Trait Implementations§
Source§impl Debug for PimdirError
impl Debug for PimdirError
Source§impl Display for PimdirError
impl Display for PimdirError
Source§impl Error for PimdirError
impl Error for PimdirError
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()