pub struct StorageBackend { /* private fields */ }Expand description
An in-memory storage backend with multiple named buckets.
Implementations§
Source§impl StorageBackend
impl StorageBackend
pub fn new() -> Self
pub fn ensure_bucket(&mut self, name: &str) -> &mut Bucket
pub fn put(&mut self, bucket: &str, key: &str, data: Vec<u8>)
pub fn get(&mut self, bucket: &str, key: &str) -> Option<&[u8]>
pub fn remove(&mut self, bucket: &str, key: &str) -> bool
pub fn contains(&self, bucket: &str, key: &str) -> bool
pub fn bucket_count(&self) -> usize
pub fn total_entries(&self) -> usize
pub fn total_bytes(&self) -> usize
pub fn read_count(&self) -> u64
pub fn drop_bucket(&mut self, name: &str) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StorageBackend
impl RefUnwindSafe for StorageBackend
impl Send for StorageBackend
impl Sync for StorageBackend
impl Unpin for StorageBackend
impl UnsafeUnpin for StorageBackend
impl UnwindSafe for StorageBackend
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