Skip to main content

decode_largest_object

Function decode_largest_object 

Source
fn decode_largest_object(bytes: &[u8]) -> FieldValue
Expand description

Render a LARGEST OBJECT (0x09) parameter value: a Group and an Object, as two varints.

§What a value it cannot read renders as

The raw bytes, as fields::params does. Field extraction runs on a message that has already decoded, so it has no refusal to give, and it has no guarantee the two varints are there: nothing between KeyValuePair::decode and here looks at a 0x09 value’s contents. An empty value fails the first read and a single 0x00 fails the second, which is the nastier of the two — the value looks well formed right up to the point where it is not. Neither read may panic on it.