Skip to main content

Module wire

Module wire 

Source
Expand description

The serde wire-name surface: JSON/serialization names, never host-language identifiers.

serde_rename and serde_rename_all define wire names only. Nothing here may be used to spell a public host identifier — that is super::host’s job. ~keep

Functions§

apply_serde_rename_all
Apply a serde rename_all strategy to a Rust identifier.
field_uses_duration_map_wire
True when a Duration-typed field’s wire shape is the object serde’s derive produces ({"secs":u64,"nanos":u32}) rather than the shape a hand-written codec writes.
serde_wire_name
Resolve a serde wire name, with explicit serde(rename) taking precedence.
wire_field_name
Resolve a wire field name from field metadata.
wire_field_name_camel
Resolve a wire field name for the napi/wasm JSON-passthrough emitters, where the product decision is that JavaScript-facing JSON is camelCase all the way down (including nested payloads), independent of whatever rename_all the Rust container declares for its own serde wire format. An explicit #[serde(rename = "...")] is author intent and still wins verbatim – only a name derived mechanically from the Rust field identifier gets recased.
wire_variant_value
Resolve a wire enum variant value from variant metadata.