pub struct KvDb {
pub db: Db,
pub kv_tree: Tree,
pub ttl_tree: Tree,
}Fields§
§db: Db§kv_tree: Tree§ttl_tree: TreeImplementations§
Source§impl KvDb
impl KvDb
pub fn new(cfg: KvDbConfig) -> Result<Self>
pub fn get_ttl_at<K>(&self, key: K) -> Option<u64>
pub fn is_expired<K>(&self, key: K) -> Option<bool>
pub fn insert_ttl<K, V>(&self, key: K, value: V, ttl: Duration) -> Result<()>
pub fn refresh_ttl<K>(&self, key: K, ttl: Duration) -> Result<()>
pub fn insert_or_update<K, V>(&self, key: K, value: V) -> Result<()>
pub fn contains_key<K>(&self, key: K) -> bool
pub fn get<K, V>(&self, key: K) -> Option<V>
pub fn remove<K>(&self, key: K) -> Result<()>
pub fn clean(&self) -> Result<()>
Auto Trait Implementations§
impl Freeze for KvDb
impl !RefUnwindSafe for KvDb
impl Send for KvDb
impl Sync for KvDb
impl Unpin for KvDb
impl UnsafeUnpin for KvDb
impl !UnwindSafe for KvDb
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