pub fn encode(msg: &ClientMessage) -> Result<String, CodecError>Expand description
Serialise a ClientMessage to its JSON wire representation.
Performance note: allocates a new String per call. A future
encode_into variant accepting a reusable buffer is planned
(see docs/roadmap.md P-2).