Skip to main content

message_to_wire_auto

Function message_to_wire_auto 

Source
pub fn message_to_wire_auto(
    from: &str,
    value: &RuntimeValue,
) -> Result<Vec<u8>, String>
Expand description

The genuine no-brainer — “just send it.” Runs the full WireGoal::Smallest bake-off ONLY when the payload is large enough for it to matter, and otherwise ships the plain default (so calling this on every message — including scalars and short strings — costs a single encode pass, not the N-pass search). The result is NEVER larger than the default, ALWAYS self-describing (so it interoperates with every peer, no hint), and round-trips exactly. This is the recommended default sender.