Module action
Expand description
The Action trait and its serializable envelope-side vocabulary.
An Action is the atomic unit of “play locally, replay anywhere”: a value that deterministically mutates a CRDT document. The executor pins the Automerge actor id and commit timestamp from the action’s envelope, so the resulting change is content-addressed identical on every replica (native Automerge exchange later dedupes rather than double-applying).
Actions are not presentation — local-only state (rendering, selection, scroll) must never go through an action; only shared CRDT mutations do.
Structs§
- Action
Id - A globally-unique id minted per dispatched action. Its 16 bytes double as the deterministic Automerge actor id, making replay content-addressed identical across replicas.
- Encoded
Action - A serialized action ready to cross a process/network boundary: the
registry
type_idplus the JSON payload the matching decoder reconstructs it from.
Enums§
- Action
Error - Errors from encoding, decoding, or applying an action.
- Execution
Locus - Where an action executes, declared on the action type and carried on every
envelope.
ServerPreferredretains its historical wire spelling, but is an authoritative-host requirement: absence of a host is a refusal, never permission for the client to perform the operation. - Operation
Kind - What an exported operation changes. Keeping this explicit prevents applications from disguising local effects or navigation as CRDT edits.
Traits§
Type Aliases§
- Doc
- The CRDT document an action mutates — aliased so call sites read as
“mutate the Doc”; exactly
automerge::AutoCommit.