getMapDecoder
Call Signature
Returns a decoder for maps.
This decoder deserializes maps where the keys and values are decoded
using the provided key and value decoders. The number of entries
is determined by the size configuration.
For more details, see getMapCodec.
Type Parameters
| Type Parameter | Description |
|---|---|
TToKey | The type of the keys after decoding. |
TToValue | The type of the values after decoding. |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | Decoder<TToKey> | The decoder for the map's keys. |
value | Decoder<TToValue> | The decoder for the map's values. |
config | MapCodecConfig<NumberDecoder> & object | Configuration options for decoding the map. |
Returns
FixedSizeDecoder<Map<TToKey, TToValue>, 0>
A FixedSizeDecoder or VariableSizeDecoder for decoding maps.
Example
Decoding a map with a u32 size prefix.
See
Call Signature
Returns a decoder for maps.
This decoder deserializes maps where the keys and values are decoded
using the provided key and value decoders. The number of entries
is determined by the size configuration.
For more details, see getMapCodec.
Type Parameters
| Type Parameter | Description |
|---|---|
TToKey | The type of the keys after decoding. |
TToValue | The type of the values after decoding. |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | FixedSizeDecoder<TToKey> | The decoder for the map's keys. |
value | FixedSizeDecoder<TToValue> | The decoder for the map's values. |
config | MapCodecConfig<NumberDecoder> & object | Configuration options for decoding the map. |
Returns
FixedSizeDecoder<Map<TToKey, TToValue>>
A FixedSizeDecoder or VariableSizeDecoder for decoding maps.
Example
Decoding a map with a u32 size prefix.
See
Call Signature
Returns a decoder for maps.
This decoder deserializes maps where the keys and values are decoded
using the provided key and value decoders. The number of entries
is determined by the size configuration.
For more details, see getMapCodec.
Type Parameters
| Type Parameter | Description |
|---|---|
TToKey | The type of the keys after decoding. |
TToValue | The type of the values after decoding. |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | Decoder<TToKey> | The decoder for the map's keys. |
value | Decoder<TToValue> | The decoder for the map's values. |
config? | MapCodecConfig<NumberDecoder> | Configuration options for decoding the map. |
Returns
VariableSizeDecoder<Map<TToKey, TToValue>>
A FixedSizeDecoder or VariableSizeDecoder for decoding maps.
Example
Decoding a map with a u32 size prefix.