1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use ;
use crateAggregate;
/// Opt-in trait for aggregates that can produce state snapshot payloads.
///
/// Aggregates implementing this trait can have their state captured as a DTO at
/// a point in time and restored later. Repositories may serialize that payload
/// into a snapshot cache record to skip costly full event replay, but the
/// payload itself is not an aggregate event and is not durable history by
/// itself.
///
/// The associated `Snapshot` type is a separate struct (e.g., `TodoSnapshot`)
/// that captures the aggregate's current state.