pub struct CredentialVault { /* private fields */ }Expand description
An in-memory set of named credentials backed by one encrypted file.
Implementations§
Source§impl CredentialVault
impl CredentialVault
Sourcepub fn unlock(path: &Path, passphrase: SecretString) -> Result<Self>
pub fn unlock(path: &Path, passphrase: SecretString) -> Result<Self>
Decrypts and validates one complete vault file.
Sourcepub fn save(&self, path: &Path, passphrase: &SecretString) -> Result<()>
pub fn save(&self, path: &Path, passphrase: &SecretString) -> Result<()>
Encrypts and durably replaces one complete vault file.
Sourcepub fn set(&mut self, name: &str, value: String) -> Result<()>
pub fn set(&mut self, name: &str, value: String) -> Result<()>
Inserts or replaces a named nonempty credential.
Sourcepub fn remove(&mut self, name: &str) -> Result<bool>
pub fn remove(&mut self, name: &str) -> Result<bool>
Removes a credential without exposing its value.
Trait Implementations§
Source§impl Debug for CredentialVault
impl Debug for CredentialVault
Source§impl Default for CredentialVault
impl Default for CredentialVault
Source§impl Drop for CredentialVault
impl Drop for CredentialVault
Auto Trait Implementations§
impl Freeze for CredentialVault
impl RefUnwindSafe for CredentialVault
impl Send for CredentialVault
impl Sync for CredentialVault
impl Unpin for CredentialVault
impl UnsafeUnpin for CredentialVault
impl UnwindSafe for CredentialVault
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