gballet / zig-rlp

A zig implementation of RLP
The Unlicense
7 stars 2 forks source link

implement custom (de)serializers #10

Open gballet opened 9 months ago

gballet commented 9 months ago

Some complex structure/unions might want to implement their custom serialization. It would be nice to allow types to support that, as zig does.

gballet commented 8 months ago

actually this has already been implemented, I don't know why I ran into a problem where that didn't work. There must be a bug if that is the case, but I no longer have any example handy :|

jsign commented 8 months ago

@gballet, I've used custom decoders and everything looked fine. I'd to do https://github.com/gballet/zig-rlp/pull/19 but that's a bit lateral.

I used a custom decodr so I could decode a union type (i.e: the Tx type). (More about that soon in phant).