Expand description
Length-delimited record framing.
record := tag:u8 flags:u8 reserved:u16=0 length:u32 payload:[u8;length] crc32c:u32The CRC covers the 8-byte record header and the payload. reserved must be
zero. The flags bit FLAG_OPTIONAL marks a record whose tag a decoder
may skip if unknown; unknown non-optional tags fail closed.
Structs§
- Record
- A single decoded record.
- Record
Reader - An iterator over the records of a byte slice.
Enums§
- Record
Tag - Known record classes.
Constants§
- FLAG_
OPTIONAL - Flag: this record’s tag may be skipped by a decoder that does not know it.
- RECORD_
HEADER_ LEN - Bytes of per-record framing before the payload.
- RECORD_
OVERHEAD - Total framing overhead per record.
- RECORD_
TRAILER_ LEN - Bytes of per-record framing after the payload (the CRC).
Functions§
- read_
record_ at - Read and CRC-check exactly one record located at
offsetin a seekable source. - write_
record - Append an encoded record to
out.payloadmust fit inu32.