commy-wire 0.2.3

Commy wire contract (spec, JSON Schema, golden vectors, shared Rust wire types).
Documentation
{
  "_comment": "Golden vectors for the binary range frame. See spec/range-frame.md. Integers are little-endian. Generated once; edit by hand only with a spec change. Entries with header_hex and payload_repeat stand for header bytes followed by `count` copies of `byte` (keeps the file small).",
  "valid": [
    {
      "name": "three bytes at page offset",
      "hex": "01010000000200000000000000001000000000000003000000deadbe",
      "file_id": 1,
      "seq": 2,
      "offset": 4096,
      "data_hex": "deadbe"
    },
    {
      "name": "single byte at offset zero",
      "hex": "01000000000000000000000000000000000000000001000000ff",
      "file_id": 0,
      "seq": 0,
      "offset": 0,
      "data_hex": "ff"
    },
    {
      "name": "large ids and offset",
      "hex": "01ffffffff0100000000000000ffffffff0f000000020000000102",
      "file_id": 4294967295,
      "seq": 1,
      "offset": 68719476735,
      "data_hex": "0102"
    },
    {
      "name": "payload exactly at the 1 MiB maximum",
      "header_hex": "01010000000200000000000000000000000000000000001000",
      "payload_repeat": {
        "byte": "ab",
        "count": 1048576
      },
      "file_id": 1,
      "seq": 2,
      "offset": 0
    }
  ],
  "invalid": [
    {
      "name": "empty input",
      "hex": "",
      "error": "Truncated"
    },
    {
      "name": "shorter than header",
      "hex": "010100000002000000000000000010000000000000030000",
      "error": "Truncated"
    },
    {
      "name": "unknown kind byte",
      "hex": "02010000000200000000000000001000000000000003000000deadbe",
      "error": "BadKind"
    },
    {
      "name": "len says 4 but 3 bytes follow",
      "hex": "01010000000200000000000000001000000000000004000000deadbe",
      "error": "LengthMismatch"
    },
    {
      "name": "len says 3 but 4 bytes follow",
      "hex": "01010000000200000000000000001000000000000003000000deadbeef",
      "error": "LengthMismatch"
    },
    {
      "name": "zero-length range",
      "hex": "01010000000200000000000000001000000000000000000000",
      "error": "EmptyRange"
    },
    {
      "name": "offset plus len overflows u64",
      "hex": "01010000000200000000000000ffffffffffffffff03000000deadbe",
      "error": "OffsetOverflow"
    },
    {
      "name": "payload over the 1 MiB maximum",
      "header_hex": "01010000000200000000000000000000000000000001001000",
      "payload_repeat": {
        "byte": "00",
        "count": 1048577
      },
      "error": "TooLarge"
    }
  ]
}