Skip to main content

Crate pulsify_protocol

Crate pulsify_protocol 

Source
Expand description

Pulsify protocol v1. The transport/patch journal is independent of a CRDT engine.

Structs§

AppendResult
Error
Hub
One writer and its sessions: each session is pinned to a document, and rows stored through one session are forwarded to the document’s other sessions.
LastRegister
What a journal or a store reads from the head of a last-value row.
Message
PatchLog
Opaque segments whose operations are immutable; the frontier advances only when dependencies exist. A register without history keeps one row, the newest write: see “Fields without history” in docs/PROTOCOL.md.
PatchRow
Relay
Single-peer reference relay for embedding or the line-based interoperability CLI.
RelayOutput
The frames produced by one incoming frame.

Enums§

Body

Constants§

GAP_OPERATIONS
The payload of a gap row: no operation. Its sequence numbers held writes that were replaced, and it stands where no earlier row can cover them.
MAX_FRAME_BYTES
MAX_MESSAGE_ROWS
MAX_PATCH_BYTES
MAX_SAFE_INTEGER
MAX_SCHEMA_NODES
MAX_VECTOR_ENTRIES
OPERATIONS_VERSION
The version of operation payloads, their first byte.

Traits§

DocumentStore
Persistent lifecycle for ID-prefix subtrees. Deleted IDs can never be reused.
PatchStore
Rows keyed by (doc_id, sid, clock), whose operations are immutable. Rows stay pending until their actor prefix is contiguous and their dependencies are stored.
Sink
Delivers frames to one session. Returns false once the peer is gone.

Functions§

chunk_rows
Mirror of chunkRows: about 2 MiB, 4096 rows and the relay node budget per page.
covers_document
decode
document_prefixes
encode
is_gap
last_register_of
None unless the payload is one last-value write: exactly one operation of kind 7 (assign) or 8 (delete), to a register that keeps no history. Mirror of lastRegisterOf: nothing is decoded beyond the head, version, lamport, schema, count = 1, kind, target, field.
relay_frame
Serve one protocol frame from the store, like relayStoreMessage. Rows are committed before the acknowledgement. A frame which cannot be decoded is an Err; every other failure becomes an error frame for the peer.
validate_doc_id
validate_rows
Checks the rows of one append, before any storage access. Returns their document, or None when there is no row.
validate_vector

Type Aliases§

VersionVector