serde library

The VXS binary format: zero-copy documents with stable field ids.

final builder = DocBuilder(schemaId: 1, schemaVersion: 1)
  ..putString(1, 'conv-42')
  ..putInt(2, 7)
  ..putString(3, '在吗?');
final bytes = builder.finish();

final view = DocView.parse(bytes.asUint8List());
print(view.getString(3));

Classes

Bytes
Immutable view over [offset, offset + length) of a Uint8List.
DocBuilder
Builds one VXS document.
DocCursor
Forward cursor over the fields of a DocView.
DocSink
A bump-allocated buffer that holds many consecutive VXS documents.
DocView
A read-only, zero-copy view over one encoded VXS document.
StringView
A zero-copy view over UTF-8 bytes.
VxsCrc32c
CRC-32C (Castagnoli) used for document, block and frame integrity.
VxsField
One field declaration: a stable numeric id, a name, a type.
VxsLe
Unaligned little-endian access.
VxsSchema
An ordered set of VxsFields identified by a stable id.
VxsValidationIssue
One problem found while validating a document against a schema.
VxsVarint
Unsigned LEB128 varints plus the zigzag transform for signed values.
VxsWire
VXS wire types. The low two bits of every field key carry one of these.

Enums

VxsType
Logical field types understood by the VXS format.

Extensions

VxsTypeWire on VxsType
Wire type used on disk for each logical VxsType.

Constants

vxsExtendedDeltaBase → const int
Delta encoded by the extended key form; the remainder is a varint.
vxsFlagCrc32c → const int
A CRC32C trailer follows the body. Reserved; not emitted in v1.
vxsFlagLength32 → const int
Body length is a u32 instead of a u16 (header grows from 6 to 8 bytes).
vxsHeaderSize → const int
Offset of the body when the small header is used.
vxsHeaderSizeLarge → const int
Offset of the body when vxsFlagLength32 is set.
vxsMagic → const int
First byte of every document: ASCII 'V'.
vxsMaxInlineDelta → const int
Largest field-id delta that fits in a single key byte.
vxsMaxSmallBody → const int
Largest body that fits the small header.
vxsReservedFlags → const int
Reserved in v1; must be zero on read.

Exceptions / Errors

VxsFormatException
Thrown when a byte range is not a valid VXS document.