Module binary_codec

Module binary_codec 

Source
Expand description

Binary TLV (Type-Length-Value) codec for envelope metadata

Encodes envelope metadata as TLV entries for the LNMP container metadata extension block.

§TLV Format

Type (1 byte) | Length (2 bytes, BE) | Value (Length bytes)

§Type Codes

  • 0x10: Timestamp (u64 big-endian)
  • 0x11: Source (UTF-8 string)
  • 0x12: TraceID (UTF-8 string)
  • 0x13: Sequence (u64 big-endian)
  • 0x14: Labels (reserved)

§Canonical Ordering

TLV entries MUST appear in ascending type order for determinism.

Modules§

tlv_type
TLV type codes

Structs§

TlvDecoder
Binary TLV decoder for envelope metadata
TlvEncoder
Binary TLV encoder for envelope metadata