Skip to main content

Module dream_apply

Module dream_apply 

Source
Expand description

What applying a dream’s proposal, or reverting it, would do to a memory’s files (SPEC_DREAMS §2.6, §9).

A pure plan over the proposal’s operations and the files’ heads as they are now. It reads nothing and writes nothing: the caller (srv) reads the heads, runs the steps as ordinary versioned writes with source = dream, and moves the dream. The plan is all or nothing: if any file a step touches is not as the pass read it, no step is returned and the files that changed are named, so a pass never overwrites a newer version.

Structs§

Step

Enums§

Change
What a step does to its file.
Expect
What a file must be like for a step to run.
Plan

Functions§

plan_apply
The steps that apply ops, if every file they touch is as the pass read it.
plan_revert
The steps that undo what ops applied, if every file is still as the dream left it. Only an operation that was applied (it noted the version it wrote) is undone.

Type Aliases§

Heads
A file’s content hash now, or None when it does not exist.