cborrs::cbordet

Function cbor_det_mk_map

Source
pub fn cbor_det_mk_map<'a>(
    a: &'a mut [CborDetMapEntry<'a>],
) -> Option<CborDet<'a>>
Expand description

Constructs a map from a slice of map entries. This function does not copy its input array. If the input slice has more than $2^64 - 1$ entries, then this function returns None and does not change the input slice. Otherwise, this function tries to sort the input slice in-place with respect to the key order specified in Section 4.2.1 of RFC 8949 (without actually serializing the map entries.) If the sorting detects duplicate keys, then this function returns None. Otherwise, it returns Some(object). Due to the sorting, this function consumes stack space logarithmic in the size of the input slice, and linear in the maximum nesting of map entry keys, and the function may have changed the order of map entries in the input slice.