getSetDecoder
Call Signature
getSetDecoder<
TTo
>(item
,config
):FixedSizeDecoder
<Set
<TTo
>,0
>
Returns a decoder for sets of items.
This decoder deserializes a Set<T>
from a byte array by decoding each item using the provided item decoder.
The number of items is determined by a u32
size prefix by default.
For more details, see getSetCodec.
Type Parameters
Type Parameter | Description |
---|---|
TTo | The type of the items in the set after decoding. |
Parameters
Parameter | Type | Description |
---|---|---|
item | Decoder <TTo > | The decoder to use for each set item. |
config | SetCodecConfig <NumberDecoder > & object | Optional configuration specifying the size strategy. |
Returns
FixedSizeDecoder
<Set
<TTo
>, 0
>
A Decoder<Set<TTo>>
for decoding sets of items.
Example
Decoding a set of u8
numbers.
See
Call Signature
getSetDecoder<
TTo
>(item
,config
):FixedSizeDecoder
<Set
<TTo
>>
Returns a decoder for sets of items.
This decoder deserializes a Set<T>
from a byte array by decoding each item using the provided item decoder.
The number of items is determined by a u32
size prefix by default.
For more details, see getSetCodec.
Type Parameters
Type Parameter | Description |
---|---|
TTo | The type of the items in the set after decoding. |
Parameters
Parameter | Type | Description |
---|---|---|
item | FixedSizeDecoder <TTo > | The decoder to use for each set item. |
config | SetCodecConfig <NumberDecoder > & object | Optional configuration specifying the size strategy. |
Returns
FixedSizeDecoder
<Set
<TTo
>>
A Decoder<Set<TTo>>
for decoding sets of items.
Example
Decoding a set of u8
numbers.
See
Call Signature
getSetDecoder<
TTo
>(item
,config?
):VariableSizeDecoder
<Set
<TTo
>>
Returns a decoder for sets of items.
This decoder deserializes a Set<T>
from a byte array by decoding each item using the provided item decoder.
The number of items is determined by a u32
size prefix by default.
For more details, see getSetCodec.
Type Parameters
Type Parameter | Description |
---|---|
TTo | The type of the items in the set after decoding. |
Parameters
Parameter | Type | Description |
---|---|---|
item | Decoder <TTo > | The decoder to use for each set item. |
config? | SetCodecConfig <NumberDecoder > | Optional configuration specifying the size strategy. |
Returns
VariableSizeDecoder
<Set
<TTo
>>
A Decoder<Set<TTo>>
for decoding sets of items.
Example
Decoding a set of u8
numbers.