pub struct DiskStorage { /* private fields */ }Expand description
Disk-based storage using Sled
Implementations§
Trait Implementations§
Source§impl Storage for DiskStorage
impl Storage for DiskStorage
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
key: &'life1 Key,
) -> Pin<Box<dyn Future<Output = KVResult<Option<Entry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
key: &'life1 Key,
) -> Pin<Box<dyn Future<Output = KVResult<Option<Entry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get an entry by key
Source§fn set<'life0, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
key: Key,
entry: Entry,
) -> Pin<Box<dyn Future<Output = KVResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set<'life0, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
key: Key,
entry: Entry,
) -> Pin<Box<dyn Future<Output = KVResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set an entry
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
key: &'life1 Key,
) -> Pin<Box<dyn Future<Output = KVResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
key: &'life1 Key,
) -> Pin<Box<dyn Future<Output = KVResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete an entry
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
key: &'life1 Key,
) -> Pin<Box<dyn Future<Output = KVResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
key: &'life1 Key,
) -> Pin<Box<dyn Future<Output = KVResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a key exists
Source§fn keys<'life0, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
) -> Pin<Box<dyn Future<Output = KVResult<Vec<Key>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn keys<'life0, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
) -> Pin<Box<dyn Future<Output = KVResult<Vec<Key>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all keys in a database
Source§fn keys_pattern<'life0, 'life1, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
pattern: &'life1 str,
) -> Pin<Box<dyn Future<Output = KVResult<Vec<Key>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn keys_pattern<'life0, 'life1, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
pattern: &'life1 str,
) -> Pin<Box<dyn Future<Output = KVResult<Vec<Key>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get keys matching a pattern
Source§fn clear_database<'life0, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
) -> Pin<Box<dyn Future<Output = KVResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear_database<'life0, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
) -> Pin<Box<dyn Future<Output = KVResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clear all data in a database
Source§fn get_stats<'life0, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
) -> Pin<Box<dyn Future<Output = KVResult<StorageStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_stats<'life0, 'async_trait>(
&'life0 self,
database_id: DatabaseId,
) -> Pin<Box<dyn Future<Output = KVResult<StorageStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get database statistics
Auto Trait Implementations§
impl !Freeze for DiskStorage
impl !RefUnwindSafe for DiskStorage
impl Send for DiskStorage
impl Sync for DiskStorage
impl Unpin for DiskStorage
impl !UnwindSafe for DiskStorage
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