pub struct FsStore { /* private fields */ }Expand description
Local-filesystem store. Writes go to a temp file in the same directory followed by a rename, so a crash mid-write never corrupts the latest snapshot.
Implementations§
Trait Implementations§
Source§impl SnapshotStore for FsStore
impl SnapshotStore for FsStore
Source§fn write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Atomically persist one snapshot blob under
name.Source§fn load_latest<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(String, Vec<u8>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_latest<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(String, Vec<u8>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the newest snapshot blob, or
None if the store is empty.Auto Trait Implementations§
impl Freeze for FsStore
impl RefUnwindSafe for FsStore
impl Send for FsStore
impl Sync for FsStore
impl Unpin for FsStore
impl UnsafeUnpin for FsStore
impl UnwindSafe for FsStore
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