pub struct FileStore { /* private fields */ }Expand description
File-system backed store. Each key is stored as a JSON file.
Useful for development and simple deployments where a database is overkill.
Implementations§
Trait Implementations§
Source§impl Store for FileStore
impl Store for FileStore
Source§fn get(
&self,
key: &str,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, StoreError>> + Send + '_>>
fn get( &self, key: &str, ) -> Pin<Box<dyn Future<Output = Result<Option<Value>, StoreError>> + Send + '_>>
Get a value by key. Returns None if not found.
Source§fn put(
&self,
key: &str,
value: Value,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + '_>>
fn put( &self, key: &str, value: Value, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + '_>>
Put a value by key.
Source§fn delete(
&self,
key: &str,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + '_>>
fn delete( &self, key: &str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + '_>>
Delete a value by key.
Auto Trait Implementations§
impl Freeze for FileStore
impl RefUnwindSafe for FileStore
impl Send for FileStore
impl Sync for FileStore
impl Unpin for FileStore
impl UnsafeUnpin for FileStore
impl UnwindSafe for FileStore
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