Making custom adapters
Making custom adapter is very easy. Unless it conforms to SCALE codec principles.
This might be very useful if you want to step out of SCALE's incremental way of serialization.
So let's assume we have a next type:
To make a custom adapter, you could make an adapter like this to reverse variables serialization:
Don't worry about ByteArrays. It's just how our codec works. With your custom data container it might be literally everything. It will be just converted to byte array for our convenience.
And then add this to provider like that:
Feel free to play with custom adapters as much as you want.
Last updated