Function decode_one_based_map_as_vector

Source
pub fn decode_one_based_map_as_vector<'buffer, Context, DecodedType: Decode<'buffer, Context>, ResultType: From<DecodedType>>(
    d: &mut Decoder<'buffer>,
    context: &mut Context,
) -> Result<Vec<ResultType>, Error>
Expand description

Decodes a CBOR map with one-based integer keys into a vector.

Each element may have a mapping function applied to convert it from its raw decoded type into its final result type, if desired; this avoids the need to allocate a second vector to collect the results of the conversion afterwards.

ยงErrors

This function fails if the map contains duplicate keys, non-natural keys, or keys outside legal bounds.