Function decode
pub(super) const fn decode<'a, P: PropertyConstraint>(
r: &mut Reader<'a>,
) -> Result<(PacketId, &'a Properties<P>, &'a [u8]), DecodeError>Expand description
Decodes a “packet id + properties + payload” body from the reader.
The remaining bytes after the properties become the payload; an empty payload is rejected, since every packet using this shape carries at least one entry.
§Errors
Returns DecodeError if the data is malformed, the packet id is zero, or
the properties contain disallowed ids.