pub struct AOFBackend { /* private fields */ }Expand description
Persistent storage backend using AOF (Append-Only File)
Implementations§
Trait Implementations§
Source§impl StorageBackend for AOFBackend
Available on crate feature aof only.
impl StorageBackend for AOFBackend
Available on crate feature
aof only.Source§fn delete(&mut self, key: &[u8]) -> Result<Option<DbItem>>
fn delete(&mut self, key: &[u8]) -> Result<Option<DbItem>>
Delete a key and return the old value if it existed
Source§fn keys_with_prefix(&self, prefix: &[u8]) -> Result<Vec<Bytes>>
fn keys_with_prefix(&self, prefix: &[u8]) -> Result<Vec<Bytes>>
Get all keys with a given prefix
Source§fn scan_prefix(&self, prefix: &[u8]) -> Result<BTreeMap<Bytes, DbItem>>
fn scan_prefix(&self, prefix: &[u8]) -> Result<BTreeMap<Bytes, DbItem>>
Get all key-value pairs with a given prefix Read more
Source§fn stats(&self) -> Result<StorageStats>
fn stats(&self) -> Result<StorageStats>
Get storage statistics
Source§fn iter(&self) -> Result<Box<dyn Iterator<Item = (Bytes, DbItem)> + '_>>
fn iter(&self) -> Result<Box<dyn Iterator<Item = (Bytes, DbItem)> + '_>>
Iterator over all key-value pairs
Source§fn cleanup_expired(&mut self, now: SystemTime) -> Result<usize>
fn cleanup_expired(&mut self, now: SystemTime) -> Result<usize>
Cleanup expired items (for TTL support)
Auto Trait Implementations§
impl Freeze for AOFBackend
impl RefUnwindSafe for AOFBackend
impl Send for AOFBackend
impl Sync for AOFBackend
impl Unpin for AOFBackend
impl UnwindSafe for AOFBackend
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more