pub struct FileStorage { /* private fields */ }Expand description
File-based storage implementation
Implementations§
Source§impl FileStorage
impl FileStorage
pub async fn new(base_dir: impl AsRef<Path>) -> RragResult<Self>
pub async fn with_config( base_dir: impl AsRef<Path>, config: FileStorageConfig, ) -> RragResult<Self>
Trait Implementations§
Source§impl Storage for FileStorage
impl Storage for FileStorage
Source§fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
entry: &'life2 StorageEntry,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
entry: &'life2 StorageEntry,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store an entry
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<Option<StorageEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<Option<StorageEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve an entry
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<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,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if an entry exists
Source§fn list_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
_query: &'life1 StorageQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<StorageKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
_query: &'life1 StorageQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<StorageKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List keys matching a query
Source§fn get_many<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StorageKey],
) -> Pin<Box<dyn Future<Output = RragResult<Vec<(StorageKey, Option<StorageEntry>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_many<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StorageKey],
) -> Pin<Box<dyn Future<Output = RragResult<Vec<(StorageKey, Option<StorageEntry>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Bulk get operation
Source§fn put_many<'life0, 'life1, 'async_trait>(
&'life0 self,
entries: &'life1 [(StorageKey, StorageEntry)],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_many<'life0, 'life1, 'async_trait>(
&'life0 self,
entries: &'life1 [(StorageKey, StorageEntry)],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Bulk put operation
Source§fn delete_many<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StorageKey],
) -> Pin<Box<dyn Future<Output = RragResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_many<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StorageKey],
) -> Pin<Box<dyn Future<Output = RragResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Bulk delete operation
Source§fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<StorageStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<StorageStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get storage statistics
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check
Auto Trait Implementations§
impl Freeze for FileStorage
impl RefUnwindSafe for FileStorage
impl Send for FileStorage
impl Sync for FileStorage
impl Unpin for FileStorage
impl UnwindSafe for FileStorage
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