pub struct StateStore { /* private fields */ }Implementations§
Source§impl StateStore
impl StateStore
pub fn export_persisted(&self) -> Result<PersistedState, StateError>
pub fn restore_persisted( &self, persisted: PersistedState, unknown_policy: UnknownKeyPolicy, ) -> Result<(), StateError>
Sourcepub fn restore_thread_scoped(
&self,
persisted: PersistedState,
unknown_policy: UnknownKeyPolicy,
) -> Result<(), StateError>
pub fn restore_thread_scoped( &self, persisted: PersistedState, unknown_policy: UnknownKeyPolicy, ) -> Result<(), StateError>
Restore only Thread-scoped keys from a persisted state snapshot.
Run-scoped keys in persisted are ignored. Unknown keys follow unknown_policy.
Sourcepub fn clear_run_scoped(&self)
pub fn clear_run_scoped(&self)
Clear all Run-scoped keys, preserving Thread-scoped keys.
Source§impl StateStore
impl StateStore
pub fn new() -> Self
pub fn snapshot(&self) -> Snapshot
pub fn revision(&self) -> u64
pub fn read<K>(&self) -> Option<K::Value>where
K: StateKey,
pub fn add_hook<H>(&self, hook: H)where
H: CommitHook,
pub fn begin_mutation(&self) -> MutationBatch
Sourcepub fn merge_parallel(
&self,
left: MutationBatch,
right: MutationBatch,
) -> Result<MutationBatch, StateError>
pub fn merge_parallel( &self, left: MutationBatch, right: MutationBatch, ) -> Result<MutationBatch, StateError>
Merge two batches from parallel execution using registered merge strategies.
Sourcepub fn merge_all_commands(
&self,
commands: Vec<StateCommand>,
) -> Result<StateCommand, StateError>
pub fn merge_all_commands( &self, commands: Vec<StateCommand>, ) -> Result<StateCommand, StateError>
Merge multiple commands from parallel execution into one.
pub fn commit(&self, patch: MutationBatch) -> Result<u64, StateError>
pub fn install_plugin<P>(&self, plugin: P) -> Result<(), StateError>where
P: Plugin,
pub fn uninstall_plugin<P>(&self) -> Result<(), StateError>where
P: Plugin,
Trait Implementations§
Source§impl Clone for StateStore
impl Clone for StateStore
Auto Trait Implementations§
impl Freeze for StateStore
impl !RefUnwindSafe for StateStore
impl Send for StateStore
impl Sync for StateStore
impl Unpin for StateStore
impl UnsafeUnpin for StateStore
impl !UnwindSafe for StateStore
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