From: Matt Corallo Date: Tue, 5 Jan 2021 02:00:26 +0000 (-0500) Subject: - bindings updates X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=962f0f4fb48d8140422500e19ffb54914856da99;p=rust-lightning - bindings updates --- diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index 848be197a..92900cb83 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -241,12 +241,10 @@ typedef struct LDKPublicKey { uint8_t compressed_form[33]; } LDKPublicKey; -typedef struct LDKC2TupleTempl_u64__u64 { +typedef struct LDKC2Tuple_u64u64Z { uint64_t a; uint64_t b; -} LDKC2TupleTempl_u64__u64; - -typedef struct LDKC2TupleTempl_u64__u64 LDKC2Tuple_u64u64Z; +} LDKC2Tuple_u64u64Z; /** * When on-chain outputs are created by rust-lightning (which our counterparty is not able to @@ -321,14 +319,14 @@ typedef struct LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body { struct LDKPublicKey per_commitment_point; uint16_t to_self_delay; struct LDKTxOut output; - LDKC2Tuple_u64u64Z key_derivation_params; + struct LDKC2Tuple_u64u64Z key_derivation_params; struct LDKPublicKey revocation_pubkey; } LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body; typedef struct LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body { struct LDKOutPoint outpoint; struct LDKTxOut output; - LDKC2Tuple_u64u64Z key_derivation_params; + struct LDKC2Tuple_u64u64Z key_derivation_params; } LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body; typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor { @@ -1019,15 +1017,13 @@ typedef struct LDKCVec_EventZ { uintptr_t datalen; } LDKCVec_EventZ; -typedef struct LDKC2TupleTempl_usize__Transaction { +typedef struct LDKC2Tuple_usizeTransactionZ { uintptr_t a; struct LDKTransaction b; -} LDKC2TupleTempl_usize__Transaction; - -typedef struct LDKC2TupleTempl_usize__Transaction LDKC2Tuple_usizeTransactionZ; +} LDKC2Tuple_usizeTransactionZ; typedef struct LDKCVec_C2Tuple_usizeTransactionZZ { - struct LDKC2TupleTempl_usize__Transaction *data; + struct LDKC2Tuple_usizeTransactionZ *data; uintptr_t datalen; } LDKCVec_C2Tuple_usizeTransactionZZ; @@ -1133,39 +1129,33 @@ typedef struct LDKCResult_NoneMonitorUpdateErrorZ { bool result_ok; } LDKCResult_NoneMonitorUpdateErrorZ; -typedef struct LDKC2TupleTempl_OutPoint__CVec_u8Z { +typedef struct LDKC2Tuple_OutPointScriptZ { struct LDKOutPoint a; struct LDKCVec_u8Z b; -} LDKC2TupleTempl_OutPoint__CVec_u8Z; - -typedef struct LDKC2TupleTempl_OutPoint__CVec_u8Z LDKC2Tuple_OutPointScriptZ; +} LDKC2Tuple_OutPointScriptZ; typedef struct LDKCVec_TransactionZ { struct LDKTransaction *data; uintptr_t datalen; } LDKCVec_TransactionZ; -typedef struct LDKC2TupleTempl_u32__TxOut { +typedef struct LDKC2Tuple_u32TxOutZ { uint32_t a; struct LDKTxOut b; -} LDKC2TupleTempl_u32__TxOut; - -typedef struct LDKC2TupleTempl_u32__TxOut LDKC2Tuple_u32TxOutZ; +} LDKC2Tuple_u32TxOutZ; typedef struct LDKCVec_C2Tuple_u32TxOutZZ { - struct LDKC2TupleTempl_u32__TxOut *data; + struct LDKC2Tuple_u32TxOutZ *data; uintptr_t datalen; } LDKCVec_C2Tuple_u32TxOutZZ; -typedef struct LDKC2TupleTempl_ThirtyTwoBytes__CVec_C2Tuple_u32TxOutZZ { +typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { struct LDKThirtyTwoBytes a; struct LDKCVec_C2Tuple_u32TxOutZZ b; -} LDKC2TupleTempl_ThirtyTwoBytes__CVec_C2Tuple_u32TxOutZZ; - -typedef struct LDKC2TupleTempl_ThirtyTwoBytes__CVec_C2Tuple_u32TxOutZZ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ; +} LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ; typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { - struct LDKC2TupleTempl_ThirtyTwoBytes__CVec_C2Tuple_u32TxOutZZ *data; + struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data; uintptr_t datalen; } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ; @@ -1192,13 +1182,13 @@ typedef struct LDKCVec_SignatureZ { uintptr_t datalen; } LDKCVec_SignatureZ; -typedef struct LDKC2TupleTempl_Signature__CVec_SignatureZ { +typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ { struct LDKSignature a; struct LDKCVec_SignatureZ b; -} LDKC2TupleTempl_Signature__CVec_SignatureZ; +} LDKC2Tuple_SignatureCVec_SignatureZZ; typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { - struct LDKC2TupleTempl_Signature__CVec_SignatureZ *result; + struct LDKC2Tuple_SignatureCVec_SignatureZZ *result; /** * Note that this value is always NULL, as there are no contents in the Err variant */ @@ -1376,7 +1366,7 @@ typedef struct LDKChannelKeys { * some SpendableOutputDescriptor types. These should be sufficient to identify this * ChannelKeys object uniquely and lookup or re-derive its keys. */ - LDKC2Tuple_u64u64Z (*key_derivation_params)(const void *this_arg); + struct LDKC2Tuple_u64u64Z (*key_derivation_params)(const void *this_arg); /** * Create a signature for a counterparty's commitment transaction and associated HTLC transactions. * @@ -1507,15 +1497,13 @@ typedef struct MUST_USE_STRUCT LDKChannelMonitor { bool is_owned; } LDKChannelMonitor; -typedef struct LDKC2TupleTempl_ThirtyTwoBytes__ChannelMonitor { +typedef struct LDKC2Tuple_BlockHashChannelMonitorZ { struct LDKThirtyTwoBytes a; struct LDKChannelMonitor b; -} LDKC2TupleTempl_ThirtyTwoBytes__ChannelMonitor; - -typedef struct LDKC2TupleTempl_ThirtyTwoBytes__ChannelMonitor LDKC2Tuple_BlockHashChannelMonitorZ; +} LDKC2Tuple_BlockHashChannelMonitorZ; typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { - struct LDKC2TupleTempl_ThirtyTwoBytes__ChannelMonitor *result; + struct LDKC2Tuple_BlockHashChannelMonitorZ *result; struct LDKDecodeError *err; } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr; @@ -1534,8 +1522,6 @@ typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ { bool result_ok; } LDKCResult_SpendableOutputDescriptorDecodeErrorZ; -typedef struct LDKC2TupleTempl_Signature__CVec_SignatureZ LDKC2Tuple_SignatureCVec_SignatureZZ; - typedef union LDKCResult_ChanKeySignerDecodeErrorZPtr { struct LDKChannelKeys *result; struct LDKDecodeError *err; @@ -2000,15 +1986,13 @@ typedef struct MUST_USE_STRUCT LDKChannelManager { bool is_owned; } LDKChannelManager; -typedef struct LDKC2TupleTempl_ThirtyTwoBytes__ChannelManager { +typedef struct LDKC2Tuple_BlockHashChannelManagerZ { struct LDKThirtyTwoBytes a; struct LDKChannelManager b; -} LDKC2TupleTempl_ThirtyTwoBytes__ChannelManager; - -typedef struct LDKC2TupleTempl_ThirtyTwoBytes__ChannelManager LDKC2Tuple_BlockHashChannelManagerZ; +} LDKC2Tuple_BlockHashChannelManagerZ; typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { - struct LDKC2TupleTempl_ThirtyTwoBytes__ChannelManager *result; + struct LDKC2Tuple_BlockHashChannelManagerZ *result; struct LDKDecodeError *err; } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr; @@ -2142,16 +2126,14 @@ typedef struct LDKCResult_boolLightningErrorZ { bool result_ok; } LDKCResult_boolLightningErrorZ; -typedef struct LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate { +typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { struct LDKChannelAnnouncement a; struct LDKChannelUpdate b; struct LDKChannelUpdate c; -} LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate; - -typedef struct LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ; +} LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ; typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { - struct LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *data; + struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data; uintptr_t datalen; } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ; @@ -3494,24 +3476,6 @@ typedef struct MUST_USE_STRUCT LDKChannelInfo { bool is_owned; } LDKChannelInfo; -extern const void (*C2Tuple_usizeTransactionZ_free)(LDKC2Tuple_usizeTransactionZ); - -extern const void (*C2Tuple_OutPointScriptZ_free)(LDKC2Tuple_OutPointScriptZ); - -extern const void (*C2Tuple_u32TxOutZ_free)(LDKC2Tuple_u32TxOutZ); - -extern const void (*C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free)(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ); - -extern const void (*C2Tuple_BlockHashChannelMonitorZ_free)(LDKC2Tuple_BlockHashChannelMonitorZ); - -extern const void (*C2Tuple_u64u64Z_free)(LDKC2Tuple_u64u64Z); - -extern const void (*C2Tuple_SignatureCVec_SignatureZZ_free)(LDKC2Tuple_SignatureCVec_SignatureZZ); - -extern const void (*C2Tuple_BlockHashChannelManagerZ_free)(LDKC2Tuple_BlockHashChannelManagerZ); - -extern const void (*C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free)(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ); - extern const uintptr_t MAX_BUF_SIZE; extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT; @@ -3528,7 +3492,9 @@ void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res); void CVec_EventZ_free(struct LDKCVec_EventZ _res); -LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); +void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res); + +struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res); @@ -3552,27 +3518,37 @@ struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(st void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res); -LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b); +void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res); + +struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b); void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); -LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b); +void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res); + +struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b); void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res); -LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b); +void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res); + +struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b); void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res); -LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b); +void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res); + +struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b); -struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2TupleTempl_ThirtyTwoBytes__ChannelMonitor o); +struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o); struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e); void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res); -LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b); +void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res); + +struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b); struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o); @@ -3582,9 +3558,11 @@ void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_Spenda void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res); -LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b); +void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res); -struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2TupleTempl_Signature__CVec_SignatureZ o); +struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b); + +struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o); struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void); @@ -3638,9 +3616,11 @@ void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); -LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); +void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res); + +struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); -struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2TupleTempl_ThirtyTwoBytes__ChannelManager o); +struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o); struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e); @@ -3674,7 +3654,9 @@ struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDK void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); -LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); +void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res); + +struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res); @@ -4443,7 +4425,7 @@ MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChanne /** * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for. */ -MUST_USE_RES LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg); +MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg); /** * Get the list of HTLCs who's status has been updated on chain. This should be called by @@ -4626,7 +4608,7 @@ void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONN /** * Create a new InMemoryChannelKeys */ -MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, LDKC2Tuple_u64u64Z key_derivation_params); +MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKC2Tuple_u64u64Z key_derivation_params); /** * Counterparty pubkeys. diff --git a/lightning-c-bindings/src/c_types/derived.rs b/lightning-c-bindings/src/c_types/derived.rs index 2995efe06..5cc96b6c1 100644 --- a/lightning-c-bindings/src/c_types/derived.rs +++ b/lightning-c-bindings/src/c_types/derived.rs @@ -102,9 +102,26 @@ impl Drop for CVec_EventZ { unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -pub type C2Tuple_usizeTransactionZ = crate::c_types::C2TupleTempl; +#[repr(C)] +pub struct C2Tuple_usizeTransactionZ { + pub a: usize, + pub b: crate::c_types::Transaction, +} +impl From<(usize, crate::c_types::Transaction)> for C2Tuple_usizeTransactionZ { + fn from (tup: (usize, crate::c_types::Transaction)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_usizeTransactionZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (usize, crate::c_types::Transaction) { + (self.a, self.b) + } +} #[no_mangle] -pub static C2Tuple_usizeTransactionZ_free: extern "C" fn(C2Tuple_usizeTransactionZ) = crate::c_types::C2TupleTempl_free::; +pub extern "C" fn C2Tuple_usizeTransactionZ_free(_res: C2Tuple_usizeTransactionZ) { } #[no_mangle] pub extern "C" fn C2Tuple_usizeTransactionZ_new(a: usize, b: crate::c_types::Transaction) -> C2Tuple_usizeTransactionZ { C2Tuple_usizeTransactionZ { a, b, } @@ -112,23 +129,23 @@ pub extern "C" fn C2Tuple_usizeTransactionZ_new(a: usize, b: crate::c_types::Tra #[repr(C)] pub struct CVec_C2Tuple_usizeTransactionZZ { - pub data: *mut crate::c_types::C2TupleTempl, + pub data: *mut crate::c_types::derived::C2Tuple_usizeTransactionZ, pub datalen: usize } impl CVec_C2Tuple_usizeTransactionZZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec> { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::C2TupleTempl] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_usizeTransactionZ] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From>> for CVec_C2Tuple_usizeTransactionZZ { - fn from(v: Vec>) -> Self { +impl From> for CVec_C2Tuple_usizeTransactionZZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } @@ -350,9 +367,26 @@ impl From; +#[repr(C)] +pub struct C2Tuple_OutPointScriptZ { + pub a: crate::chain::transaction::OutPoint, + pub b: crate::c_types::derived::CVec_u8Z, +} +impl From<(crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z)> for C2Tuple_OutPointScriptZ { + fn from (tup: (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_OutPointScriptZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z) { + (self.a, self.b) + } +} #[no_mangle] -pub static C2Tuple_OutPointScriptZ_free: extern "C" fn(C2Tuple_OutPointScriptZ) = crate::c_types::C2TupleTempl_free::; +pub extern "C" fn C2Tuple_OutPointScriptZ_free(_res: C2Tuple_OutPointScriptZ) { } #[no_mangle] pub extern "C" fn C2Tuple_OutPointScriptZ_new(a: crate::chain::transaction::OutPoint, b: crate::c_types::derived::CVec_u8Z) -> C2Tuple_OutPointScriptZ { C2Tuple_OutPointScriptZ { a, b, } @@ -390,9 +424,26 @@ impl Drop for CVec_TransactionZ { unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -pub type C2Tuple_u32TxOutZ = crate::c_types::C2TupleTempl; +#[repr(C)] +pub struct C2Tuple_u32TxOutZ { + pub a: u32, + pub b: crate::c_types::TxOut, +} +impl From<(u32, crate::c_types::TxOut)> for C2Tuple_u32TxOutZ { + fn from (tup: (u32, crate::c_types::TxOut)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_u32TxOutZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (u32, crate::c_types::TxOut) { + (self.a, self.b) + } +} #[no_mangle] -pub static C2Tuple_u32TxOutZ_free: extern "C" fn(C2Tuple_u32TxOutZ) = crate::c_types::C2TupleTempl_free::; +pub extern "C" fn C2Tuple_u32TxOutZ_free(_res: C2Tuple_u32TxOutZ) { } #[no_mangle] pub extern "C" fn C2Tuple_u32TxOutZ_new(a: u32, b: crate::c_types::TxOut) -> C2Tuple_u32TxOutZ { C2Tuple_u32TxOutZ { a, b, } @@ -400,23 +451,23 @@ pub extern "C" fn C2Tuple_u32TxOutZ_new(a: u32, b: crate::c_types::TxOut) -> C2T #[repr(C)] pub struct CVec_C2Tuple_u32TxOutZZ { - pub data: *mut crate::c_types::C2TupleTempl, + pub data: *mut crate::c_types::derived::C2Tuple_u32TxOutZ, pub datalen: usize } impl CVec_C2Tuple_u32TxOutZZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec> { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::C2TupleTempl] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_u32TxOutZ] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From>> for CVec_C2Tuple_u32TxOutZZ { - fn from(v: Vec>) -> Self { +impl From> for CVec_C2Tuple_u32TxOutZZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } @@ -430,9 +481,26 @@ impl Drop for CVec_C2Tuple_u32TxOutZZ { unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -pub type C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ = crate::c_types::C2TupleTempl; +#[repr(C)] +pub struct C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { + pub a: crate::c_types::ThirtyTwoBytes, + pub b: crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ, +} +impl From<(crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ)> for C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { + fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ) { + (self.a, self.b) + } +} #[no_mangle] -pub static C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free: extern "C" fn(C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) = crate::c_types::C2TupleTempl_free::; +pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) { } #[no_mangle] pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ) -> C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { a, b, } @@ -440,23 +508,23 @@ pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a: crate::c_types::Th #[repr(C)] pub struct CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { - pub data: *mut crate::c_types::C2TupleTempl, + pub data: *mut crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ, pub datalen: usize } impl CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec> { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::C2TupleTempl] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From>> for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { - fn from(v: Vec>) -> Self { +impl From> for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } @@ -470,9 +538,26 @@ impl Drop for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -pub type C2Tuple_BlockHashChannelMonitorZ = crate::c_types::C2TupleTempl; +#[repr(C)] +pub struct C2Tuple_BlockHashChannelMonitorZ { + pub a: crate::c_types::ThirtyTwoBytes, + pub b: crate::chain::channelmonitor::ChannelMonitor, +} +impl From<(crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor)> for C2Tuple_BlockHashChannelMonitorZ { + fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_BlockHashChannelMonitorZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor) { + (self.a, self.b) + } +} #[no_mangle] -pub static C2Tuple_BlockHashChannelMonitorZ_free: extern "C" fn(C2Tuple_BlockHashChannelMonitorZ) = crate::c_types::C2TupleTempl_free::; +pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_free(_res: C2Tuple_BlockHashChannelMonitorZ) { } #[no_mangle] pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::chain::channelmonitor::ChannelMonitor) -> C2Tuple_BlockHashChannelMonitorZ { C2Tuple_BlockHashChannelMonitorZ { a, b, } @@ -480,7 +565,7 @@ pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_new(a: crate::c_types::Thirty #[repr(C)] pub union CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { - pub result: *mut crate::c_types::C2TupleTempl, + pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] @@ -489,7 +574,7 @@ pub struct CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o: crate::c_types::C2TupleTempl) -> CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { +pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ) -> CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), @@ -521,8 +606,8 @@ impl Drop for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { } } } -impl From, crate::ln::msgs::DecodeError>> for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl, crate::ln::msgs::DecodeError>) -> Self { +impl From> for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; @@ -538,9 +623,34 @@ impl From; +#[repr(C)] +pub struct C2Tuple_u64u64Z { + pub a: u64, + pub b: u64, +} +impl From<(u64, u64)> for C2Tuple_u64u64Z { + fn from (tup: (u64, u64)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_u64u64Z { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (u64, u64) { + (self.a, self.b) + } +} +impl Clone for C2Tuple_u64u64Z { + fn clone(&self) -> Self { + Self { + a: self.a.clone(), + b: self.b.clone(), + } + } +} #[no_mangle] -pub static C2Tuple_u64u64Z_free: extern "C" fn(C2Tuple_u64u64Z) = crate::c_types::C2TupleTempl_free::; +pub extern "C" fn C2Tuple_u64u64Z_free(_res: C2Tuple_u64u64Z) { } #[no_mangle] pub extern "C" fn C2Tuple_u64u64Z_new(a: u64, b: u64) -> C2Tuple_u64u64Z { C2Tuple_u64u64Z { a, b, } @@ -638,9 +748,26 @@ impl Drop for CVec_SignatureZ { unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -pub type C2Tuple_SignatureCVec_SignatureZZ = crate::c_types::C2TupleTempl; +#[repr(C)] +pub struct C2Tuple_SignatureCVec_SignatureZZ { + pub a: crate::c_types::Signature, + pub b: crate::c_types::derived::CVec_SignatureZ, +} +impl From<(crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ)> for C2Tuple_SignatureCVec_SignatureZZ { + fn from (tup: (crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_SignatureCVec_SignatureZZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ) { + (self.a, self.b) + } +} #[no_mangle] -pub static C2Tuple_SignatureCVec_SignatureZZ_free: extern "C" fn(C2Tuple_SignatureCVec_SignatureZZ) = crate::c_types::C2TupleTempl_free::; +pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_free(_res: C2Tuple_SignatureCVec_SignatureZZ) { } #[no_mangle] pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_new(a: crate::c_types::Signature, b: crate::c_types::derived::CVec_SignatureZ) -> C2Tuple_SignatureCVec_SignatureZZ { C2Tuple_SignatureCVec_SignatureZZ { a, b, } @@ -648,7 +775,7 @@ pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_new(a: crate::c_types::Signa #[repr(C)] pub union CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { - pub result: *mut crate::c_types::C2TupleTempl, + pub result: *mut crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ, /// Note that this value is always NULL, as there are no contents in the Err variant pub err: *mut std::ffi::c_void, } @@ -658,7 +785,7 @@ pub struct CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o: crate::c_types::C2TupleTempl) -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { +pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o: crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ) -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { result: Box::into_raw(Box::new(o)), @@ -687,8 +814,8 @@ impl Drop for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { } } } -impl From, u8>> for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { - fn from(mut o: crate::c_types::CResultTempl, u8>) -> Self { +impl From> for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; @@ -1212,9 +1339,26 @@ impl Drop for CVec_ChannelMonitorZ { unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -pub type C2Tuple_BlockHashChannelManagerZ = crate::c_types::C2TupleTempl; +#[repr(C)] +pub struct C2Tuple_BlockHashChannelManagerZ { + pub a: crate::c_types::ThirtyTwoBytes, + pub b: crate::ln::channelmanager::ChannelManager, +} +impl From<(crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)> for C2Tuple_BlockHashChannelManagerZ { + fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_BlockHashChannelManagerZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager) { + (self.a, self.b) + } +} #[no_mangle] -pub static C2Tuple_BlockHashChannelManagerZ_free: extern "C" fn(C2Tuple_BlockHashChannelManagerZ) = crate::c_types::C2TupleTempl_free::; +pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_free(_res: C2Tuple_BlockHashChannelManagerZ) { } #[no_mangle] pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::ln::channelmanager::ChannelManager) -> C2Tuple_BlockHashChannelManagerZ { C2Tuple_BlockHashChannelManagerZ { a, b, } @@ -1222,7 +1366,7 @@ pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_new(a: crate::c_types::Thirty #[repr(C)] pub union CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { - pub result: *mut crate::c_types::C2TupleTempl, + pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] @@ -1231,7 +1375,7 @@ pub struct CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o: crate::c_types::C2TupleTempl) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { +pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), @@ -1263,8 +1407,8 @@ impl Drop for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { } } } -impl From, crate::ln::msgs::DecodeError>> for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl, crate::ln::msgs::DecodeError>) -> Self { +impl From> for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; @@ -1620,9 +1764,28 @@ impl From> f } } } -pub type C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ = crate::c_types::C3TupleTempl; +#[repr(C)] +pub struct C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { + pub a: crate::ln::msgs::ChannelAnnouncement, + pub b: crate::ln::msgs::ChannelUpdate, + pub c: crate::ln::msgs::ChannelUpdate, +} +impl From<(crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate)> for C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { + fn from (tup: (crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate)) -> Self { + Self { + a: tup.0, + b: tup.1, + c: tup.2, + } + } +} +impl C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate) { + (self.a, self.b, self.c) + } +} #[no_mangle] -pub static C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free: extern "C" fn(C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) = crate::c_types::C3TupleTempl_free::; +pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) { } #[no_mangle] pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a: crate::ln::msgs::ChannelAnnouncement, b: crate::ln::msgs::ChannelUpdate, c: crate::ln::msgs::ChannelUpdate) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { a, b, c, } @@ -1630,23 +1793,23 @@ pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a: #[repr(C)] pub struct CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { - pub data: *mut crate::c_types::C3TupleTempl, + pub data: *mut crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, pub datalen: usize } impl CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec> { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::C3TupleTempl] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From>> for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { - fn from(v: Vec>) -> Self { +impl From> for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } }