]> git.bitcoin.ninja Git - ldk-c-bindings/commit
Add a note in output documentation for fields with refs to opaques
authorMatt Corallo <git@bluematt.me>
Tue, 28 Jun 2022 02:14:20 +0000 (02:14 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 28 Jun 2022 17:16:28 +0000 (17:16 +0000)
commit6edaf9acd0fea061016c5975f563e9b77708a622
tree7101315423952fdc3ca18ad7546af66bf22dae1e
parent6cc86203e1c1108db5cee5bf0173e7cd50e8984d
Add a note in output documentation for fields with refs to opaques

Because we (probably shouldn't, but do) map "opaque" structs with
an `is_owned` field instead of having a dedicated reference type,
fields which are a `Deref<Struct>` are simply mapped as
`OpaqueMappedStruct`. This is confusing for downstream `lightning.h`
consumers as they cannot differentiate between a field that expects
to own a `Struct` and one which expects to own a reference to it.

This is worked around here by adding documentation which can be
matched on, though ultimately structs should move towards full
ownership.
c-bindings-gen/src/blocks.rs