Skip to main content

encode_parameters_in

Function encode_parameters_in 

Source
fn encode_parameters_in(
    parameters: &[KeyValuePair],
    buf: &mut impl BufMut,
    message_namespace: bool,
) -> Result<(), CodecError>
Expand description

Encode a count-prefixed parameter list with delta-encoded Types, refusing every list decode_parameters_in would refuse.

The duplicate rule is the sender’s own and does not consult a registry, so there is nothing for the two namespaces to disagree about there. The value rules are the reader’s, and message_namespace says which of them apply for the same reason it does on the decode side: a setup 0x21 or 0x22 is not the parameter the version-specific rules describe.

They are applied on the way out because each of them states a close. A value that is not what its Type defines is one the receiver must close the session over, so writing it is not a way to send it — the sender’s first sign of trouble would be the session going.