Interface IScyllaPersistable<TState>
Type-safe sibling of IScyllaPersistable. Implement this instead of the non-generic interface when the captured state has a single concrete type known at compile time, which is the common case. The non-generic CaptureState() and RestoreState(object, int) members are bridged automatically through default interface implementations, so an implementer only writes the typed pair below.
Inherited Members
Namespace: Scylla.Core.Persistence
Assembly: ScyllaCore.dll
Syntax
public interface IScyllaPersistable<TState> : IScyllaPersistable
Type Parameters
| Name | Description |
|---|---|
| TState | The concrete state type this implementor captures and restores. Should match what StateType reports. |
Methods
CaptureState()
Captures a strongly-typed snapshot of this system's current state. See CaptureState() for calling conventions.
Declaration
TState CaptureState()
Returns
| Type | Description |
|---|---|
| TState | The captured state. Must not be |
RestoreState(TState, int)
Restores this system's state from a strongly-typed, previously deserialized snapshot. See RestoreState(object, int) for calling conventions.
Declaration
void RestoreState(TState state, int savedSchemaVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| TState | state | The deserialized state. |
| int | savedSchemaVersion | The schema version the state was saved under. |