Skip to main content

message_to_wire_negotiated

Function message_to_wire_negotiated 

Source
pub fn message_to_wire_negotiated(
    from: &str,
    value: &RuntimeValue,
    neg: &Negotiated,
    registry: WireTypeRegistry,
) -> Result<Vec<u8>, String>
Expand description

Encode a message TO a peer using EVERYTHING both sides support — the negotiated maximal crush. Applies all the self-describing dials (any peer decodes them) via the size bake-off, but restricts the receiver-capability knobs to the negotiated surface: only compression codecs the receiver can decode, and type-id NAME ELISION only when epochs matched (neg.use_type_id). Refuses to ship a computation the receiver declined. Stays MINIMAL in cost too: a tiny message that name-elision can’t help ships the plain default without paying for the search. Never larger than the default; always self-describing, so it round-trips on the receiver with no hint.