pub struct FileProvider { /* private fields */ }Expand description
JSON file-based memory backend.
Each field is stored as a separate .json file. The field path maps directly
to the filesystem: "projects/myapp/learnings/auth" becomes {root}/projects/myapp/learnings/auth.json.
Implementations§
Trait Implementations§
Source§impl MemoryProvider for FileProvider
impl MemoryProvider for FileProvider
Source§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Field>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Field>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load all fields matching a path prefix
Source§fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
field: &'life1 Field,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
field: &'life1 Field,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write a single field (upsert by path)
Source§fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Field>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Field>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search fields by keyword in path or value
Auto Trait Implementations§
impl Freeze for FileProvider
impl RefUnwindSafe for FileProvider
impl Send for FileProvider
impl Sync for FileProvider
impl Unpin for FileProvider
impl UnsafeUnpin for FileProvider
impl UnwindSafe for FileProvider
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