]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Update auto-generated bindings
authorMatt Corallo <git@bluematt.me>
Wed, 23 Mar 2022 03:37:53 +0000 (03:37 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 23 Mar 2022 18:04:41 +0000 (18:04 +0000)
lightning-c-bindings/include/lightning.h
lightning-c-bindings/src/c_types/derived.rs

index 727489780438b2595db5bcf60e4e175f6b7cda3b..9b2fefef3187d1a115850889294d35d36d1bf06a 100644 (file)
@@ -4319,7 +4319,7 @@ typedef struct LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ {
    /**
     * The element at position 1
     */
-   const struct LDKNetworkGraph *NONNULL_PTR b;
+   struct LDKNetworkGraph b;
 } LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ;
 
 
@@ -13407,6 +13407,12 @@ void CResult_ProbabilisticScoringParametersDecodeErrorZ_free(struct LDKCResult_P
  */
 struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ CResult_ProbabilisticScoringParametersDecodeErrorZ_clone(const struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ *NONNULL_PTR orig);
 
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ C2Tuple_ProbabilisticScoringParametersNetworkGraphZ_clone(const struct LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ *NONNULL_PTR orig);
+
 /**
  * Creates a new C2Tuple_ProbabilisticScoringParametersNetworkGraphZ from the contained elements.
  */
index 6c184463ee7c27bc2bd41999278cc0d86da43860..62c6ccc14c95a9c83dd741db5b130c17de5f12bb 100644 (file)
@@ -3963,10 +3963,10 @@ pub struct C2Tuple_ProbabilisticScoringParametersNetworkGraphZ {
        /// The element at position 0
        pub a: crate::lightning::routing::scoring::ProbabilisticScoringParameters,
        /// The element at position 1
-       pub b: &'static crate::lightning::routing::network_graph::NetworkGraph,
+       pub b: crate::lightning::routing::network_graph::NetworkGraph,
 }
-impl From<(crate::lightning::routing::scoring::ProbabilisticScoringParameters, &'static crate::lightning::routing::network_graph::NetworkGraph)> for C2Tuple_ProbabilisticScoringParametersNetworkGraphZ {
-       fn from (tup: (crate::lightning::routing::scoring::ProbabilisticScoringParameters, &'static crate::lightning::routing::network_graph::NetworkGraph)) -> Self {
+impl From<(crate::lightning::routing::scoring::ProbabilisticScoringParameters, crate::lightning::routing::network_graph::NetworkGraph)> for C2Tuple_ProbabilisticScoringParametersNetworkGraphZ {
+       fn from (tup: (crate::lightning::routing::scoring::ProbabilisticScoringParameters, crate::lightning::routing::network_graph::NetworkGraph)) -> Self {
                Self {
                        a: tup.0,
                        b: tup.1,
@@ -3974,14 +3974,25 @@ impl From<(crate::lightning::routing::scoring::ProbabilisticScoringParameters, &
        }
 }
 impl C2Tuple_ProbabilisticScoringParametersNetworkGraphZ {
-       #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::lightning::routing::scoring::ProbabilisticScoringParameters, &'static crate::lightning::routing::network_graph::NetworkGraph) {
+       #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::lightning::routing::scoring::ProbabilisticScoringParameters, crate::lightning::routing::network_graph::NetworkGraph) {
                (self.a, self.b)
        }
 }
+impl Clone for C2Tuple_ProbabilisticScoringParametersNetworkGraphZ {
+       fn clone(&self) -> Self {
+               Self {
+                       a: Clone::clone(&self.a),
+                       b: crate::lightning::routing::network_graph::NetworkGraph { inner: self.b.inner, is_owned: false},              }
+       }
+}
+#[no_mangle]
+/// Creates a new tuple which has the same data as `orig`
+/// but with all dynamically-allocated buffers duplicated in new buffers.
+pub extern "C" fn C2Tuple_ProbabilisticScoringParametersNetworkGraphZ_clone(orig: &C2Tuple_ProbabilisticScoringParametersNetworkGraphZ) -> C2Tuple_ProbabilisticScoringParametersNetworkGraphZ { Clone::clone(&orig) }
 /// Creates a new C2Tuple_ProbabilisticScoringParametersNetworkGraphZ from the contained elements.
 #[no_mangle]
 pub extern "C" fn C2Tuple_ProbabilisticScoringParametersNetworkGraphZ_new(a: crate::lightning::routing::scoring::ProbabilisticScoringParameters, b: &'static crate::lightning::routing::network_graph::NetworkGraph) -> C2Tuple_ProbabilisticScoringParametersNetworkGraphZ {
-       C2Tuple_ProbabilisticScoringParametersNetworkGraphZ { a, b, }
+       C2Tuple_ProbabilisticScoringParametersNetworkGraphZ { a, b: crate::lightning::routing::network_graph::NetworkGraph { inner: b.inner, is_owned: false}, }
 }
 
 #[no_mangle]