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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
use crateStreamRevision;
use crate::;
/// **English:**<br>
/// Owned aggregate state paired with the last event revision it represents.
/// No identifier or schema version is added; include validation metadata in `S` when needed.
///
/// **日本語:**<br>
/// 集約状態と、その状態が反映する最後のイベントのリビジョンを所有します。
/// 識別子やスキーマバージョンは追加しません。検証用メタデータは必要に応じて `S` に含めます。
///
/// # Example / 使用例
///
/// ```rust
/// use ddd_toolkit_core::{AggregateSnapshot, StreamRevision};
/// let snapshot = AggregateSnapshot::new(42_u64, StreamRevision::new(3));
/// assert_eq!(*snapshot.state(), 42);
/// assert_eq!(snapshot.into_parts(), (42, StreamRevision::new(3)));
/// ```
/// **English:**<br>
/// Aggregate-defined snapshot classification used by [`crate::replay_with_optional_snapshot`].
/// Both `Stale` and `Inapplicable` trigger full replay; an older but usable snapshot may be `Applicable`.
///
/// **日本語:**<br>
/// [`crate::replay_with_optional_snapshot`] で使う集約定義のスナップショット分類です。
/// `Stale` と `Inapplicable` は全件再生を選択します。古くても利用可能なら `Applicable` にできます。
/// **English:**<br>
/// Snapshot lookup failure, distinct from a missing snapshot.
///
/// **日本語:**<br>
/// スナップショットの検索失敗です。スナップショットの不在とは区別されます。
/// **English:**<br>
/// Failure to persist a snapshot.
///
/// **日本語:**<br>
/// スナップショットの永続化失敗です。
/// **English:**<br>
/// Synchronous storage boundary for snapshots indexed by aggregate identifier.
/// Implementations define replacement policy, durability, synchronization, and panic conditions.
/// Saving a snapshot does not itself append events or validate the snapshot against an event stream.
///
/// **日本語:**<br>
/// 集約識別子をキーとするスナップショットの同期ストレージ境界です。
/// 置換方針、永続性、同期、パニック条件は実装が定めます。
/// 保存自体はイベント追加やイベントストリームに対するスナップショットの検証を行いません。