[bindings] Update eq/clone trait fns to take object, not this_arg
authorMatt Corallo <git@bluematt.me>
Mon, 26 Oct 2020 01:39:58 +0000 (21:39 -0400)
committerMatt Corallo <git@bluematt.me>
Mon, 23 Nov 2020 16:08:34 +0000 (11:08 -0500)
commitd169966f76c739d184a294fe08446b3b787fff8f
tree9ff0be78dd9db89ebeb2666a399ab9c73a3a3261
parentd73711104482c78d501a5ea47a39b466585ca34d
[bindings] Update eq/clone trait fns to take object, not this_arg

When a trait is required to implement eq/clone (eg in the case of
`SocketDescriptor`), the generated trait struct contains an
eq/clone function which takes a `this_arg` pointer. Since the trait
object can always be read to get the `this_arg` pointer, there is
no loss of generality to pass the trait object itself, and it
provides a bit more flexibility when the trait could be one of
several implementations (which we use in the Java higher-level
bindings).
c-bindings-gen/src/main.rs
lightning-c-bindings/demo.cpp