# [−][src]Function mynewt::encoding::tinycbor::cbor_encoder_create_map

    pub unsafe extern "C" fn cbor_encoder_create_map(
        encoder: *mut CborEncoder,
        mapEncoder: *mut CborEncoder,
        length: usize
    ) -> CborError

Creates a CBOR map in the CBOR stream provided by \a encoder and initializes \a mapEncoder so that items can be added to the map using the CborEncoder functions. The map must be terminated by calling either cbor_encoder_close_container() or cbor_encoder_close_container_checked() with the same \a encoder and \a mapEncoder parameters.

The number of pair of items inserted into the map must be exactly \a length items, otherwise the stream is invalid. If the number of items is not known when creating the map, the constant \ref CborIndefiniteLength may be passed as length instead.

\b{Implementation limitation:} TinyCBOR cannot encode more than SIZE_MAX/2 key-value pairs in the stream. If the length \a length is larger than this value, this function returns error CborErrorDataTooLarge.

\sa cbor_encoder_create_array

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)