Expand description
The optional envelope that wraps a raw Graven message for disk or network.
Layout (little-endian):
offset size field
0 4 magic = "GRVN"
4 1 format_version = 1
5 1 flags = 0
6 2 reserved = 0
8 8 schema_id
16 4 payload_len
20 N payload
20+N 4 crc32c of bytes [0, 20+N)Structs§
- Envelope
- A validated envelope borrowed from the input buffer.
- Envelopes
- Iterator returned by
envelopes.
Constants§
- FORMAT_
VERSION - The only envelope format version this crate reads and writes.
- HEADER_
LEN - Size of the fixed header preceding the payload.
- MAGIC
- The four magic bytes that start every envelope.
- TRAILER_
LEN - Size of the CRC32C trailer following the payload.
Functions§
- decode
- Parses and validates the envelope at the start of
buf. - encode
- Appends an envelope around
payloadtoout. - envelopes
- Iterates over envelopes concatenated in
buf(e.g. a batch fromBuilder::seal_envelope…take_frames, or an append-only file). - schema_
id - FNV-1a 64-bit hash of a fully qualified type name, e.g.
"bank.Transaction".