sizeHint method
If possible give a hint of expected size of the encoding.
This method is used inside default implementation of encode
to avoid re-allocations.
Implementation
@override
int sizeHint(PalletMetadata metadata) {
int size = StrCodec.codec.sizeHint(metadata.name);
size += OptionCodec(PalletStorageMetadata.codec).sizeHint(metadata.storage);
size += OptionCodec(PalletCallMetadata.codec).sizeHint(metadata.calls);
size += OptionCodec(PalletEventMetadata.codec).sizeHint(metadata.event);
size += SequenceCodec(PalletConstantMetadata.codec).sizeHint(metadata.constants);
size += OptionCodec(PalletErrorMetadata.codec).sizeHint(metadata.error);
size += U8Codec.codec.sizeHint(metadata.index);
size += SequenceCodec(StrCodec.codec).sizeHint(metadata.docs);
return size;
}