Function decode
pub(super) const fn decode<'a, P: Constraint>(
r: &mut Reader<'a>,
) -> Result<(PacketId, &'a Properties<P>, &'a [u8]), DecodeError>Expand description
Decodes a SUBSCRIBE, UNSUBSCRIBE, SUBACK or UNSUBACK body from the reader.
The remaining bytes after the properties become the payload. An empty payload is rejected, since each of these packets contains at least one entry.
ยงErrors
Returns DecodeError if the data is malformed, the packet id is zero, or
the properties contain disallowed ids.