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
//! Entity foundations.
//!
//! Provides the [`Entity`] trait used by aggregates and entities alike to
//! expose their unique identity ([`Entity::Id`]) and their monotonically
//! increasing [`Version`] (used for optimistic concurrency control).
//!
use ;
use crateVersion;
/// Domain entity contract: something that has a stable identity and a
/// version which advances every time the entity changes.
///
/// The version is used by repositories for optimistic locking: a write that
/// is based on a stale version must be rejected with a conflict so callers
/// can retry. New entities start at [`Version::new`] (zero).