pub trait Checkpointable:
Send
+ Sync
+ Sized {
type State: RemoteMessage;
// Required methods
fn save<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::State, CheckpointError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load<'async_trait>(
state: Self::State,
) -> Pin<Box<dyn Future<Output = Result<Self, CheckpointError>> + Send + 'async_trait>>
where Self: 'async_trait;
}
Expand description
[Checkpoint
] is used to save the state of an instance so that it can be restored later.
Required Associated Types§
Sourcetype State: RemoteMessage
type State: RemoteMessage
The type of the state that is saved. The state can be serialized and deserialized from persistent storage.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.