Skip to main content

encode

Function encode 

Source
pub fn encode(tag: Tag, payload: &Payload) -> Result<String>
Expand description

Encode a (Tag, Payload) as a v0.1 ms1 string.

Per SPEC §3.5 + §3.5.1:

  • Encoder validates Payload length first (rejects out-of-set entr lengths).
  • Encoder rejects reserved-not-emitted tags symmetrically with the decoder (SPEC §4 rule 7), preventing a v0.1 ms-codec from emitting a string that v0.1 ms-codec itself cannot decode.