pub fn encode_transport_response(
response: &TransportResponse,
buf: &mut [u8],
) -> Result<usize, ProtocolError>Expand description
Encode a transport-level response into buf.
Returns the total bytes written including the 4-byte LE length
prefix. Returns Err(Truncated) if buf is too small for the
variant (5 bytes for tag-only variants, BATCH_END_FRAME_LEN for
BatchEnd, BatchEndDegraded and ServerBusy, 39 for Challenge,
and up to MAX_CONTROL_FRAME_LEN for Refused).