Skip to main content

StoreError

Enum StoreError 

Source
pub enum StoreError {
Show 30 variants Database { path: PathBuf, action: &'static str, source: Error, }, Json(Error), Validation(ValidationError), Engine(EngineError), AlreadyInitialized(PathBuf), NotInitialized(PathBuf), RevisionConflict { expected: u64, actual: u64, }, InvalidOperationRevision { base: u64, result: u64, plan: u64, }, SnapshotMismatch(OperationId), CorruptSnapshot { path: PathBuf, record: StoredRecord, row: u64, json: u64, }, UnsupportedSchemaVersion { path: PathBuf, found: i64, supported: i64, }, RetiredSchemaVersion { path: PathBuf, found: i64, current: i64, }, UnrecognizedSchema { path: PathBuf, detail: String, }, TargetExists { path: PathBuf, }, Io { action: &'static str, path: PathBuf, source: Error, }, BackupIncomplete { path: PathBuf, state: String, }, IntegrityCheckFailed { path: PathBuf, problems: Vec<String>, }, HistoryDiscontinuity { path: PathBuf, sequence: u64, expected: u64, found: u64, }, SnapshotRevisionMismatch { path: PathBuf, snapshot: u64, last_operation: u64, }, CorruptJson { path: PathBuf, record: StoredRecord, field: &'static str, source: Error, }, CorruptColumn { path: PathBuf, record: StoredRecord, field: &'static str, source: Error, }, SequenceGap { path: PathBuf, previous: u64, sequence: u64, }, MissingHistory { path: PathBuf, origin: u64, snapshot: u64, }, MissingGenesis { path: PathBuf, }, ReplayRefused { path: PathBuf, sequence: u64, source: EngineError, }, ReplayDiverged { path: PathBuf, revision: u64, differing: Vec<String>, }, Lineage(LineageError), ForeignOperation { path: PathBuf, sequence: u64, found: WorkspaceId, expected: WorkspaceId, }, DuplicateOperation { recorded: Box<HistoryEntry>, }, InvalidTarget { path: PathBuf, reason: &'static str, },
}
Expand description

A persistence operation that could not be completed safely.

Variants§

§

Database

SQLite failed while accessing the named database.

Fields

§path: PathBuf

Database location or the in-memory label.

§action: &'static str

Failed persistence action.

§source: Error

Original database error.

§

Json(Error)

Snapshot or operation serialization failed.

§

Validation(ValidationError)

The supplied graph violates model invariants.

§

Engine(EngineError)

The supplied operation cannot produce a valid state transition.

§

AlreadyInitialized(PathBuf)

A caller attempted to replace existing history during initialization.

§

NotInitialized(PathBuf)

Persistence requires an existing initial snapshot.

§

RevisionConflict

The caller’s base revision is stale.

Fields

§expected: u64

Revision required by the caller.

§actual: u64

Current stored revision.

§

InvalidOperationRevision

Snapshot revisions do not describe one consecutive wrapping operation.

Fields

§base: u64

Revision before the operation.

§result: u64

Claimed resulting revision.

§plan: u64

Supplied snapshot revision.

§

SnapshotMismatch(OperationId)

Snapshot contents differ from the actual result of the supplied command.

§

CorruptSnapshot

Stored revision metadata disagrees with the serialized plan.

Fields

§path: PathBuf

Database containing the inconsistent plan.

§record: StoredRecord

Snapshot or genesis plan.

§row: u64

Revision in the SQLite row.

§json: u64

Revision inside the plan JSON.

§

UnsupportedSchemaVersion

The store was written by a binary with a different, unsupported layout version.

Fields

§path: PathBuf

Database carrying the version.

§found: i64

Version recorded in the store header.

§supported: i64

Newest version this binary understands.

§

RetiredSchemaVersion

The store was written in a retired layout whose operation log cannot be replayed.

Fields

§path: PathBuf

Database carrying the version.

§found: i64

Version recorded in the store header; 0 for DPM tables without a header.

§current: i64

Version this binary writes.

§

UnrecognizedSchema

The file is SQLite but its tables are not a DPM store layout.

Fields

§path: PathBuf

Inspected database.

§detail: String

First layout difference found.

§

TargetExists

Backup and restore only ever create new files.

Fields

§path: PathBuf

Existing file or SQLite side file at the target location.

§

Io

A filesystem operation outside SQLite failed.

Fields

§action: &'static str

Failed filesystem action.

§path: PathBuf

Affected location.

§source: Error

Original I/O error.

§

BackupIncomplete

The online backup did not copy every page in one step.

Fields

§path: PathBuf

Destination being written.

§state: String

SQLite step result that ended the copy.

§

IntegrityCheckFailed

SQLite’s page-level integrity check reported damage.

Fields

§path: PathBuf

Damaged database.

§problems: Vec<String>

First reported problems.

§

HistoryDiscontinuity

Operation revisions do not form one consecutive chain.

Fields

§path: PathBuf

Inspected database.

§sequence: u64

Local append sequence of the offending operation.

§expected: u64

Revision the chain requires.

§found: u64

Revision the operation records.

§

SnapshotRevisionMismatch

The snapshot is not the state produced by the last recorded operation.

Fields

§path: PathBuf

Inspected database.

§snapshot: u64

Revision of the stored snapshot.

§last_operation: u64

Resulting revision of the last operation.

§

CorruptJson

A stored JSON field no longer decodes.

Fields

§path: PathBuf

Database containing the record.

§record: StoredRecord

Snapshot or operation holding the field.

§field: &'static str

Column holding the damaged JSON.

§source: Error

Decoding failure.

§

CorruptColumn

A stored column holds a value of the wrong type.

Fields

§path: PathBuf

Database containing the record.

§record: StoredRecord

Snapshot or operation holding the field.

§field: &'static str

Damaged column.

§source: Error

Column decoding failure.

§

SequenceGap

Local append sequences skip a value, so an operation row was removed.

Fields

§path: PathBuf

Inspected database.

§previous: u64

Sequence of the preceding operation.

§sequence: u64

Next sequence found.

§

MissingHistory

No operation leads from the genesis plan to the snapshot.

Fields

§path: PathBuf

Inspected database.

§origin: u64

Revision the history must start from.

§snapshot: u64

Revision of the stored snapshot.

§

MissingGenesis

A store has a snapshot but no genesis plan to replay its history from.

Fields

§path: PathBuf

Inspected database.

§

ReplayRefused

The engine refuses a recorded operation when the history is replayed from genesis.

Fields

§path: PathBuf

Inspected database.

§sequence: u64

Local append sequence of the refused operation.

§source: EngineError

Engine refusal.

§

ReplayDiverged

Replaying genesis and every operation does not reproduce the stored snapshot.

Fields

§path: PathBuf

Inspected database.

§revision: u64

Revision of the stored snapshot.

§differing: Vec<String>

Top-level plan fields whose replayed value differs from the snapshot.

§

Lineage(LineageError)

The store’s lineage is missing, archived, or not the one the caller observed.

§

ForeignOperation

An operation belongs to a different workspace than the store’s genesis plan.

Fields

§path: PathBuf

Inspected database.

§sequence: u64

Local append sequence of the offending operation.

§found: WorkspaceId

Workspace the operation records.

§expected: WorkspaceId

Workspace of the genesis plan.

§

DuplicateOperation

The operation identity is already recorded; the caller decides whether the resend matches.

Fields

§recorded: Box<HistoryEntry>

The recorded operation with this identity.

§

InvalidTarget

Backup and restore targets must be a plain database file name in an existing directory.

Fields

§path: PathBuf

Requested destination.

§reason: &'static str

Why the destination is unusable.

Implementations§

Source§

impl StoreError

Source

pub fn is_corruption(&self) -> bool

Whether the stored data itself is damaged or inconsistent, as opposed to a refused request.

Source

pub fn is_busy(&self) -> bool

Whether another connection held the database lock past the busy timeout; retrying later may succeed, and nothing was written.

Trait Implementations§

Source§

impl Debug for StoreError

Source§

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

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

impl Display for StoreError

Source§

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

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

impl Error for StoreError

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<EngineError> for StoreError

Source§

fn from(source: EngineError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for StoreError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<LineageError> for StoreError

Source§

fn from(source: LineageError) -> Self

Converts to this type from the input type.
Source§

impl From<StoreError> for RunStoreError

Source§

fn from(source: StoreError) -> Self

Converts to this type from the input type.
Source§

impl From<ValidationError> for StoreError

Source§

fn from(source: ValidationError) -> 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more