From 6e50de66c8264633353585f3cd3823ae611dc747 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 23 Mar 2022 03:37:53 +0000 Subject: [PATCH] Update auto-generated bindings --- lightning-c-bindings/include/lightning.h | 8 +++++++- lightning-c-bindings/src/c_types/derived.rs | 21 ++++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index 7274897..9b2fefe 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -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. */ diff --git a/lightning-c-bindings/src/c_types/derived.rs b/lightning-c-bindings/src/c_types/derived.rs index 6c18446..62c6ccc 100644 --- a/lightning-c-bindings/src/c_types/derived.rs +++ b/lightning-c-bindings/src/c_types/derived.rs @@ -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] -- 2.39.5