Expand description
Canonical byte (de)serialization for Object.
Spec: docs/SPEC-OBJECTS.md. The byte layout produced here is the
v1 on-disk format; the golden-vector tests in tests/golden.rs pin
it byte-for-byte.
Every deserializer:
- Validates the 6-byte v1 prologue first.
- Enforces per-type bounds (entry counts, identity len, etc.).
- Rejects non-empty trailing bytes via
MkitError::TrailingData.
Constants§
- MAX_
TREE_ ENTRIES - Decode-side cap on tree entry count; writers (and the git importer) must refuse anything larger or the store gains an undecodable signed object.
Functions§
- blob_
prologue - The exact byte prefix of
serialize(Object::Blob(..))for a payload oflenbytes: 6-byte object prologue plus theu32LE data length. Lets ingest write a chunk asprologue ‖ payloadstraight from the source buffer — noBloballocation, no serialize copy. Equivalence withserializeis pinned by proptest and, transitively, the golden blob vectors. - deserialize
- Deserialize bytes into an owned
Object. Validates the prologue and every per-type bound; rejects trailing data. - serialize
- Serialize an
Objectto its canonical byte form. Allocates fresh each call; the result is fully owned.