pub struct FileStateStore { /* private fields */ }Expand description
File-based implementation of StateStore.
Stores adapter snapshots as JSON files with atomic write semantics.
§Atomic Writes
Uses write-to-temp-then-rename pattern to prevent corruption:
- Write to
{path}.tmp - Rename
{path}.tmpto{path}
This ensures the file is either fully written or not written at all.
Implementations§
Trait Implementations§
Source§impl Clone for FileStateStore
impl Clone for FileStateStore
Source§fn clone(&self) -> FileStateStore
fn clone(&self) -> FileStateStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileStateStore
impl Debug for FileStateStore
Source§impl StateStore for FileStateStore
impl StateStore for FileStateStore
Source§fn load(&self) -> LoadResult
fn load(&self) -> LoadResult
Loads previously saved state. Read more
Source§async fn save(&self, snapshots: &[AdapterSnapshot]) -> Result<(), StateError>
async fn save(&self, snapshots: &[AdapterSnapshot]) -> Result<(), StateError>
Saves current adapter state for future reference. Read more
Auto Trait Implementations§
impl Freeze for FileStateStore
impl RefUnwindSafe for FileStateStore
impl Send for FileStateStore
impl Sync for FileStateStore
impl Unpin for FileStateStore
impl UnwindSafe for FileStateStore
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