fn encode_parameters(
parameters: &[KeyValuePair],
buf: &mut impl BufMut,
) -> Result<(), CodecError>Expand description
Encode a parameter list, refusing every repeat the sender’s rule forbids and every token that is not one.
One function for both namespaces, unlike the decode side: the sender’s rule exempts a parameter type rather than a namespace, and the exempt type has the same code point in each. The token rule is the same in both namespaces too, so the two decode functions that state it agree with the one here.
A token that cannot be decoded 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.