Skip to main content

Crate khive_changeset

Crate khive_changeset 

Source
Expand description

KG change-set op-list model and NDJSON-delta codec.

See crates/khive-changeset/docs/api/ndjson-codec.md for the wire format.

Structs§

ChangeSet
Envelope metadata plus an ordered list of staged operations.
CreateOp
Creates an entity or note with an ID minted and stabilized at stage time.
DeleteOp
Removes one record with its required, full stage-time preimage.
EdgePatch
Edge fields to mutate; weight must be finite and in [0.0, 1.0].
EdgePreimage
Prior edge values for exactly the fields touched by EdgePatch.
EntityCreateFields
Fields staged for a new entity.
EntityPatch
Entity fields to mutate; absent means unchanged and Some(None) clears description.
EntityPreimage
Prior entity values for exactly the fields touched by EntityPatch.
Envelope
Change-set-wide producer identity and stage-time provenance.
LinkOp
Creates a directed edge whose ID is minted at stage time.
MergeOp
Merges two entities with required participant and incident-edge preimages.
MergePreimage
Full prior state required to validate and rewire an entity merge.
NoteCreateFields
Fields staged for a new note.
NotePatch
Note fields to mutate; nested options distinguish unchanged, clear, and set.
NotePreimage
Prior note values for exactly the fields touched by NotePatch.
UpdateOp
Patches one record with a stage-time preimage of exactly the touched fields.

Enums§

ChangeSetError
In-memory NDJSON encode/decode errors; no variant represents I/O.
CreateTarget
Substrate-specific create fields, tagged by kind.
DeletePreimage
Full prior record state, tagged by substrate to avoid its embedded kind field.
Op
One staged mutation, internally tagged by the snake-case op field.
UpdatePatch
Substrate-specific patch tagged by target.
UpdatePreimage
Field-scoped preimage tagged with the same target as UpdatePatch.

Constants§

CURRENT_SCHEMA_VERSION
The NDJSON-delta schema version this crate currently emits and accepts.

Functions§

from_ndjson
Decodes an envelope header and every following line as one ordered Op.
to_ndjson
Encodes the envelope as line one and each op on a following line, in order.