Skip to main content

Module wire

Module wire 

Source
Expand description

The binary wire for Go and Java: values cross as compact bytes whose encoders and decoders are generated per type on both sides, without JSON text or reflection.

Layout, little endian: I64 and F64 as 8 bytes, Bool as 1 byte. Str, List, Map and Struct start with a presence byte (0 for null/nil, 1 otherwise); strings then carry a u32 length and UTF-8 bytes, lists and maps a u32 count and their items (maps as string key, value). Opt is a presence byte and the value. Tuple (several results) is its items in order.

Enums§

Ty
A source-language type the wire carries. native is the type as the source spells it.

Constants§

WIRE_RS
src/wire.rs of a generated crate: the reader, the writer, and schema-driven conversion of serde_json::Value (for ports that keep structured values as JSON values).

Functions§

rust_read
Rust code reading a value of t into the port type rust from reader r; None when the port type does not fit the wire type (the function then keeps the JSON bridge).
rust_read_args
Rust statements that read every argument of a port function from r; None when one does not fit.
rust_write
Rust statements writing expr (a reference to the port type rust) as t into writer w.
schema_expr
The wire::Schema constant expression for a type, for read_value/write_value.