Skip to main content

Module action

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§

ActionId
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.
EncodedAction
A serialized action ready to cross a process/network boundary: the registry type_id plus the JSON payload the matching decoder reconstructs it from.

Enums§

ActionError
Errors from encoding, decoding, or applying an action.
ExecutionLocus
Where an action executes, declared on the action type and carried on every envelope. ServerPreferred retains 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.
OperationKind
What an exported operation changes. Keeping this explicit prevents applications from disguising local effects or navigation as CRDT edits.

Traits§

Action
A value that deterministically mutates a CRDT Doc.

Type Aliases§

Doc
The CRDT document an action mutates — aliased so call sites read as “mutate the Doc”; exactly automerge::AutoCommit.