Skip to main content

Module write

Module write 

Source
Expand description

Doc writes as unsigned place events (C0 2.2). The engine fills in the envelope (event id, nonce, commit, HLC, signature) and queues them in order; CAS-checked field.sets carry the head they were built on, so a batch can chain edits: each event’s base is the one before it.

Structs§

EventSpec
One event to sign and queue.

Functions§

add_note
A note about about (a page or section id); covers are (ref, digest) pairs the note accounts for.
anchor_from_value
The anchor of a wire value anchor_value wrote; None for an unknown scheme.
anchor_value
The wire form of an anchor: {ref, digest, commit, mode?, role?}.
chain
Chains the bases of a batch: a CAS write on a node another event of the batch already wrote names that event, so the batch applies in order. event_ids are the ids the engine gave each event, in batch order.
confirm
Confirms a page against the checkout: new anchors (CAS), then the machine verdicts anchor_state: fresh and an empty drift (exempt). A re-anchor carries verified_at (ms) in its body: C0 refuses one without it.
create_page
The events that create page: the page node, its sections with their part_of edges, its notes with their about edges (to the page) and a links_to edge per linked page id. Bodies must already be in storage form (crate::links::to_storage). Returns the events and the page id.
edit_section
Replaces the body of section.
field_set
A CAS-checked field.set of field on a node whose head is base.
insert_section
Inserts a section with text after the section at after (None: at the front). When no order fits between the neighbours the page is renumbered first, one CAS field.set order per section.
retract
retract of a node or an edge with reason (2–500 characters).
revise_page
The events that turn page into markdown (storage form: links already hive:). Unchanged sections stay; a changed stretch becomes edits of the sections it replaces, then inserts or retractions for the rest. A new # title is a CAS field.set title. links_want are the page ids the new body links to; links_now the live links_to edges.

Type Aliases§

NewId
Makes ids: "n" for nodes, "e" for edges (n_…, e_…).