Skip to main content

Module trail

Module trail 

Source
Expand description

The undo trail: which revs a session can step back to, and which forward.

See docs/log-vs-snapshot.md. A step back is not an erasure — it is a new rev that adopts an older document — so the trail holds positions rather than commits: an Entry names the record it stands for and the rev whose document taking it adopts. Nothing here knows how a session finds that document; a container reads a rev file and a session with no files folds its log prefix, and both then run this same policy.

Structs§

Entry
One step this trail can take: the record it stands for, and the rev whose document taking it adopts.
Trail
Where a session’s history stands: what one press would take back, what one would put back, and which rev’s document the head currently holds.

Enums§

Direction
Which way a history step goes. Two variants, so “an edit is a history step” cannot be spelled.
JournalAs
Which stack a record’s entry lands on, and what it does to the other — the whole undo/redo policy, stated once.
UndoRefusal
Why a history step did not happen.

Functions§

retire 🔒
Drop the entry a step just consumed and say where it left the session standing. A step has already refused a name that is not the top, and a replayed record names what its own session’s step did; a name the stack does not hold is left alone rather than taken as “the top one”.