pub struct Vault { /* private fields */ }Expand description
Open encrypted database wrapper.
Exposes the underlying Connection via Vault::connection.
Implementations§
Source§impl Vault
impl Vault
Sourcepub fn open<F>(
db_path: &Path,
key: &SecretBox<[u8; 32]>,
ensure_schema: F,
) -> StoreResult<Self>
pub fn open<F>( db_path: &Path, key: &SecretBox<[u8; 32]>, ensure_schema: F, ) -> StoreResult<Self>
Opens (or creates) the encrypted database at db_path, runs
ensure_schema, and verifies integrity.
ensure_schema runs after the database is opened and keyed but
before the integrity check.
§Errors
Returns StoreError::Db if open / key / schema fails or
StoreError::IntegrityCheckFailed on corruption.
Sourcepub const fn connection(&self) -> &Connection
pub const fn connection(&self) -> &Connection
Borrows the underlying connection.
Trait Implementations§
Auto Trait Implementations§
impl !Sync for Vault
impl Freeze for Vault
impl RefUnwindSafe for Vault
impl Send for Vault
impl Unpin for Vault
impl UnsafeUnpin for Vault
impl UnwindSafe for Vault
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