#[non_exhaustive]pub enum Error {
}Expand description
Errors that can arise while reading a SQLite database, all recoverable —
the reader never panics on malformed input.
#[non_exhaustive] so naming a newly-recognised malformation is an additive
change. It is applied in the same release that adds
Error::MalformedSerialType, because that addition is breaking either way
and doing both at once spends the break once instead of twice.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TooShort
File is shorter than the 100-byte header.
BadMagic
First 16 bytes are not the SQLite format 3\0 magic.
BadPageSize(u32)
Page-size field is not a power of two in [512, 65536].
PageOutOfRange(u32)
A page number referenced by the b-tree is out of range for the file.
NotATablePage(u8)
A b-tree page had an unexpected type byte where a table page was required.
TruncatedCell
A cell pointer or payload ran past the end of its page.
MalformedSerialType
A record’s serial type was negative, so it names no value at all. A
serial type is a varint, and a damaged record decodes one as a negative
i64. Carries the offending value and the body offset it was read for
(Show-the-unrecognized-value).
Fields
TooManyPages
The b-tree was deeper / wider than the safety cap allows.
MalformedFreelist
The freelist trunk chain cycled or exceeded the file’s page count.
MalformedOverflow
An overflow-page chain cycled or exceeded the file’s page count.
BadJournalPageSize(u32)
A rollback-journal page size was not a power of two in [512, 65536].
Carries the offending value (Show-the-unrecognized-value).
JournalModeConflict
A rollback journal was applied to a database opened WAL-applied, or whose page size disagrees with the journal’s. WAL and rollback-journal modes are mutually exclusive timelines and must not be overlaid.
Io(ErrorKind)
The file could not be opened or read (an I/O failure via
Database::open_path, not a malformed database). Carries the
std::io::ErrorKind (show-the-unrecognized-value).
Decrypt(DecryptError)
SQLCipher decryption failed (wrong key, unsupported cipher parameters, or
a failed page authentication) via Database::open_encrypted. Carries
the underlying sqlcipher::DecryptError (show-the-unrecognized-value).