pub enum DatabaseFileFormat {
Missing,
PlainSQLite,
CompressedContainer {
encrypted: bool,
},
Unrecognized,
}Expand description
On-disk format of a database file, detected from its header bytes.
Variants§
Missing
The file does not exist or is empty. Opening it creates a new database.
PlainSQLite
A plaintext SQLite database (SQLite format 3\0 magic).
CompressedContainer
A UQA compressed container (UQACDB2\0, or legacy UQACDB1\0,
magic). encrypted reflects the header flag: when set, opening
requires a key.
Unrecognized
No recognizable magic. Either a SQLCipher-encrypted database or
not a database at all; the two cannot be told apart without
attempting an open with a key.
Implementations§
Source§impl DatabaseFileFormat
impl DatabaseFileFormat
Sourcepub fn requires_key(self) -> bool
pub fn requires_key(self) -> bool
Whether opening this file is known to require an encryption
key. Unrecognized returns true because the dominant cause
for an unrecognized header on a database path is SQLCipher
encryption.
Trait Implementations§
Source§impl Clone for DatabaseFileFormat
impl Clone for DatabaseFileFormat
Source§fn clone(&self) -> DatabaseFileFormat
fn clone(&self) -> DatabaseFileFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DatabaseFileFormat
Source§impl Debug for DatabaseFileFormat
impl Debug for DatabaseFileFormat
impl Eq for DatabaseFileFormat
Source§impl PartialEq for DatabaseFileFormat
impl PartialEq for DatabaseFileFormat
impl StructuralPartialEq for DatabaseFileFormat
Auto Trait Implementations§
impl Freeze for DatabaseFileFormat
impl RefUnwindSafe for DatabaseFileFormat
impl Send for DatabaseFileFormat
impl Sync for DatabaseFileFormat
impl Unpin for DatabaseFileFormat
impl UnsafeUnpin for DatabaseFileFormat
impl UnwindSafe for DatabaseFileFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more