Skip to main content

PimdirError

Enum PimdirError 

Source
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),
}
Available on crate feature 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

§collection: String

The collection holding the binding.

§link_id: String

The identity it is keyed by.

§source: String

The source whose binding it is.

§bound: String

The handle the binding holds, and keeps.

§incoming: String

The handle the refused write carried.

§

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.

Fields

§found: i64

The store’s user_version.

§

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

§user_version: i64

The store’s PRAGMA user_version.

§store_meta: i64

The version its store_meta row records.

§

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.

Fields

§table: &'static str

The first table found without the cascade.

§

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

§found: String

The algorithm the store records.

§declared: Option<&'static str>

The algorithm the caller declared, when it declared one.

§

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

Source§

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

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

impl Display for PimdirError

Source§

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

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

impl Error for PimdirError

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<Error> for PimdirError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for PimdirError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for PimdirError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<PimdirActionError> for PimdirError

Source§

fn from(err: PimdirActionError) -> Self

Converts to this type from the input type.

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> 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> Same for T

Source§

type Output = T

Should always be Self
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, <T as TryFrom<U>>::Error>

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.