Skip to main content

Module wire

Module wire 

Source
Expand description

serde adapters for the quirks of the protobuf-JSON encoding.

The harness serialises its protobuf messages with the canonical JSON mapping, which departs from what #[derive(Deserialize)] would assume in three places:

  • 64-bit integers are strings. {"seqNum": "17"}, not {"seqNum": 17}. Decoders are expected to accept both, so opt_int and vec_int take either and always emit the string form.
  • bytes is base64. opt_bytes and vec_bytes decode standard and URL-safe alphabets, with or without padding, and emit standard padded.
  • Enums are value names, though numbers are also legal input. Generated enums decode through EnumRepr and keep unrecognised values rather than failing, so a harness newer than this crate stays readable.

Modules§

opt_bytes
A bytes field that may be absent, encoded as base64.
opt_int
A 64-bit integer that may be absent, encoded as a JSON string.
vec_bytes
A repeated bytes field, encoded as base64 strings.
vec_int
A repeated 64-bit integer field, encoded as JSON strings.

Enums§

EnumRepr
How a protobuf enum arrived on the wire: by name, or by number.