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
//! One entry in a session's history: the diagram as it was left, and the command that left it.
//! See the _Vocabulary_ row for `Step` and §5 of
//! [`docs/editing-model.md`](../../../docs/editing-model.md).
use ;
use crateCommand;
/// What a session pushes after it carries out a command that changed the diagram.
///
/// **Both halves are needed and a diagram alone cannot stand in for the other.** A diagram records
/// what is true and never what was done to it — a figure dragged one cell and the same figure
/// teleported across the diagram differ as gestures and are identical as states — so whatever
/// eventually tells those apart would have nothing to read in a pair of diagrams. That is what
/// the command beside it is for, and why it is stored rather than derived.
///
/// **The diagram it holds is the one the session holds once the command has run, and nothing is
/// computed from the command to reach it.** Inverting a command is not available and would not be
/// right: `Diagram::remove` freezes every reference naming the figure it takes and states that
/// nothing re-hangs them, so an inverse of that command cannot be derived — it could only be
/// reconstructed from what the caller captured beforehand, and a command whose author forgot is
/// wrong in a way nothing reports. So the state is kept and the command is kept beside it, and the
/// state a command *found* is the step before this one.
///
/// **It is private, and not because either half is secret.** Nothing hands a step out today, and a
/// caller able to read one would be able to hold a diagram and change it — which is a way around
/// the session, and the one rule this crate exists to make impossible.
pub