pub trait StateAdapter<S, J>:
Send
+ Sync
+ 'static {
// Required methods
fn to_journal(&self, state: &S) -> PersistenceResult<(String, J)>;
fn from_journal(
&self,
adapter_manifest: &str,
state: J,
) -> PersistenceResult<S>;
}Expand description
Converts domain state to and from its snapshot or durable-state representation.
Required Methods§
Sourcefn to_journal(&self, state: &S) -> PersistenceResult<(String, J)>
fn to_journal(&self, state: &S) -> PersistenceResult<(String, J)>
Adapts one domain state and returns its durable adapter manifest.
Sourcefn from_journal(&self, adapter_manifest: &str, state: J) -> PersistenceResult<S>
fn from_journal(&self, adapter_manifest: &str, state: J) -> PersistenceResult<S>
Adapts one stored journal state during recovery.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".