Skip to main content

decode_refused

Function decode_refused 

Source
pub fn decode_refused(payload: &[u8]) -> Result<Refused<'_>, BadRefusal>
Expand description

Decode a Refused frame’s payload (after the length prefix, tag included), checking its length exactly: the reason’s declared length must be what follows it, and it must be UTF-8. The inverse of encode_transport_response for that frame, kept beside it so its layout has one home. A payload whose tag is not TAG_REFUSED is the caller’s to rule out; this reads past the tag without looking at it.