Skip to main content

InitializationError

Enum InitializationError 

Source
#[non_exhaustive]
pub enum InitializationError<E> {
Show 20 variants BusyTimeoutTooLarge { milliseconds: u128, }, BusyTimeout(Error), JournalModeQuery(Error), DatabasePathUnavailable, FileBackedTransient { path: PathBuf, }, DatabasePath { path: PathBuf, source: Error, }, InitializationLockOpen { path: PathBuf, source: Error, }, InitializationLockAcquire { path: PathBuf, source: Error, }, WalPragma(Error), WalNotEnabled { mode: String, }, WalBusyNotWal { mode: String, }, WalBusyQuery { wal_error: Box<Error>, query_error: Box<Error>, }, Synchronous(Error), SchemaReadiness(Error), SchemaNotInitialized { name: &'static str, version: i64, }, NewerSchemaVersion { name: &'static str, stored: i64, supported: i64, }, Transaction(Error), Initialize(E), SchemaMarker(Error), Commit(Error),
}
Expand description

Failure to configure or initialize a Harn-owned SQLite database.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BusyTimeoutTooLarge

The configured busy timeout cannot be represented by SQLite.

Fields

§milliseconds: u128
§

BusyTimeout(Error)

The connection rejected its configured busy timeout.

§

JournalModeQuery(Error)

The current journal mode could not be observed.

§

DatabasePathUnavailable

The connection does not own a file-backed main database.

§

FileBackedTransient

A file-backed connection was passed to the transient initializer.

Fields

§path: PathBuf
§

DatabasePath

The opened database path could not be resolved to one lock identity.

Fields

§path: PathBuf
§source: Error
§

InitializationLockOpen

The persistent sidecar lock could not be opened.

Fields

§path: PathBuf
§source: Error
§

InitializationLockAcquire

Exclusive ownership of the sidecar lock could not be acquired.

Fields

§path: PathBuf
§source: Error
§

WalPragma(Error)

SQLite rejected WAL journal mode for a non-contention reason.

§

WalNotEnabled

SQLite accepted the journal-mode request but returned another mode.

Fields

§mode: String
§

WalBusyNotWal

WAL promotion was busy and the database remained in another mode.

Fields

§mode: String
§

WalBusyQuery

WAL promotion and the diagnostic journal-mode query both failed.

Fields

§wal_error: Box<Error>
§query_error: Box<Error>
§

Synchronous(Error)

The connection rejected the runtime synchronous setting.

§

SchemaReadiness(Error)

The schema marker could not be inspected.

§

SchemaNotInitialized

No initializer committed the exact schema version before the readiness lease became available.

Fields

§name: &'static str
§version: i64
§

NewerSchemaVersion

The database was initialized by a newer incompatible schema owner.

Fields

§name: &'static str
§stored: i64
§supported: i64
§

Transaction(Error)

The atomic schema transaction could not begin.

§

Initialize(E)

The owning schema callback failed.

§

SchemaMarker(Error)

The schema marker table or row could not be written.

§

Commit(Error)

The schema and marker transaction could not commit.

Implementations§

Source§

impl InitializationError<Error>

Source

pub fn is_busy_or_locked(&self) -> bool

Whether the SQLite portion of this failure reports lock contention.

Trait Implementations§

Source§

impl<E: Debug> Debug for InitializationError<E>

Source§

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

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

impl<E: Display> Display for InitializationError<E>

Source§

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

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

impl<E: Error + 'static> Error for InitializationError<E>

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

Auto Trait Implementations§

§

impl<E> !RefUnwindSafe for InitializationError<E>

§

impl<E> !UnwindSafe for InitializationError<E>

§

impl<E> Freeze for InitializationError<E>
where E: Freeze,

§

impl<E> Send for InitializationError<E>
where E: Send,

§

impl<E> Sync for InitializationError<E>
where E: Sync,

§

impl<E> Unpin for InitializationError<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for InitializationError<E>
where E: UnsafeUnpin,

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> 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 = Infallible

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.