pub struct SqliteVault { /* private fields */ }Expand description
SQLite-backed vault with per-value encryption.
Implementations§
Source§impl SqliteVault
impl SqliteVault
Sourcepub fn open(path: &str, key: Vec<u8>) -> Result<Self>
pub fn open(path: &str, key: Vec<u8>) -> Result<Self>
Open or create a SQLite vault at the given path.
Sourcepub fn get_or_create(
&mut self,
original: &str,
category: &EntityCategory,
) -> PseudoToken
pub fn get_or_create( &mut self, original: &str, category: &EntityCategory, ) -> PseudoToken
Get or create a pseudo-token for the given original value.
Sourcepub fn get_or_create_for_user(
&mut self,
original: &str,
category: &EntityCategory,
user_id: Option<&str>,
) -> PseudoToken
pub fn get_or_create_for_user( &mut self, original: &str, category: &EntityCategory, user_id: Option<&str>, ) -> PseudoToken
Get or create a pseudo-token scoped to a user.
Sourcepub fn lookup(&self, token: &str) -> Option<&str>
pub fn lookup(&self, token: &str) -> Option<&str>
Look up the original value for a pseudo-token.
Sourcepub fn reverse_mappings(&self) -> HashMap<String, String>
pub fn reverse_mappings(&self) -> HashMap<String, String>
Get all reverse mappings.
Sourcepub fn stats(&self) -> VaultStats
pub fn stats(&self) -> VaultStats
Get vault statistics.
Sourcepub fn user_stats(&self, user_id: &str) -> Result<VaultStats>
pub fn user_stats(&self, user_id: &str) -> Result<VaultStats>
Get mappings for a specific user.
Auto Trait Implementations§
impl !Freeze for SqliteVault
impl !RefUnwindSafe for SqliteVault
impl Send for SqliteVault
impl !Sync for SqliteVault
impl Unpin for SqliteVault
impl UnsafeUnpin for SqliteVault
impl !UnwindSafe for SqliteVault
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