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>
Mon, 3 Feb 2020 02:38:53 +0000 (21:38 -0500)
commit3cf1df26f0a2a860b0db5c81e691567496ede393
tree5def8987d15f274790c7378671ecf4004b16c687
parentebb55ff2aae55146239ff8fecd79c02ea4c3580f
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