Add macros for building TLV (de)serializers.
authorMatt Corallo <git@bluematt.me>
Mon, 3 Feb 2020 01:44:54 +0000 (20:44 -0500)
committerMatt Corallo <git@bluematt.me>
Tue, 11 Feb 2020 18:48:56 +0000 (13:48 -0500)
commitc326061108d12f58fde5c4fb7f214fb308275f72
tree7b0cb3eaa518ced283bb97910e9699c6de4aa138
parent85c8410f897d21268da7242d420c292a41c1a6ba
Add macros for building TLV (de)serializers.

There's quite a bit of machinery included here, but it neatly
avoids any dynamic allocation during TLV deserialization, and the
calling side looks nice and simple. The macro-generated code is
pretty nice, though has some redundant if statements (I haven't
checked if they get optimized out yet, but I can't imagine they
don't).
lightning/src/util/ser_macros.rs