pub struct RedbSecretStore { /* private fields */ }Expand description
The secret store in the control database.
Cheap to clone; every clone is the same database, and the same one
crate::RedbControlStore holds. It is deliberately not a second
redb::Database over the same file — redb takes an exclusive lock, so a
second open in the same process would fail, and the shared handle is what
makes “one file, one lock” true.
Trait Implementations§
Source§impl Clone for RedbSecretStore
impl Clone for RedbSecretStore
Source§impl Debug for RedbSecretStore
impl Debug for RedbSecretStore
Source§impl SecretStore for RedbSecretStore
impl SecretStore for RedbSecretStore
Source§fn put(&self, key: &str, value: &[u8]) -> StoreResult<()>
fn put(&self, key: &str, value: &[u8]) -> StoreResult<()>
Write a secret, replacing any previous value.
Source§fn delete(&self, key: &str) -> StoreResult<()>
fn delete(&self, key: &str) -> StoreResult<()>
Remove a secret. Removing one that is not there is not an error.
Source§fn get_or_create(
&self,
key: &str,
mk: &mut dyn FnMut() -> StoreResult<Vec<u8>>,
) -> StoreResult<Vec<u8>>
fn get_or_create( &self, key: &str, mk: &mut dyn FnMut() -> StoreResult<Vec<u8>>, ) -> StoreResult<Vec<u8>>
Return the stored secret, or create it with
mk and store it, atomically. Read moreAuto Trait Implementations§
impl Freeze for RedbSecretStore
impl RefUnwindSafe for RedbSecretStore
impl Send for RedbSecretStore
impl Sync for RedbSecretStore
impl Unpin for RedbSecretStore
impl UnsafeUnpin for RedbSecretStore
impl UnwindSafe for RedbSecretStore
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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