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
use crate;
use PhantomData;
/// Private super-trait used to seal [`StateMarker`]. External crates cannot
/// add new [`StateMarker`] implementations because they cannot reach this
/// sealed trait — every library-generated state implements it via the
/// `define_state_machine!` macro (see `src/typestate/mod.rs`).
/// Marker trait for states that may appear in typed transitions.
///
/// This trait is **sealed** via a private super-trait: only state types
/// generated by the library's typestate macros can implement it. External
/// crates that try to `impl StateMarker for MyType` will not compile because
/// they cannot reach `sealed::Sealed`.
/// `Transition<From, To, P>`: a typed state change that carries an
/// [`EventPayload`] and therefore knows its [`EventKind`] structurally.
///
/// The payload type parameter `P: EventPayload` is the sole source of the
/// event kind; there is no constructor that takes an independent
/// [`EventKind`] argument, so a mismatched-kind storage is *structurally
/// impossible* rather than runtime-validated. See FREEZE-7 in the Integrity
/// Closeout II plan.