[bindings] Concretize Result types without type aliasing
authorMatt Corallo <git@bluematt.me>
Mon, 4 Jan 2021 22:29:25 +0000 (17:29 -0500)
committerMatt Corallo <git@bluematt.me>
Thu, 11 Feb 2021 03:24:16 +0000 (22:24 -0500)
commitc5c2d464ba56deb6ce6a32df14adecebcbdb07cc
treefc433ed44be08a5d37055b9c23bac4d9a5cab84a
parentf5e0e228fd73f0b44381af28c13ffc2df67608c0
[bindings] Concretize Result types without type aliasing

While the type aliasing trick works great for cbindgen,
wasm_bindgen doesn't support it and requires fully-concrete types.
In order to better support wasm_bindgen in the future, we do so
here, adding a function which manually writes out almost the exact
thing which was templated previously in concrete form.

As a nice side-effect, we no longer have to allocate and free a u8
for generic parameters which were `()` (though we still do in some
conversion functions, which we can get rid of when we similarly
concretize all generics fully).
c-bindings-gen/src/blocks.rs
c-bindings-gen/src/types.rs
lightning-c-bindings/src/c_types/mod.rs