Expand description
Length-based FugueMax CRDT.
Unlike crate::crdt_vibed_not_length, the CRDT here stores no text at all — only
byte lengths and byte positions. Local edits return
Insertion/Deletion values to send to other replicas, and
integrating a remote op returns BufferEdits telling the caller what to
do to its own text buffer. Note [Spans]
§References:
- The FugueMax paper: https://arxiv.org/abs/2305.00583
- Joseph Gentle’s simple FugueMax implementation: https://github.com/josephg/crdt-from-scratch
- cola, whose length-based, operation-based API this module borrows (but not its RGA-style ordering): https://github.com/nomad/cola
Structs§
- Deletion
- A replica’s deletion of a set of bytes, in CRDT coordinates: the exact ids of the deleted bytes, as runs of temporally-consecutive ids. Note [Deletion by id]
- Insertion
- A replica’s insertion of a run of bytes, in CRDT coordinates. Carries no
text: the caller pairs the op with the inserted text, identified by
authorandbytes. - Replica
- Replica
Id
Enums§
- Buffer
Edit - An edit to apply to the text buffer paired with a
Replica. Produced by theintegrate_*methods; apply edits in the order given.