pub struct BucketBuilder<V> { /* private fields */ }Expand description
A bucket being opened: its name, its type, how its keys expire, whether its values are encrypted.
Implementations§
Source§impl<V: Value> BucketBuilder<V>
impl<V: Value> BucketBuilder<V>
Sourcepub fn ttl(self, ttl: Duration) -> Self
pub fn ttl(self, ttl: Duration) -> Self
Keys expire this long after they are written, unless a write says otherwise.
Sourcepub fn idle(self, idle: Duration) -> Self
pub fn idle(self, idle: Duration) -> Self
Keys expire this long after they were last read or written.
Sourcepub fn encrypted(self) -> Self
pub fn encrypted(self) -> Self
Keeps every value sealed with the store’s encryption key, as a password or a token is kept: the file holds what nobody reads without the key, and a value copied under another key does not open. A key is not sealed, so a secret is a value and never a key. A name keeps whether it is encrypted: it opens the same way every time.
let passwords = store.bucket::<String>("source-passwords").encrypted().open()?;
passwords.set("source-42", &"hunter2".to_owned())?;pub fn open(self) -> Result<Bucket<V>>
Trait Implementations§
Auto Trait Implementations§
impl<V> !RefUnwindSafe for BucketBuilder<V>
impl<V> !UnwindSafe for BucketBuilder<V>
impl<V> Forget for BucketBuilder<V>
impl<V> Freeze for BucketBuilder<V>
impl<V> Move for BucketBuilder<V>
impl<V> Send for BucketBuilder<V>
impl<V> Sync for BucketBuilder<V>
impl<V> Unpin for BucketBuilder<V>
impl<V> UnsafeUnpin for BucketBuilder<V>
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