#[non_exhaustive]pub enum DbError {
Show 21 variants
Sqlite(Error),
SqlcipherFeatureRequired,
InvalidSqlcipherKey,
Integrity(String),
InvalidQuarantineSuffix(String),
InvalidPoolCapacity,
InvalidReaderCacheSize(u32),
ReadPoolClosed,
ReadPoolCloseTimeout {
outstanding: usize,
timeout: Duration,
},
ReadOnlyNotEffective(String),
InvalidDatabasePath,
SymlinkedStorePath(String),
NewerDatabase {
current: i64,
max: i64,
},
InvalidMigrations(String),
MigrationFailed {
version: i64,
name: &'static str,
source: Error,
},
Rollback(String),
Backup(String),
RestoreFailed {
message: String,
previous: Option<PathBuf>,
failed_copy: Option<PathBuf>,
rolled_back: bool,
},
NoKeyOpened,
Fs(FsError),
Unreadable {
path: PathBuf,
cause: UnreadableCause,
consecutive_failures: u32,
quarantine_after: Option<u32>,
source: Box<DbError>,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Sqlite(Error)
SqlcipherFeatureRequired
InvalidSqlcipherKey
Integrity(String)
An open-time quick_check or integrity_check failed. Open-time recovery treats it as an
unreadable database (see DbOptions::open_writer_recovering).
InvalidQuarantineSuffix(String)
InvalidPoolCapacity
InvalidReaderCacheSize(u32)
ReadPoolClosed
Checkout after ReadPool::close or ReadPool::close_and_wait.
ReadPoolCloseTimeout
ReadPool::close_and_wait timed out. outstanding counts readers still checked out or
opening.
ReadOnlyNotEffective(String)
A reader did not come up read-only: PRAGMA query_only did not stay on, or a read-only
handle reported a writable main database.
InvalidDatabasePath
SymlinkedStorePath(String)
The store path is a symbolic link (a dangling one included) and was refused before SQLite could create or open its target. Carries the path as given.
NewerDatabase
InvalidMigrations(String)
MigrationFailed
Rollback(String)
Backup(String)
RestoreFailed
restore_database failed. previous is where the previous store is kept when it is not
at the live path (never deleted); failed_copy is where the restored copy was set aside.
rolled_back is true when the live path holds the previous store again (or was never
touched); false means the rollback was incomplete, a restore journal remains, and
recover_interrupted_restore finishes it.
NoKeyOpened
Fs(FsError)
Unreadable
The database file could not be read (permission or I/O failure) or its storage is
unavailable. Not corruption: the file was not touched unless quarantine_after was
reached, in which case recovery succeeds instead of returning this. See
UnreadablePolicy.
Fields
cause: UnreadableCauseconsecutive_failures: u32Consecutive failed opens recorded so far (0 under UnreadablePolicy::Fail and for
storage problems, which are never counted).
quarantine_after: Option<u32>The count at which UnreadablePolicy::QuarantineAfter would set the file aside.
Trait Implementations§
Source§impl Error for DbError
impl Error for DbError
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()