]> git.bitcoin.ninja Git - rust-lightning/commit
Add c_bindings version of OfferBuilder
authorJeffrey Czyz <jkczyz@gmail.com>
Fri, 23 Feb 2024 22:33:23 +0000 (16:33 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Wed, 6 Mar 2024 15:25:26 +0000 (09:25 -0600)
commitd9ab2fa58177fc390891e0229e9db269e8d54f6e
tree9cbd8e93a1ce5f483b83fa621006fbe364a7af04
parenta517925f6c4bda897d226a31be1a45bef173def9
Add c_bindings version of OfferBuilder

Use the macros introduced in the previous commit to define two builders
for each type parameterization of OfferBuilder
- OfferWithExplicitMetadataBuilder
- OfferWithDerivedMetadataBuilder

The difference between these and OfferBuilder is that these have methods
that take `self` by mutable reference instead of by value and don't
return anything instead returning the modified builder. This is required
because bindings don't support move semantics nor impl blocks specific
to a certain type parameterization. Because of this, the builder's
contents must be cloned when building an Offer.

Keeps OfferBuilder defined so that it can be used internally in
ChannelManager::create_offer_builder even when compiled for c_bindings.
lightning/src/ln/channelmanager.rs
lightning/src/offers/invoice.rs
lightning/src/offers/invoice_request.rs
lightning/src/offers/offer.rs