MapCodecConfig

type MapCodecConfig<TPrefix> = object;

Defines the configuration options for map codecs.

The size option determines how the number of entries in the map is stored. It can be:

  • A NumberCodec to prefix the map with its size.
  • A fixed number of entries.
  • 'remainder', which infers the number of entries based on the remaining bytes. This option is only available for fixed-size keys and values.

Type Parameters

Type ParameterDescription
TPrefix extends | NumberCodec | NumberDecoder | NumberEncoderA number codec, encoder, or decoder used for the size prefix.

Properties

size?

optional size: ArrayLikeCodecSize<TPrefix>;

The size of the map.

Default Value

u32 prefix.

On this page