Skip to main content

checkpoint_store

Attribute Macro checkpoint_store 

Source
#[checkpoint_store]
Expand description

Apply to the CheckpointStore trait definition, an impl CheckpointStore for T block, or — for less boilerplate — an inherent impl T { ... } block.

Two surface forms on impl blocks:

  1. Trait-impl form: #[checkpoint_store] impl CheckpointStore for T { ... } — user writes the trait header.
  2. Inherent-impl form: #[checkpoint_store] impl T { async fn append(..); async fn load_run(..); async fn clear(..); } — the macro builds the impl CheckpointStore for T header and enforces that all three methods are present. (CheckpointStore takes no type parameters, so there are no attribute args.)

Either way, every async fn is rewritten to return Pin<Box<dyn Future<Output = ...> + Send + 'async_trait>>. On the trait definition the macro just performs that rewrite.