Expand description
crdt-doc — the typed CRDT-document border for Saber (SABER.md §5).
A verbete body is ALWAYS a CrdtDoc by construction (solo = a one-replica
CRDT). M0a is deliberately degenerate: the ONLY realized engine is
SoloDoc (single writer, no concurrent merge). CrdtKind::Loro and
CrdtKind::YCrdt are typed-and-named but UNBUILT — constructing one
returns SpecError::Unimplemented, never a silent Ok, never a
todo!()/panic!() (★★ UNREPRESENTABILITY / no-stub-Ok; ★★ TYPED-SPEC
triplet “every unimplemented surface returns a typed error so consumers see
the gap mechanically”).
The seam-clean rule (SABER §5): Edit is the local-author border,
CrdtUpdate is the wire border, materialize()→Rope is the render border —
never crossed raw. At M0a only materialize() is realized; local_edit /
apply_update are the M2 wire borders and return SpecError for non-Solo
kinds.
Structs§
- Crdt
Update - The wire delta exchanged between replicas (SABER §2
CrdtUpdate). At M0a this is an opaque byte vector with no producer — the type exists so the M2local_edit/apply_updatesignatures are stable now. - SoloDoc
- The single-writer degenerate document (M0a). Holds the body text directly —
no merge, no concurrent edits. A loro
CrdtDocreplaces it at M2 behind the same trait.
Enums§
- Crdt
Kind - The CRDT engine selector (SABER §2
CrdtKind).Solois the M0a degenerate;Lorothe M2 primary;YCrdtthe M2 interop arm. - Spec
Error - The typed error surface for the border. Every unimplemented engine arm
returns one of these (no
format!()—thiserror’s#[error]is the typed emission surface, allowed surface #2).
Traits§
- CrdtDoc
- The CRDT-document border (SABER §5). A verbete body is ALWAYS one.
Functions§
- open_
doc - The typed dispatch over
CrdtKind(SABER §2 “the dispatch tag”). M0a builds onlySolo;Loro/YCrdtreturnSpecError::Unimplemented— the typed-but-degenerate border the M0a spec mandates.