2 pub union CResult_SecretKeyErrorZPtr {
3 pub result: *mut crate::c_types::SecretKey,
4 pub err: *mut crate::c_types::Secp256k1Error,
7 pub struct CResult_SecretKeyErrorZ {
8 pub contents: CResult_SecretKeyErrorZPtr,
12 pub extern "C" fn CResult_SecretKeyErrorZ_ok(o: crate::c_types::SecretKey) -> CResult_SecretKeyErrorZ {
13 CResult_SecretKeyErrorZ {
14 contents: CResult_SecretKeyErrorZPtr {
15 result: Box::into_raw(Box::new(o)),
21 pub extern "C" fn CResult_SecretKeyErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_SecretKeyErrorZ {
22 CResult_SecretKeyErrorZ {
23 contents: CResult_SecretKeyErrorZPtr {
24 err: Box::into_raw(Box::new(e)),
30 pub extern "C" fn CResult_SecretKeyErrorZ_free(_res: CResult_SecretKeyErrorZ) { }
31 impl Drop for CResult_SecretKeyErrorZ {
34 if unsafe { !(self.contents.result as *mut ()).is_null() } {
35 let _ = unsafe { Box::from_raw(self.contents.result) };
38 if unsafe { !(self.contents.err as *mut ()).is_null() } {
39 let _ = unsafe { Box::from_raw(self.contents.err) };
44 impl From<crate::c_types::CResultTempl<crate::c_types::SecretKey, crate::c_types::Secp256k1Error>> for CResult_SecretKeyErrorZ {
45 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::SecretKey, crate::c_types::Secp256k1Error>) -> Self {
46 let contents = if o.result_ok {
47 let result = unsafe { o.contents.result };
48 unsafe { o.contents.result = std::ptr::null_mut() };
49 CResult_SecretKeyErrorZPtr { result }
51 let err = unsafe { o.contents.err };
52 unsafe { o.contents.err = std::ptr::null_mut(); }
53 CResult_SecretKeyErrorZPtr { err }
57 result_ok: o.result_ok,
62 pub union CResult_PublicKeyErrorZPtr {
63 pub result: *mut crate::c_types::PublicKey,
64 pub err: *mut crate::c_types::Secp256k1Error,
67 pub struct CResult_PublicKeyErrorZ {
68 pub contents: CResult_PublicKeyErrorZPtr,
72 pub extern "C" fn CResult_PublicKeyErrorZ_ok(o: crate::c_types::PublicKey) -> CResult_PublicKeyErrorZ {
73 CResult_PublicKeyErrorZ {
74 contents: CResult_PublicKeyErrorZPtr {
75 result: Box::into_raw(Box::new(o)),
81 pub extern "C" fn CResult_PublicKeyErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_PublicKeyErrorZ {
82 CResult_PublicKeyErrorZ {
83 contents: CResult_PublicKeyErrorZPtr {
84 err: Box::into_raw(Box::new(e)),
90 pub extern "C" fn CResult_PublicKeyErrorZ_free(_res: CResult_PublicKeyErrorZ) { }
91 impl Drop for CResult_PublicKeyErrorZ {
94 if unsafe { !(self.contents.result as *mut ()).is_null() } {
95 let _ = unsafe { Box::from_raw(self.contents.result) };
98 if unsafe { !(self.contents.err as *mut ()).is_null() } {
99 let _ = unsafe { Box::from_raw(self.contents.err) };
104 impl From<crate::c_types::CResultTempl<crate::c_types::PublicKey, crate::c_types::Secp256k1Error>> for CResult_PublicKeyErrorZ {
105 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::PublicKey, crate::c_types::Secp256k1Error>) -> Self {
106 let contents = if o.result_ok {
107 let result = unsafe { o.contents.result };
108 unsafe { o.contents.result = std::ptr::null_mut() };
109 CResult_PublicKeyErrorZPtr { result }
111 let err = unsafe { o.contents.err };
112 unsafe { o.contents.err = std::ptr::null_mut(); }
113 CResult_PublicKeyErrorZPtr { err }
117 result_ok: o.result_ok,
122 pub union CResult_TxCreationKeysDecodeErrorZPtr {
123 pub result: *mut crate::ln::chan_utils::TxCreationKeys,
124 pub err: *mut crate::ln::msgs::DecodeError,
127 pub struct CResult_TxCreationKeysDecodeErrorZ {
128 pub contents: CResult_TxCreationKeysDecodeErrorZPtr,
132 pub extern "C" fn CResult_TxCreationKeysDecodeErrorZ_ok(o: crate::ln::chan_utils::TxCreationKeys) -> CResult_TxCreationKeysDecodeErrorZ {
133 CResult_TxCreationKeysDecodeErrorZ {
134 contents: CResult_TxCreationKeysDecodeErrorZPtr {
135 result: Box::into_raw(Box::new(o)),
141 pub extern "C" fn CResult_TxCreationKeysDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_TxCreationKeysDecodeErrorZ {
142 CResult_TxCreationKeysDecodeErrorZ {
143 contents: CResult_TxCreationKeysDecodeErrorZPtr {
144 err: Box::into_raw(Box::new(e)),
150 pub extern "C" fn CResult_TxCreationKeysDecodeErrorZ_free(_res: CResult_TxCreationKeysDecodeErrorZ) { }
151 impl Drop for CResult_TxCreationKeysDecodeErrorZ {
154 if unsafe { !(self.contents.result as *mut ()).is_null() } {
155 let _ = unsafe { Box::from_raw(self.contents.result) };
158 if unsafe { !(self.contents.err as *mut ()).is_null() } {
159 let _ = unsafe { Box::from_raw(self.contents.err) };
164 impl From<crate::c_types::CResultTempl<crate::ln::chan_utils::TxCreationKeys, crate::ln::msgs::DecodeError>> for CResult_TxCreationKeysDecodeErrorZ {
165 fn from(mut o: crate::c_types::CResultTempl<crate::ln::chan_utils::TxCreationKeys, crate::ln::msgs::DecodeError>) -> Self {
166 let contents = if o.result_ok {
167 let result = unsafe { o.contents.result };
168 unsafe { o.contents.result = std::ptr::null_mut() };
169 CResult_TxCreationKeysDecodeErrorZPtr { result }
171 let err = unsafe { o.contents.err };
172 unsafe { o.contents.err = std::ptr::null_mut(); }
173 CResult_TxCreationKeysDecodeErrorZPtr { err }
177 result_ok: o.result_ok,
181 impl Clone for CResult_TxCreationKeysDecodeErrorZ {
182 fn clone(&self) -> Self {
184 Self { result_ok: true, contents: CResult_TxCreationKeysDecodeErrorZPtr {
185 result: Box::into_raw(Box::new(<crate::ln::chan_utils::TxCreationKeys>::clone(unsafe { &*self.contents.result })))
188 Self { result_ok: false, contents: CResult_TxCreationKeysDecodeErrorZPtr {
189 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
195 pub extern "C" fn CResult_TxCreationKeysDecodeErrorZ_clone(orig: &CResult_TxCreationKeysDecodeErrorZ) -> CResult_TxCreationKeysDecodeErrorZ { orig.clone() }
197 pub union CResult_ChannelPublicKeysDecodeErrorZPtr {
198 pub result: *mut crate::ln::chan_utils::ChannelPublicKeys,
199 pub err: *mut crate::ln::msgs::DecodeError,
202 pub struct CResult_ChannelPublicKeysDecodeErrorZ {
203 pub contents: CResult_ChannelPublicKeysDecodeErrorZPtr,
207 pub extern "C" fn CResult_ChannelPublicKeysDecodeErrorZ_ok(o: crate::ln::chan_utils::ChannelPublicKeys) -> CResult_ChannelPublicKeysDecodeErrorZ {
208 CResult_ChannelPublicKeysDecodeErrorZ {
209 contents: CResult_ChannelPublicKeysDecodeErrorZPtr {
210 result: Box::into_raw(Box::new(o)),
216 pub extern "C" fn CResult_ChannelPublicKeysDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelPublicKeysDecodeErrorZ {
217 CResult_ChannelPublicKeysDecodeErrorZ {
218 contents: CResult_ChannelPublicKeysDecodeErrorZPtr {
219 err: Box::into_raw(Box::new(e)),
225 pub extern "C" fn CResult_ChannelPublicKeysDecodeErrorZ_free(_res: CResult_ChannelPublicKeysDecodeErrorZ) { }
226 impl Drop for CResult_ChannelPublicKeysDecodeErrorZ {
229 if unsafe { !(self.contents.result as *mut ()).is_null() } {
230 let _ = unsafe { Box::from_raw(self.contents.result) };
233 if unsafe { !(self.contents.err as *mut ()).is_null() } {
234 let _ = unsafe { Box::from_raw(self.contents.err) };
239 impl From<crate::c_types::CResultTempl<crate::ln::chan_utils::ChannelPublicKeys, crate::ln::msgs::DecodeError>> for CResult_ChannelPublicKeysDecodeErrorZ {
240 fn from(mut o: crate::c_types::CResultTempl<crate::ln::chan_utils::ChannelPublicKeys, crate::ln::msgs::DecodeError>) -> Self {
241 let contents = if o.result_ok {
242 let result = unsafe { o.contents.result };
243 unsafe { o.contents.result = std::ptr::null_mut() };
244 CResult_ChannelPublicKeysDecodeErrorZPtr { result }
246 let err = unsafe { o.contents.err };
247 unsafe { o.contents.err = std::ptr::null_mut(); }
248 CResult_ChannelPublicKeysDecodeErrorZPtr { err }
252 result_ok: o.result_ok,
256 impl Clone for CResult_ChannelPublicKeysDecodeErrorZ {
257 fn clone(&self) -> Self {
259 Self { result_ok: true, contents: CResult_ChannelPublicKeysDecodeErrorZPtr {
260 result: Box::into_raw(Box::new(<crate::ln::chan_utils::ChannelPublicKeys>::clone(unsafe { &*self.contents.result })))
263 Self { result_ok: false, contents: CResult_ChannelPublicKeysDecodeErrorZPtr {
264 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
270 pub extern "C" fn CResult_ChannelPublicKeysDecodeErrorZ_clone(orig: &CResult_ChannelPublicKeysDecodeErrorZ) -> CResult_ChannelPublicKeysDecodeErrorZ { orig.clone() }
272 pub union CResult_TxCreationKeysErrorZPtr {
273 pub result: *mut crate::ln::chan_utils::TxCreationKeys,
274 pub err: *mut crate::c_types::Secp256k1Error,
277 pub struct CResult_TxCreationKeysErrorZ {
278 pub contents: CResult_TxCreationKeysErrorZPtr,
282 pub extern "C" fn CResult_TxCreationKeysErrorZ_ok(o: crate::ln::chan_utils::TxCreationKeys) -> CResult_TxCreationKeysErrorZ {
283 CResult_TxCreationKeysErrorZ {
284 contents: CResult_TxCreationKeysErrorZPtr {
285 result: Box::into_raw(Box::new(o)),
291 pub extern "C" fn CResult_TxCreationKeysErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_TxCreationKeysErrorZ {
292 CResult_TxCreationKeysErrorZ {
293 contents: CResult_TxCreationKeysErrorZPtr {
294 err: Box::into_raw(Box::new(e)),
300 pub extern "C" fn CResult_TxCreationKeysErrorZ_free(_res: CResult_TxCreationKeysErrorZ) { }
301 impl Drop for CResult_TxCreationKeysErrorZ {
304 if unsafe { !(self.contents.result as *mut ()).is_null() } {
305 let _ = unsafe { Box::from_raw(self.contents.result) };
308 if unsafe { !(self.contents.err as *mut ()).is_null() } {
309 let _ = unsafe { Box::from_raw(self.contents.err) };
314 impl From<crate::c_types::CResultTempl<crate::ln::chan_utils::TxCreationKeys, crate::c_types::Secp256k1Error>> for CResult_TxCreationKeysErrorZ {
315 fn from(mut o: crate::c_types::CResultTempl<crate::ln::chan_utils::TxCreationKeys, crate::c_types::Secp256k1Error>) -> Self {
316 let contents = if o.result_ok {
317 let result = unsafe { o.contents.result };
318 unsafe { o.contents.result = std::ptr::null_mut() };
319 CResult_TxCreationKeysErrorZPtr { result }
321 let err = unsafe { o.contents.err };
322 unsafe { o.contents.err = std::ptr::null_mut(); }
323 CResult_TxCreationKeysErrorZPtr { err }
327 result_ok: o.result_ok,
332 pub union CResult_HTLCOutputInCommitmentDecodeErrorZPtr {
333 pub result: *mut crate::ln::chan_utils::HTLCOutputInCommitment,
334 pub err: *mut crate::ln::msgs::DecodeError,
337 pub struct CResult_HTLCOutputInCommitmentDecodeErrorZ {
338 pub contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr,
342 pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o: crate::ln::chan_utils::HTLCOutputInCommitment) -> CResult_HTLCOutputInCommitmentDecodeErrorZ {
343 CResult_HTLCOutputInCommitmentDecodeErrorZ {
344 contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr {
345 result: Box::into_raw(Box::new(o)),
351 pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_HTLCOutputInCommitmentDecodeErrorZ {
352 CResult_HTLCOutputInCommitmentDecodeErrorZ {
353 contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr {
354 err: Box::into_raw(Box::new(e)),
360 pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res: CResult_HTLCOutputInCommitmentDecodeErrorZ) { }
361 impl Drop for CResult_HTLCOutputInCommitmentDecodeErrorZ {
364 if unsafe { !(self.contents.result as *mut ()).is_null() } {
365 let _ = unsafe { Box::from_raw(self.contents.result) };
368 if unsafe { !(self.contents.err as *mut ()).is_null() } {
369 let _ = unsafe { Box::from_raw(self.contents.err) };
374 impl From<crate::c_types::CResultTempl<crate::ln::chan_utils::HTLCOutputInCommitment, crate::ln::msgs::DecodeError>> for CResult_HTLCOutputInCommitmentDecodeErrorZ {
375 fn from(mut o: crate::c_types::CResultTempl<crate::ln::chan_utils::HTLCOutputInCommitment, crate::ln::msgs::DecodeError>) -> Self {
376 let contents = if o.result_ok {
377 let result = unsafe { o.contents.result };
378 unsafe { o.contents.result = std::ptr::null_mut() };
379 CResult_HTLCOutputInCommitmentDecodeErrorZPtr { result }
381 let err = unsafe { o.contents.err };
382 unsafe { o.contents.err = std::ptr::null_mut(); }
383 CResult_HTLCOutputInCommitmentDecodeErrorZPtr { err }
387 result_ok: o.result_ok,
391 impl Clone for CResult_HTLCOutputInCommitmentDecodeErrorZ {
392 fn clone(&self) -> Self {
394 Self { result_ok: true, contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr {
395 result: Box::into_raw(Box::new(<crate::ln::chan_utils::HTLCOutputInCommitment>::clone(unsafe { &*self.contents.result })))
398 Self { result_ok: false, contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr {
399 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
405 pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig: &CResult_HTLCOutputInCommitmentDecodeErrorZ) -> CResult_HTLCOutputInCommitmentDecodeErrorZ { orig.clone() }
407 pub union CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
408 pub result: *mut crate::ln::chan_utils::CounterpartyChannelTransactionParameters,
409 pub err: *mut crate::ln::msgs::DecodeError,
412 pub struct CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
413 pub contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr,
417 pub extern "C" fn CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o: crate::ln::chan_utils::CounterpartyChannelTransactionParameters) -> CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
418 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
419 contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
420 result: Box::into_raw(Box::new(o)),
426 pub extern "C" fn CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
427 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
428 contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
429 err: Box::into_raw(Box::new(e)),
435 pub extern "C" fn CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res: CResult_CounterpartyChannelTransactionParametersDecodeErrorZ) { }
436 impl Drop for CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
439 if unsafe { !(self.contents.result as *mut ()).is_null() } {
440 let _ = unsafe { Box::from_raw(self.contents.result) };
443 if unsafe { !(self.contents.err as *mut ()).is_null() } {
444 let _ = unsafe { Box::from_raw(self.contents.err) };
449 impl From<crate::c_types::CResultTempl<crate::ln::chan_utils::CounterpartyChannelTransactionParameters, crate::ln::msgs::DecodeError>> for CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
450 fn from(mut o: crate::c_types::CResultTempl<crate::ln::chan_utils::CounterpartyChannelTransactionParameters, crate::ln::msgs::DecodeError>) -> Self {
451 let contents = if o.result_ok {
452 let result = unsafe { o.contents.result };
453 unsafe { o.contents.result = std::ptr::null_mut() };
454 CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { result }
456 let err = unsafe { o.contents.err };
457 unsafe { o.contents.err = std::ptr::null_mut(); }
458 CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { err }
462 result_ok: o.result_ok,
466 impl Clone for CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
467 fn clone(&self) -> Self {
469 Self { result_ok: true, contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
470 result: Box::into_raw(Box::new(<crate::ln::chan_utils::CounterpartyChannelTransactionParameters>::clone(unsafe { &*self.contents.result })))
473 Self { result_ok: false, contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
474 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
480 pub extern "C" fn CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig: &CResult_CounterpartyChannelTransactionParametersDecodeErrorZ) -> CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { orig.clone() }
482 pub union CResult_ChannelTransactionParametersDecodeErrorZPtr {
483 pub result: *mut crate::ln::chan_utils::ChannelTransactionParameters,
484 pub err: *mut crate::ln::msgs::DecodeError,
487 pub struct CResult_ChannelTransactionParametersDecodeErrorZ {
488 pub contents: CResult_ChannelTransactionParametersDecodeErrorZPtr,
492 pub extern "C" fn CResult_ChannelTransactionParametersDecodeErrorZ_ok(o: crate::ln::chan_utils::ChannelTransactionParameters) -> CResult_ChannelTransactionParametersDecodeErrorZ {
493 CResult_ChannelTransactionParametersDecodeErrorZ {
494 contents: CResult_ChannelTransactionParametersDecodeErrorZPtr {
495 result: Box::into_raw(Box::new(o)),
501 pub extern "C" fn CResult_ChannelTransactionParametersDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelTransactionParametersDecodeErrorZ {
502 CResult_ChannelTransactionParametersDecodeErrorZ {
503 contents: CResult_ChannelTransactionParametersDecodeErrorZPtr {
504 err: Box::into_raw(Box::new(e)),
510 pub extern "C" fn CResult_ChannelTransactionParametersDecodeErrorZ_free(_res: CResult_ChannelTransactionParametersDecodeErrorZ) { }
511 impl Drop for CResult_ChannelTransactionParametersDecodeErrorZ {
514 if unsafe { !(self.contents.result as *mut ()).is_null() } {
515 let _ = unsafe { Box::from_raw(self.contents.result) };
518 if unsafe { !(self.contents.err as *mut ()).is_null() } {
519 let _ = unsafe { Box::from_raw(self.contents.err) };
524 impl From<crate::c_types::CResultTempl<crate::ln::chan_utils::ChannelTransactionParameters, crate::ln::msgs::DecodeError>> for CResult_ChannelTransactionParametersDecodeErrorZ {
525 fn from(mut o: crate::c_types::CResultTempl<crate::ln::chan_utils::ChannelTransactionParameters, crate::ln::msgs::DecodeError>) -> Self {
526 let contents = if o.result_ok {
527 let result = unsafe { o.contents.result };
528 unsafe { o.contents.result = std::ptr::null_mut() };
529 CResult_ChannelTransactionParametersDecodeErrorZPtr { result }
531 let err = unsafe { o.contents.err };
532 unsafe { o.contents.err = std::ptr::null_mut(); }
533 CResult_ChannelTransactionParametersDecodeErrorZPtr { err }
537 result_ok: o.result_ok,
541 impl Clone for CResult_ChannelTransactionParametersDecodeErrorZ {
542 fn clone(&self) -> Self {
544 Self { result_ok: true, contents: CResult_ChannelTransactionParametersDecodeErrorZPtr {
545 result: Box::into_raw(Box::new(<crate::ln::chan_utils::ChannelTransactionParameters>::clone(unsafe { &*self.contents.result })))
548 Self { result_ok: false, contents: CResult_ChannelTransactionParametersDecodeErrorZPtr {
549 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
555 pub extern "C" fn CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig: &CResult_ChannelTransactionParametersDecodeErrorZ) -> CResult_ChannelTransactionParametersDecodeErrorZ { orig.clone() }
557 pub struct CVec_SignatureZ {
558 pub data: *mut crate::c_types::Signature,
561 impl CVec_SignatureZ {
562 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::Signature> {
563 if self.datalen == 0 { return Vec::new(); }
564 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
565 self.data = std::ptr::null_mut();
569 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::Signature] {
570 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
573 impl From<Vec<crate::c_types::Signature>> for CVec_SignatureZ {
574 fn from(v: Vec<crate::c_types::Signature>) -> Self {
575 let datalen = v.len();
576 let data = Box::into_raw(v.into_boxed_slice());
577 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
581 pub extern "C" fn CVec_SignatureZ_free(_res: CVec_SignatureZ) { }
582 impl Drop for CVec_SignatureZ {
584 if self.datalen == 0 { return; }
585 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
588 impl Clone for CVec_SignatureZ {
589 fn clone(&self) -> Self {
590 let mut res = Vec::new();
591 if self.datalen == 0 { return Self::from(res); }
592 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
597 pub union CResult_HolderCommitmentTransactionDecodeErrorZPtr {
598 pub result: *mut crate::ln::chan_utils::HolderCommitmentTransaction,
599 pub err: *mut crate::ln::msgs::DecodeError,
602 pub struct CResult_HolderCommitmentTransactionDecodeErrorZ {
603 pub contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr,
607 pub extern "C" fn CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o: crate::ln::chan_utils::HolderCommitmentTransaction) -> CResult_HolderCommitmentTransactionDecodeErrorZ {
608 CResult_HolderCommitmentTransactionDecodeErrorZ {
609 contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr {
610 result: Box::into_raw(Box::new(o)),
616 pub extern "C" fn CResult_HolderCommitmentTransactionDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_HolderCommitmentTransactionDecodeErrorZ {
617 CResult_HolderCommitmentTransactionDecodeErrorZ {
618 contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr {
619 err: Box::into_raw(Box::new(e)),
625 pub extern "C" fn CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res: CResult_HolderCommitmentTransactionDecodeErrorZ) { }
626 impl Drop for CResult_HolderCommitmentTransactionDecodeErrorZ {
629 if unsafe { !(self.contents.result as *mut ()).is_null() } {
630 let _ = unsafe { Box::from_raw(self.contents.result) };
633 if unsafe { !(self.contents.err as *mut ()).is_null() } {
634 let _ = unsafe { Box::from_raw(self.contents.err) };
639 impl From<crate::c_types::CResultTempl<crate::ln::chan_utils::HolderCommitmentTransaction, crate::ln::msgs::DecodeError>> for CResult_HolderCommitmentTransactionDecodeErrorZ {
640 fn from(mut o: crate::c_types::CResultTempl<crate::ln::chan_utils::HolderCommitmentTransaction, crate::ln::msgs::DecodeError>) -> Self {
641 let contents = if o.result_ok {
642 let result = unsafe { o.contents.result };
643 unsafe { o.contents.result = std::ptr::null_mut() };
644 CResult_HolderCommitmentTransactionDecodeErrorZPtr { result }
646 let err = unsafe { o.contents.err };
647 unsafe { o.contents.err = std::ptr::null_mut(); }
648 CResult_HolderCommitmentTransactionDecodeErrorZPtr { err }
652 result_ok: o.result_ok,
656 impl Clone for CResult_HolderCommitmentTransactionDecodeErrorZ {
657 fn clone(&self) -> Self {
659 Self { result_ok: true, contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr {
660 result: Box::into_raw(Box::new(<crate::ln::chan_utils::HolderCommitmentTransaction>::clone(unsafe { &*self.contents.result })))
663 Self { result_ok: false, contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr {
664 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
670 pub extern "C" fn CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig: &CResult_HolderCommitmentTransactionDecodeErrorZ) -> CResult_HolderCommitmentTransactionDecodeErrorZ { orig.clone() }
672 pub union CResult_BuiltCommitmentTransactionDecodeErrorZPtr {
673 pub result: *mut crate::ln::chan_utils::BuiltCommitmentTransaction,
674 pub err: *mut crate::ln::msgs::DecodeError,
677 pub struct CResult_BuiltCommitmentTransactionDecodeErrorZ {
678 pub contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr,
682 pub extern "C" fn CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o: crate::ln::chan_utils::BuiltCommitmentTransaction) -> CResult_BuiltCommitmentTransactionDecodeErrorZ {
683 CResult_BuiltCommitmentTransactionDecodeErrorZ {
684 contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr {
685 result: Box::into_raw(Box::new(o)),
691 pub extern "C" fn CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_BuiltCommitmentTransactionDecodeErrorZ {
692 CResult_BuiltCommitmentTransactionDecodeErrorZ {
693 contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr {
694 err: Box::into_raw(Box::new(e)),
700 pub extern "C" fn CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res: CResult_BuiltCommitmentTransactionDecodeErrorZ) { }
701 impl Drop for CResult_BuiltCommitmentTransactionDecodeErrorZ {
704 if unsafe { !(self.contents.result as *mut ()).is_null() } {
705 let _ = unsafe { Box::from_raw(self.contents.result) };
708 if unsafe { !(self.contents.err as *mut ()).is_null() } {
709 let _ = unsafe { Box::from_raw(self.contents.err) };
714 impl From<crate::c_types::CResultTempl<crate::ln::chan_utils::BuiltCommitmentTransaction, crate::ln::msgs::DecodeError>> for CResult_BuiltCommitmentTransactionDecodeErrorZ {
715 fn from(mut o: crate::c_types::CResultTempl<crate::ln::chan_utils::BuiltCommitmentTransaction, crate::ln::msgs::DecodeError>) -> Self {
716 let contents = if o.result_ok {
717 let result = unsafe { o.contents.result };
718 unsafe { o.contents.result = std::ptr::null_mut() };
719 CResult_BuiltCommitmentTransactionDecodeErrorZPtr { result }
721 let err = unsafe { o.contents.err };
722 unsafe { o.contents.err = std::ptr::null_mut(); }
723 CResult_BuiltCommitmentTransactionDecodeErrorZPtr { err }
727 result_ok: o.result_ok,
731 impl Clone for CResult_BuiltCommitmentTransactionDecodeErrorZ {
732 fn clone(&self) -> Self {
734 Self { result_ok: true, contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr {
735 result: Box::into_raw(Box::new(<crate::ln::chan_utils::BuiltCommitmentTransaction>::clone(unsafe { &*self.contents.result })))
738 Self { result_ok: false, contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr {
739 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
745 pub extern "C" fn CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig: &CResult_BuiltCommitmentTransactionDecodeErrorZ) -> CResult_BuiltCommitmentTransactionDecodeErrorZ { orig.clone() }
747 pub union CResult_CommitmentTransactionDecodeErrorZPtr {
748 pub result: *mut crate::ln::chan_utils::CommitmentTransaction,
749 pub err: *mut crate::ln::msgs::DecodeError,
752 pub struct CResult_CommitmentTransactionDecodeErrorZ {
753 pub contents: CResult_CommitmentTransactionDecodeErrorZPtr,
757 pub extern "C" fn CResult_CommitmentTransactionDecodeErrorZ_ok(o: crate::ln::chan_utils::CommitmentTransaction) -> CResult_CommitmentTransactionDecodeErrorZ {
758 CResult_CommitmentTransactionDecodeErrorZ {
759 contents: CResult_CommitmentTransactionDecodeErrorZPtr {
760 result: Box::into_raw(Box::new(o)),
766 pub extern "C" fn CResult_CommitmentTransactionDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CommitmentTransactionDecodeErrorZ {
767 CResult_CommitmentTransactionDecodeErrorZ {
768 contents: CResult_CommitmentTransactionDecodeErrorZPtr {
769 err: Box::into_raw(Box::new(e)),
775 pub extern "C" fn CResult_CommitmentTransactionDecodeErrorZ_free(_res: CResult_CommitmentTransactionDecodeErrorZ) { }
776 impl Drop for CResult_CommitmentTransactionDecodeErrorZ {
779 if unsafe { !(self.contents.result as *mut ()).is_null() } {
780 let _ = unsafe { Box::from_raw(self.contents.result) };
783 if unsafe { !(self.contents.err as *mut ()).is_null() } {
784 let _ = unsafe { Box::from_raw(self.contents.err) };
789 impl From<crate::c_types::CResultTempl<crate::ln::chan_utils::CommitmentTransaction, crate::ln::msgs::DecodeError>> for CResult_CommitmentTransactionDecodeErrorZ {
790 fn from(mut o: crate::c_types::CResultTempl<crate::ln::chan_utils::CommitmentTransaction, crate::ln::msgs::DecodeError>) -> Self {
791 let contents = if o.result_ok {
792 let result = unsafe { o.contents.result };
793 unsafe { o.contents.result = std::ptr::null_mut() };
794 CResult_CommitmentTransactionDecodeErrorZPtr { result }
796 let err = unsafe { o.contents.err };
797 unsafe { o.contents.err = std::ptr::null_mut(); }
798 CResult_CommitmentTransactionDecodeErrorZPtr { err }
802 result_ok: o.result_ok,
806 impl Clone for CResult_CommitmentTransactionDecodeErrorZ {
807 fn clone(&self) -> Self {
809 Self { result_ok: true, contents: CResult_CommitmentTransactionDecodeErrorZPtr {
810 result: Box::into_raw(Box::new(<crate::ln::chan_utils::CommitmentTransaction>::clone(unsafe { &*self.contents.result })))
813 Self { result_ok: false, contents: CResult_CommitmentTransactionDecodeErrorZPtr {
814 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
820 pub extern "C" fn CResult_CommitmentTransactionDecodeErrorZ_clone(orig: &CResult_CommitmentTransactionDecodeErrorZ) -> CResult_CommitmentTransactionDecodeErrorZ { orig.clone() }
822 pub union CResult_TrustedCommitmentTransactionNoneZPtr {
823 pub result: *mut crate::ln::chan_utils::TrustedCommitmentTransaction,
824 /// Note that this value is always NULL, as there are no contents in the Err variant
825 pub err: *mut std::ffi::c_void,
828 pub struct CResult_TrustedCommitmentTransactionNoneZ {
829 pub contents: CResult_TrustedCommitmentTransactionNoneZPtr,
833 pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_ok(o: crate::ln::chan_utils::TrustedCommitmentTransaction) -> CResult_TrustedCommitmentTransactionNoneZ {
834 CResult_TrustedCommitmentTransactionNoneZ {
835 contents: CResult_TrustedCommitmentTransactionNoneZPtr {
836 result: Box::into_raw(Box::new(o)),
842 pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_err() -> CResult_TrustedCommitmentTransactionNoneZ {
843 CResult_TrustedCommitmentTransactionNoneZ {
844 contents: CResult_TrustedCommitmentTransactionNoneZPtr {
845 err: std::ptr::null_mut(),
851 pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_free(_res: CResult_TrustedCommitmentTransactionNoneZ) { }
852 impl Drop for CResult_TrustedCommitmentTransactionNoneZ {
855 if unsafe { !(self.contents.result as *mut ()).is_null() } {
856 let _ = unsafe { Box::from_raw(self.contents.result) };
862 impl From<crate::c_types::CResultTempl<crate::ln::chan_utils::TrustedCommitmentTransaction, u8>> for CResult_TrustedCommitmentTransactionNoneZ {
863 fn from(mut o: crate::c_types::CResultTempl<crate::ln::chan_utils::TrustedCommitmentTransaction, u8>) -> Self {
864 let contents = if o.result_ok {
865 let result = unsafe { o.contents.result };
866 unsafe { o.contents.result = std::ptr::null_mut() };
867 CResult_TrustedCommitmentTransactionNoneZPtr { result }
869 let _ = unsafe { Box::from_raw(o.contents.err) };
870 o.contents.err = std::ptr::null_mut();
871 CResult_TrustedCommitmentTransactionNoneZPtr { err: std::ptr::null_mut() }
875 result_ok: o.result_ok,
880 pub union CResult_CVec_SignatureZNoneZPtr {
881 pub result: *mut crate::c_types::derived::CVec_SignatureZ,
882 /// Note that this value is always NULL, as there are no contents in the Err variant
883 pub err: *mut std::ffi::c_void,
886 pub struct CResult_CVec_SignatureZNoneZ {
887 pub contents: CResult_CVec_SignatureZNoneZPtr,
891 pub extern "C" fn CResult_CVec_SignatureZNoneZ_ok(o: crate::c_types::derived::CVec_SignatureZ) -> CResult_CVec_SignatureZNoneZ {
892 CResult_CVec_SignatureZNoneZ {
893 contents: CResult_CVec_SignatureZNoneZPtr {
894 result: Box::into_raw(Box::new(o)),
900 pub extern "C" fn CResult_CVec_SignatureZNoneZ_err() -> CResult_CVec_SignatureZNoneZ {
901 CResult_CVec_SignatureZNoneZ {
902 contents: CResult_CVec_SignatureZNoneZPtr {
903 err: std::ptr::null_mut(),
909 pub extern "C" fn CResult_CVec_SignatureZNoneZ_free(_res: CResult_CVec_SignatureZNoneZ) { }
910 impl Drop for CResult_CVec_SignatureZNoneZ {
913 if unsafe { !(self.contents.result as *mut ()).is_null() } {
914 let _ = unsafe { Box::from_raw(self.contents.result) };
920 impl From<crate::c_types::CResultTempl<crate::c_types::derived::CVec_SignatureZ, u8>> for CResult_CVec_SignatureZNoneZ {
921 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CVec_SignatureZ, u8>) -> Self {
922 let contents = if o.result_ok {
923 let result = unsafe { o.contents.result };
924 unsafe { o.contents.result = std::ptr::null_mut() };
925 CResult_CVec_SignatureZNoneZPtr { result }
927 let _ = unsafe { Box::from_raw(o.contents.err) };
928 o.contents.err = std::ptr::null_mut();
929 CResult_CVec_SignatureZNoneZPtr { err: std::ptr::null_mut() }
933 result_ok: o.result_ok,
937 impl Clone for CResult_CVec_SignatureZNoneZ {
938 fn clone(&self) -> Self {
940 Self { result_ok: true, contents: CResult_CVec_SignatureZNoneZPtr {
941 result: Box::into_raw(Box::new(<crate::c_types::derived::CVec_SignatureZ>::clone(unsafe { &*self.contents.result })))
944 Self { result_ok: false, contents: CResult_CVec_SignatureZNoneZPtr {
945 err: std::ptr::null_mut()
951 pub extern "C" fn CResult_CVec_SignatureZNoneZ_clone(orig: &CResult_CVec_SignatureZNoneZ) -> CResult_CVec_SignatureZNoneZ { orig.clone() }
953 pub struct CVec_MessageSendEventZ {
954 pub data: *mut crate::util::events::MessageSendEvent,
957 impl CVec_MessageSendEventZ {
958 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::util::events::MessageSendEvent> {
959 if self.datalen == 0 { return Vec::new(); }
960 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
961 self.data = std::ptr::null_mut();
965 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::util::events::MessageSendEvent] {
966 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
969 impl From<Vec<crate::util::events::MessageSendEvent>> for CVec_MessageSendEventZ {
970 fn from(v: Vec<crate::util::events::MessageSendEvent>) -> Self {
971 let datalen = v.len();
972 let data = Box::into_raw(v.into_boxed_slice());
973 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
977 pub extern "C" fn CVec_MessageSendEventZ_free(_res: CVec_MessageSendEventZ) { }
978 impl Drop for CVec_MessageSendEventZ {
980 if self.datalen == 0 { return; }
981 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
984 impl Clone for CVec_MessageSendEventZ {
985 fn clone(&self) -> Self {
986 let mut res = Vec::new();
987 if self.datalen == 0 { return Self::from(res); }
988 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
993 pub union CResult_boolLightningErrorZPtr {
994 pub result: *mut bool,
995 pub err: *mut crate::ln::msgs::LightningError,
998 pub struct CResult_boolLightningErrorZ {
999 pub contents: CResult_boolLightningErrorZPtr,
1000 pub result_ok: bool,
1003 pub extern "C" fn CResult_boolLightningErrorZ_ok(o: bool) -> CResult_boolLightningErrorZ {
1004 CResult_boolLightningErrorZ {
1005 contents: CResult_boolLightningErrorZPtr {
1006 result: Box::into_raw(Box::new(o)),
1012 pub extern "C" fn CResult_boolLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_boolLightningErrorZ {
1013 CResult_boolLightningErrorZ {
1014 contents: CResult_boolLightningErrorZPtr {
1015 err: Box::into_raw(Box::new(e)),
1021 pub extern "C" fn CResult_boolLightningErrorZ_free(_res: CResult_boolLightningErrorZ) { }
1022 impl Drop for CResult_boolLightningErrorZ {
1023 fn drop(&mut self) {
1025 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1026 let _ = unsafe { Box::from_raw(self.contents.result) };
1029 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1030 let _ = unsafe { Box::from_raw(self.contents.err) };
1035 impl From<crate::c_types::CResultTempl<bool, crate::ln::msgs::LightningError>> for CResult_boolLightningErrorZ {
1036 fn from(mut o: crate::c_types::CResultTempl<bool, crate::ln::msgs::LightningError>) -> Self {
1037 let contents = if o.result_ok {
1038 let result = unsafe { o.contents.result };
1039 unsafe { o.contents.result = std::ptr::null_mut() };
1040 CResult_boolLightningErrorZPtr { result }
1042 let err = unsafe { o.contents.err };
1043 unsafe { o.contents.err = std::ptr::null_mut(); }
1044 CResult_boolLightningErrorZPtr { err }
1048 result_ok: o.result_ok,
1052 impl Clone for CResult_boolLightningErrorZ {
1053 fn clone(&self) -> Self {
1055 Self { result_ok: true, contents: CResult_boolLightningErrorZPtr {
1056 result: Box::into_raw(Box::new(<bool>::clone(unsafe { &*self.contents.result })))
1059 Self { result_ok: false, contents: CResult_boolLightningErrorZPtr {
1060 err: Box::into_raw(Box::new(<crate::ln::msgs::LightningError>::clone(unsafe { &*self.contents.err })))
1066 pub extern "C" fn CResult_boolLightningErrorZ_clone(orig: &CResult_boolLightningErrorZ) -> CResult_boolLightningErrorZ { orig.clone() }
1068 pub struct C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1069 pub a: crate::ln::msgs::ChannelAnnouncement,
1070 pub b: crate::ln::msgs::ChannelUpdate,
1071 pub c: crate::ln::msgs::ChannelUpdate,
1073 impl From<(crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate)> for C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1074 fn from (tup: (crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate)) -> Self {
1082 impl C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1083 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate) {
1084 (self.a, self.b, self.c)
1087 impl Clone for C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1088 fn clone(&self) -> Self {
1097 pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig: &C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { orig.clone() }
1099 pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a: crate::ln::msgs::ChannelAnnouncement, b: crate::ln::msgs::ChannelUpdate, c: crate::ln::msgs::ChannelUpdate) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1100 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { a, b, c, }
1104 pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) { }
1106 pub struct CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1107 pub data: *mut crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ,
1110 impl CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1111 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ> {
1112 if self.datalen == 0 { return Vec::new(); }
1113 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
1114 self.data = std::ptr::null_mut();
1118 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ] {
1119 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
1122 impl From<Vec<crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ>> for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1123 fn from(v: Vec<crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ>) -> Self {
1124 let datalen = v.len();
1125 let data = Box::into_raw(v.into_boxed_slice());
1126 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
1130 pub extern "C" fn CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res: CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ) { }
1131 impl Drop for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1132 fn drop(&mut self) {
1133 if self.datalen == 0 { return; }
1134 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
1137 impl Clone for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1138 fn clone(&self) -> Self {
1139 let mut res = Vec::new();
1140 if self.datalen == 0 { return Self::from(res); }
1141 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
1146 pub struct CVec_NodeAnnouncementZ {
1147 pub data: *mut crate::ln::msgs::NodeAnnouncement,
1150 impl CVec_NodeAnnouncementZ {
1151 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::NodeAnnouncement> {
1152 if self.datalen == 0 { return Vec::new(); }
1153 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
1154 self.data = std::ptr::null_mut();
1158 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::NodeAnnouncement] {
1159 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
1162 impl From<Vec<crate::ln::msgs::NodeAnnouncement>> for CVec_NodeAnnouncementZ {
1163 fn from(v: Vec<crate::ln::msgs::NodeAnnouncement>) -> Self {
1164 let datalen = v.len();
1165 let data = Box::into_raw(v.into_boxed_slice());
1166 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
1170 pub extern "C" fn CVec_NodeAnnouncementZ_free(_res: CVec_NodeAnnouncementZ) { }
1171 impl Drop for CVec_NodeAnnouncementZ {
1172 fn drop(&mut self) {
1173 if self.datalen == 0 { return; }
1174 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
1177 impl Clone for CVec_NodeAnnouncementZ {
1178 fn clone(&self) -> Self {
1179 let mut res = Vec::new();
1180 if self.datalen == 0 { return Self::from(res); }
1181 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
1186 pub union CResult_NoneLightningErrorZPtr {
1187 /// Note that this value is always NULL, as there are no contents in the OK variant
1188 pub result: *mut std::ffi::c_void,
1189 pub err: *mut crate::ln::msgs::LightningError,
1192 pub struct CResult_NoneLightningErrorZ {
1193 pub contents: CResult_NoneLightningErrorZPtr,
1194 pub result_ok: bool,
1197 pub extern "C" fn CResult_NoneLightningErrorZ_ok() -> CResult_NoneLightningErrorZ {
1198 CResult_NoneLightningErrorZ {
1199 contents: CResult_NoneLightningErrorZPtr {
1200 result: std::ptr::null_mut(),
1206 pub extern "C" fn CResult_NoneLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_NoneLightningErrorZ {
1207 CResult_NoneLightningErrorZ {
1208 contents: CResult_NoneLightningErrorZPtr {
1209 err: Box::into_raw(Box::new(e)),
1215 pub extern "C" fn CResult_NoneLightningErrorZ_free(_res: CResult_NoneLightningErrorZ) { }
1216 impl Drop for CResult_NoneLightningErrorZ {
1217 fn drop(&mut self) {
1220 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1221 let _ = unsafe { Box::from_raw(self.contents.err) };
1226 impl From<crate::c_types::CResultTempl<u8, crate::ln::msgs::LightningError>> for CResult_NoneLightningErrorZ {
1227 fn from(mut o: crate::c_types::CResultTempl<u8, crate::ln::msgs::LightningError>) -> Self {
1228 let contents = if o.result_ok {
1229 let _ = unsafe { Box::from_raw(o.contents.result) };
1230 o.contents.result = std::ptr::null_mut();
1231 CResult_NoneLightningErrorZPtr { result: std::ptr::null_mut() }
1233 let err = unsafe { o.contents.err };
1234 unsafe { o.contents.err = std::ptr::null_mut(); }
1235 CResult_NoneLightningErrorZPtr { err }
1239 result_ok: o.result_ok,
1243 impl Clone for CResult_NoneLightningErrorZ {
1244 fn clone(&self) -> Self {
1246 Self { result_ok: true, contents: CResult_NoneLightningErrorZPtr {
1247 result: std::ptr::null_mut()
1250 Self { result_ok: false, contents: CResult_NoneLightningErrorZPtr {
1251 err: Box::into_raw(Box::new(<crate::ln::msgs::LightningError>::clone(unsafe { &*self.contents.err })))
1257 pub extern "C" fn CResult_NoneLightningErrorZ_clone(orig: &CResult_NoneLightningErrorZ) -> CResult_NoneLightningErrorZ { orig.clone() }
1259 pub struct CVec_PublicKeyZ {
1260 pub data: *mut crate::c_types::PublicKey,
1263 impl CVec_PublicKeyZ {
1264 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::PublicKey> {
1265 if self.datalen == 0 { return Vec::new(); }
1266 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
1267 self.data = std::ptr::null_mut();
1271 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::PublicKey] {
1272 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
1275 impl From<Vec<crate::c_types::PublicKey>> for CVec_PublicKeyZ {
1276 fn from(v: Vec<crate::c_types::PublicKey>) -> Self {
1277 let datalen = v.len();
1278 let data = Box::into_raw(v.into_boxed_slice());
1279 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
1283 pub extern "C" fn CVec_PublicKeyZ_free(_res: CVec_PublicKeyZ) { }
1284 impl Drop for CVec_PublicKeyZ {
1285 fn drop(&mut self) {
1286 if self.datalen == 0 { return; }
1287 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
1291 pub struct CVec_u8Z {
1296 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<u8> {
1297 if self.datalen == 0 { return Vec::new(); }
1298 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
1299 self.data = std::ptr::null_mut();
1303 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[u8] {
1304 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
1307 impl From<Vec<u8>> for CVec_u8Z {
1308 fn from(v: Vec<u8>) -> Self {
1309 let datalen = v.len();
1310 let data = Box::into_raw(v.into_boxed_slice());
1311 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
1315 pub extern "C" fn CVec_u8Z_free(_res: CVec_u8Z) { }
1316 impl Drop for CVec_u8Z {
1317 fn drop(&mut self) {
1318 if self.datalen == 0 { return; }
1319 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
1322 impl Clone for CVec_u8Z {
1323 fn clone(&self) -> Self {
1324 let mut res = Vec::new();
1325 if self.datalen == 0 { return Self::from(res); }
1326 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
1331 pub union CResult_CVec_u8ZPeerHandleErrorZPtr {
1332 pub result: *mut crate::c_types::derived::CVec_u8Z,
1333 pub err: *mut crate::ln::peer_handler::PeerHandleError,
1336 pub struct CResult_CVec_u8ZPeerHandleErrorZ {
1337 pub contents: CResult_CVec_u8ZPeerHandleErrorZPtr,
1338 pub result_ok: bool,
1341 pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_ok(o: crate::c_types::derived::CVec_u8Z) -> CResult_CVec_u8ZPeerHandleErrorZ {
1342 CResult_CVec_u8ZPeerHandleErrorZ {
1343 contents: CResult_CVec_u8ZPeerHandleErrorZPtr {
1344 result: Box::into_raw(Box::new(o)),
1350 pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_CVec_u8ZPeerHandleErrorZ {
1351 CResult_CVec_u8ZPeerHandleErrorZ {
1352 contents: CResult_CVec_u8ZPeerHandleErrorZPtr {
1353 err: Box::into_raw(Box::new(e)),
1359 pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_free(_res: CResult_CVec_u8ZPeerHandleErrorZ) { }
1360 impl Drop for CResult_CVec_u8ZPeerHandleErrorZ {
1361 fn drop(&mut self) {
1363 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1364 let _ = unsafe { Box::from_raw(self.contents.result) };
1367 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1368 let _ = unsafe { Box::from_raw(self.contents.err) };
1373 impl From<crate::c_types::CResultTempl<crate::c_types::derived::CVec_u8Z, crate::ln::peer_handler::PeerHandleError>> for CResult_CVec_u8ZPeerHandleErrorZ {
1374 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CVec_u8Z, crate::ln::peer_handler::PeerHandleError>) -> Self {
1375 let contents = if o.result_ok {
1376 let result = unsafe { o.contents.result };
1377 unsafe { o.contents.result = std::ptr::null_mut() };
1378 CResult_CVec_u8ZPeerHandleErrorZPtr { result }
1380 let err = unsafe { o.contents.err };
1381 unsafe { o.contents.err = std::ptr::null_mut(); }
1382 CResult_CVec_u8ZPeerHandleErrorZPtr { err }
1386 result_ok: o.result_ok,
1390 impl Clone for CResult_CVec_u8ZPeerHandleErrorZ {
1391 fn clone(&self) -> Self {
1393 Self { result_ok: true, contents: CResult_CVec_u8ZPeerHandleErrorZPtr {
1394 result: Box::into_raw(Box::new(<crate::c_types::derived::CVec_u8Z>::clone(unsafe { &*self.contents.result })))
1397 Self { result_ok: false, contents: CResult_CVec_u8ZPeerHandleErrorZPtr {
1398 err: Box::into_raw(Box::new(<crate::ln::peer_handler::PeerHandleError>::clone(unsafe { &*self.contents.err })))
1404 pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_clone(orig: &CResult_CVec_u8ZPeerHandleErrorZ) -> CResult_CVec_u8ZPeerHandleErrorZ { orig.clone() }
1406 pub union CResult_NonePeerHandleErrorZPtr {
1407 /// Note that this value is always NULL, as there are no contents in the OK variant
1408 pub result: *mut std::ffi::c_void,
1409 pub err: *mut crate::ln::peer_handler::PeerHandleError,
1412 pub struct CResult_NonePeerHandleErrorZ {
1413 pub contents: CResult_NonePeerHandleErrorZPtr,
1414 pub result_ok: bool,
1417 pub extern "C" fn CResult_NonePeerHandleErrorZ_ok() -> CResult_NonePeerHandleErrorZ {
1418 CResult_NonePeerHandleErrorZ {
1419 contents: CResult_NonePeerHandleErrorZPtr {
1420 result: std::ptr::null_mut(),
1426 pub extern "C" fn CResult_NonePeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_NonePeerHandleErrorZ {
1427 CResult_NonePeerHandleErrorZ {
1428 contents: CResult_NonePeerHandleErrorZPtr {
1429 err: Box::into_raw(Box::new(e)),
1435 pub extern "C" fn CResult_NonePeerHandleErrorZ_free(_res: CResult_NonePeerHandleErrorZ) { }
1436 impl Drop for CResult_NonePeerHandleErrorZ {
1437 fn drop(&mut self) {
1440 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1441 let _ = unsafe { Box::from_raw(self.contents.err) };
1446 impl From<crate::c_types::CResultTempl<u8, crate::ln::peer_handler::PeerHandleError>> for CResult_NonePeerHandleErrorZ {
1447 fn from(mut o: crate::c_types::CResultTempl<u8, crate::ln::peer_handler::PeerHandleError>) -> Self {
1448 let contents = if o.result_ok {
1449 let _ = unsafe { Box::from_raw(o.contents.result) };
1450 o.contents.result = std::ptr::null_mut();
1451 CResult_NonePeerHandleErrorZPtr { result: std::ptr::null_mut() }
1453 let err = unsafe { o.contents.err };
1454 unsafe { o.contents.err = std::ptr::null_mut(); }
1455 CResult_NonePeerHandleErrorZPtr { err }
1459 result_ok: o.result_ok,
1463 impl Clone for CResult_NonePeerHandleErrorZ {
1464 fn clone(&self) -> Self {
1466 Self { result_ok: true, contents: CResult_NonePeerHandleErrorZPtr {
1467 result: std::ptr::null_mut()
1470 Self { result_ok: false, contents: CResult_NonePeerHandleErrorZPtr {
1471 err: Box::into_raw(Box::new(<crate::ln::peer_handler::PeerHandleError>::clone(unsafe { &*self.contents.err })))
1477 pub extern "C" fn CResult_NonePeerHandleErrorZ_clone(orig: &CResult_NonePeerHandleErrorZ) -> CResult_NonePeerHandleErrorZ { orig.clone() }
1479 pub union CResult_boolPeerHandleErrorZPtr {
1480 pub result: *mut bool,
1481 pub err: *mut crate::ln::peer_handler::PeerHandleError,
1484 pub struct CResult_boolPeerHandleErrorZ {
1485 pub contents: CResult_boolPeerHandleErrorZPtr,
1486 pub result_ok: bool,
1489 pub extern "C" fn CResult_boolPeerHandleErrorZ_ok(o: bool) -> CResult_boolPeerHandleErrorZ {
1490 CResult_boolPeerHandleErrorZ {
1491 contents: CResult_boolPeerHandleErrorZPtr {
1492 result: Box::into_raw(Box::new(o)),
1498 pub extern "C" fn CResult_boolPeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_boolPeerHandleErrorZ {
1499 CResult_boolPeerHandleErrorZ {
1500 contents: CResult_boolPeerHandleErrorZPtr {
1501 err: Box::into_raw(Box::new(e)),
1507 pub extern "C" fn CResult_boolPeerHandleErrorZ_free(_res: CResult_boolPeerHandleErrorZ) { }
1508 impl Drop for CResult_boolPeerHandleErrorZ {
1509 fn drop(&mut self) {
1511 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1512 let _ = unsafe { Box::from_raw(self.contents.result) };
1515 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1516 let _ = unsafe { Box::from_raw(self.contents.err) };
1521 impl From<crate::c_types::CResultTempl<bool, crate::ln::peer_handler::PeerHandleError>> for CResult_boolPeerHandleErrorZ {
1522 fn from(mut o: crate::c_types::CResultTempl<bool, crate::ln::peer_handler::PeerHandleError>) -> Self {
1523 let contents = if o.result_ok {
1524 let result = unsafe { o.contents.result };
1525 unsafe { o.contents.result = std::ptr::null_mut() };
1526 CResult_boolPeerHandleErrorZPtr { result }
1528 let err = unsafe { o.contents.err };
1529 unsafe { o.contents.err = std::ptr::null_mut(); }
1530 CResult_boolPeerHandleErrorZPtr { err }
1534 result_ok: o.result_ok,
1538 impl Clone for CResult_boolPeerHandleErrorZ {
1539 fn clone(&self) -> Self {
1541 Self { result_ok: true, contents: CResult_boolPeerHandleErrorZPtr {
1542 result: Box::into_raw(Box::new(<bool>::clone(unsafe { &*self.contents.result })))
1545 Self { result_ok: false, contents: CResult_boolPeerHandleErrorZPtr {
1546 err: Box::into_raw(Box::new(<crate::ln::peer_handler::PeerHandleError>::clone(unsafe { &*self.contents.err })))
1552 pub extern "C" fn CResult_boolPeerHandleErrorZ_clone(orig: &CResult_boolPeerHandleErrorZ) -> CResult_boolPeerHandleErrorZ { orig.clone() }
1554 pub union CResult_InitFeaturesDecodeErrorZPtr {
1555 pub result: *mut crate::ln::features::InitFeatures,
1556 pub err: *mut crate::ln::msgs::DecodeError,
1559 pub struct CResult_InitFeaturesDecodeErrorZ {
1560 pub contents: CResult_InitFeaturesDecodeErrorZPtr,
1561 pub result_ok: bool,
1564 pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_ok(o: crate::ln::features::InitFeatures) -> CResult_InitFeaturesDecodeErrorZ {
1565 CResult_InitFeaturesDecodeErrorZ {
1566 contents: CResult_InitFeaturesDecodeErrorZPtr {
1567 result: Box::into_raw(Box::new(o)),
1573 pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InitFeaturesDecodeErrorZ {
1574 CResult_InitFeaturesDecodeErrorZ {
1575 contents: CResult_InitFeaturesDecodeErrorZPtr {
1576 err: Box::into_raw(Box::new(e)),
1582 pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_free(_res: CResult_InitFeaturesDecodeErrorZ) { }
1583 impl Drop for CResult_InitFeaturesDecodeErrorZ {
1584 fn drop(&mut self) {
1586 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1587 let _ = unsafe { Box::from_raw(self.contents.result) };
1590 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1591 let _ = unsafe { Box::from_raw(self.contents.err) };
1596 impl From<crate::c_types::CResultTempl<crate::ln::features::InitFeatures, crate::ln::msgs::DecodeError>> for CResult_InitFeaturesDecodeErrorZ {
1597 fn from(mut o: crate::c_types::CResultTempl<crate::ln::features::InitFeatures, crate::ln::msgs::DecodeError>) -> Self {
1598 let contents = if o.result_ok {
1599 let result = unsafe { o.contents.result };
1600 unsafe { o.contents.result = std::ptr::null_mut() };
1601 CResult_InitFeaturesDecodeErrorZPtr { result }
1603 let err = unsafe { o.contents.err };
1604 unsafe { o.contents.err = std::ptr::null_mut(); }
1605 CResult_InitFeaturesDecodeErrorZPtr { err }
1609 result_ok: o.result_ok,
1614 pub union CResult_NodeFeaturesDecodeErrorZPtr {
1615 pub result: *mut crate::ln::features::NodeFeatures,
1616 pub err: *mut crate::ln::msgs::DecodeError,
1619 pub struct CResult_NodeFeaturesDecodeErrorZ {
1620 pub contents: CResult_NodeFeaturesDecodeErrorZPtr,
1621 pub result_ok: bool,
1624 pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_ok(o: crate::ln::features::NodeFeatures) -> CResult_NodeFeaturesDecodeErrorZ {
1625 CResult_NodeFeaturesDecodeErrorZ {
1626 contents: CResult_NodeFeaturesDecodeErrorZPtr {
1627 result: Box::into_raw(Box::new(o)),
1633 pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeFeaturesDecodeErrorZ {
1634 CResult_NodeFeaturesDecodeErrorZ {
1635 contents: CResult_NodeFeaturesDecodeErrorZPtr {
1636 err: Box::into_raw(Box::new(e)),
1642 pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_free(_res: CResult_NodeFeaturesDecodeErrorZ) { }
1643 impl Drop for CResult_NodeFeaturesDecodeErrorZ {
1644 fn drop(&mut self) {
1646 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1647 let _ = unsafe { Box::from_raw(self.contents.result) };
1650 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1651 let _ = unsafe { Box::from_raw(self.contents.err) };
1656 impl From<crate::c_types::CResultTempl<crate::ln::features::NodeFeatures, crate::ln::msgs::DecodeError>> for CResult_NodeFeaturesDecodeErrorZ {
1657 fn from(mut o: crate::c_types::CResultTempl<crate::ln::features::NodeFeatures, crate::ln::msgs::DecodeError>) -> Self {
1658 let contents = if o.result_ok {
1659 let result = unsafe { o.contents.result };
1660 unsafe { o.contents.result = std::ptr::null_mut() };
1661 CResult_NodeFeaturesDecodeErrorZPtr { result }
1663 let err = unsafe { o.contents.err };
1664 unsafe { o.contents.err = std::ptr::null_mut(); }
1665 CResult_NodeFeaturesDecodeErrorZPtr { err }
1669 result_ok: o.result_ok,
1674 pub union CResult_ChannelFeaturesDecodeErrorZPtr {
1675 pub result: *mut crate::ln::features::ChannelFeatures,
1676 pub err: *mut crate::ln::msgs::DecodeError,
1679 pub struct CResult_ChannelFeaturesDecodeErrorZ {
1680 pub contents: CResult_ChannelFeaturesDecodeErrorZPtr,
1681 pub result_ok: bool,
1684 pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_ok(o: crate::ln::features::ChannelFeatures) -> CResult_ChannelFeaturesDecodeErrorZ {
1685 CResult_ChannelFeaturesDecodeErrorZ {
1686 contents: CResult_ChannelFeaturesDecodeErrorZPtr {
1687 result: Box::into_raw(Box::new(o)),
1693 pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelFeaturesDecodeErrorZ {
1694 CResult_ChannelFeaturesDecodeErrorZ {
1695 contents: CResult_ChannelFeaturesDecodeErrorZPtr {
1696 err: Box::into_raw(Box::new(e)),
1702 pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_free(_res: CResult_ChannelFeaturesDecodeErrorZ) { }
1703 impl Drop for CResult_ChannelFeaturesDecodeErrorZ {
1704 fn drop(&mut self) {
1706 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1707 let _ = unsafe { Box::from_raw(self.contents.result) };
1710 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1711 let _ = unsafe { Box::from_raw(self.contents.err) };
1716 impl From<crate::c_types::CResultTempl<crate::ln::features::ChannelFeatures, crate::ln::msgs::DecodeError>> for CResult_ChannelFeaturesDecodeErrorZ {
1717 fn from(mut o: crate::c_types::CResultTempl<crate::ln::features::ChannelFeatures, crate::ln::msgs::DecodeError>) -> Self {
1718 let contents = if o.result_ok {
1719 let result = unsafe { o.contents.result };
1720 unsafe { o.contents.result = std::ptr::null_mut() };
1721 CResult_ChannelFeaturesDecodeErrorZPtr { result }
1723 let err = unsafe { o.contents.err };
1724 unsafe { o.contents.err = std::ptr::null_mut(); }
1725 CResult_ChannelFeaturesDecodeErrorZPtr { err }
1729 result_ok: o.result_ok,
1734 pub union CResult_ChannelConfigDecodeErrorZPtr {
1735 pub result: *mut crate::util::config::ChannelConfig,
1736 pub err: *mut crate::ln::msgs::DecodeError,
1739 pub struct CResult_ChannelConfigDecodeErrorZ {
1740 pub contents: CResult_ChannelConfigDecodeErrorZPtr,
1741 pub result_ok: bool,
1744 pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_ok(o: crate::util::config::ChannelConfig) -> CResult_ChannelConfigDecodeErrorZ {
1745 CResult_ChannelConfigDecodeErrorZ {
1746 contents: CResult_ChannelConfigDecodeErrorZPtr {
1747 result: Box::into_raw(Box::new(o)),
1753 pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelConfigDecodeErrorZ {
1754 CResult_ChannelConfigDecodeErrorZ {
1755 contents: CResult_ChannelConfigDecodeErrorZPtr {
1756 err: Box::into_raw(Box::new(e)),
1762 pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_free(_res: CResult_ChannelConfigDecodeErrorZ) { }
1763 impl Drop for CResult_ChannelConfigDecodeErrorZ {
1764 fn drop(&mut self) {
1766 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1767 let _ = unsafe { Box::from_raw(self.contents.result) };
1770 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1771 let _ = unsafe { Box::from_raw(self.contents.err) };
1776 impl From<crate::c_types::CResultTempl<crate::util::config::ChannelConfig, crate::ln::msgs::DecodeError>> for CResult_ChannelConfigDecodeErrorZ {
1777 fn from(mut o: crate::c_types::CResultTempl<crate::util::config::ChannelConfig, crate::ln::msgs::DecodeError>) -> Self {
1778 let contents = if o.result_ok {
1779 let result = unsafe { o.contents.result };
1780 unsafe { o.contents.result = std::ptr::null_mut() };
1781 CResult_ChannelConfigDecodeErrorZPtr { result }
1783 let err = unsafe { o.contents.err };
1784 unsafe { o.contents.err = std::ptr::null_mut(); }
1785 CResult_ChannelConfigDecodeErrorZPtr { err }
1789 result_ok: o.result_ok,
1793 impl Clone for CResult_ChannelConfigDecodeErrorZ {
1794 fn clone(&self) -> Self {
1796 Self { result_ok: true, contents: CResult_ChannelConfigDecodeErrorZPtr {
1797 result: Box::into_raw(Box::new(<crate::util::config::ChannelConfig>::clone(unsafe { &*self.contents.result })))
1800 Self { result_ok: false, contents: CResult_ChannelConfigDecodeErrorZPtr {
1801 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
1807 pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_clone(orig: &CResult_ChannelConfigDecodeErrorZ) -> CResult_ChannelConfigDecodeErrorZ { orig.clone() }
1809 pub union CResult_DirectionalChannelInfoDecodeErrorZPtr {
1810 pub result: *mut crate::routing::network_graph::DirectionalChannelInfo,
1811 pub err: *mut crate::ln::msgs::DecodeError,
1814 pub struct CResult_DirectionalChannelInfoDecodeErrorZ {
1815 pub contents: CResult_DirectionalChannelInfoDecodeErrorZPtr,
1816 pub result_ok: bool,
1819 pub extern "C" fn CResult_DirectionalChannelInfoDecodeErrorZ_ok(o: crate::routing::network_graph::DirectionalChannelInfo) -> CResult_DirectionalChannelInfoDecodeErrorZ {
1820 CResult_DirectionalChannelInfoDecodeErrorZ {
1821 contents: CResult_DirectionalChannelInfoDecodeErrorZPtr {
1822 result: Box::into_raw(Box::new(o)),
1828 pub extern "C" fn CResult_DirectionalChannelInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_DirectionalChannelInfoDecodeErrorZ {
1829 CResult_DirectionalChannelInfoDecodeErrorZ {
1830 contents: CResult_DirectionalChannelInfoDecodeErrorZPtr {
1831 err: Box::into_raw(Box::new(e)),
1837 pub extern "C" fn CResult_DirectionalChannelInfoDecodeErrorZ_free(_res: CResult_DirectionalChannelInfoDecodeErrorZ) { }
1838 impl Drop for CResult_DirectionalChannelInfoDecodeErrorZ {
1839 fn drop(&mut self) {
1841 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1842 let _ = unsafe { Box::from_raw(self.contents.result) };
1845 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1846 let _ = unsafe { Box::from_raw(self.contents.err) };
1851 impl From<crate::c_types::CResultTempl<crate::routing::network_graph::DirectionalChannelInfo, crate::ln::msgs::DecodeError>> for CResult_DirectionalChannelInfoDecodeErrorZ {
1852 fn from(mut o: crate::c_types::CResultTempl<crate::routing::network_graph::DirectionalChannelInfo, crate::ln::msgs::DecodeError>) -> Self {
1853 let contents = if o.result_ok {
1854 let result = unsafe { o.contents.result };
1855 unsafe { o.contents.result = std::ptr::null_mut() };
1856 CResult_DirectionalChannelInfoDecodeErrorZPtr { result }
1858 let err = unsafe { o.contents.err };
1859 unsafe { o.contents.err = std::ptr::null_mut(); }
1860 CResult_DirectionalChannelInfoDecodeErrorZPtr { err }
1864 result_ok: o.result_ok,
1868 impl Clone for CResult_DirectionalChannelInfoDecodeErrorZ {
1869 fn clone(&self) -> Self {
1871 Self { result_ok: true, contents: CResult_DirectionalChannelInfoDecodeErrorZPtr {
1872 result: Box::into_raw(Box::new(<crate::routing::network_graph::DirectionalChannelInfo>::clone(unsafe { &*self.contents.result })))
1875 Self { result_ok: false, contents: CResult_DirectionalChannelInfoDecodeErrorZPtr {
1876 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
1882 pub extern "C" fn CResult_DirectionalChannelInfoDecodeErrorZ_clone(orig: &CResult_DirectionalChannelInfoDecodeErrorZ) -> CResult_DirectionalChannelInfoDecodeErrorZ { orig.clone() }
1884 pub union CResult_ChannelInfoDecodeErrorZPtr {
1885 pub result: *mut crate::routing::network_graph::ChannelInfo,
1886 pub err: *mut crate::ln::msgs::DecodeError,
1889 pub struct CResult_ChannelInfoDecodeErrorZ {
1890 pub contents: CResult_ChannelInfoDecodeErrorZPtr,
1891 pub result_ok: bool,
1894 pub extern "C" fn CResult_ChannelInfoDecodeErrorZ_ok(o: crate::routing::network_graph::ChannelInfo) -> CResult_ChannelInfoDecodeErrorZ {
1895 CResult_ChannelInfoDecodeErrorZ {
1896 contents: CResult_ChannelInfoDecodeErrorZPtr {
1897 result: Box::into_raw(Box::new(o)),
1903 pub extern "C" fn CResult_ChannelInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelInfoDecodeErrorZ {
1904 CResult_ChannelInfoDecodeErrorZ {
1905 contents: CResult_ChannelInfoDecodeErrorZPtr {
1906 err: Box::into_raw(Box::new(e)),
1912 pub extern "C" fn CResult_ChannelInfoDecodeErrorZ_free(_res: CResult_ChannelInfoDecodeErrorZ) { }
1913 impl Drop for CResult_ChannelInfoDecodeErrorZ {
1914 fn drop(&mut self) {
1916 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1917 let _ = unsafe { Box::from_raw(self.contents.result) };
1920 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1921 let _ = unsafe { Box::from_raw(self.contents.err) };
1926 impl From<crate::c_types::CResultTempl<crate::routing::network_graph::ChannelInfo, crate::ln::msgs::DecodeError>> for CResult_ChannelInfoDecodeErrorZ {
1927 fn from(mut o: crate::c_types::CResultTempl<crate::routing::network_graph::ChannelInfo, crate::ln::msgs::DecodeError>) -> Self {
1928 let contents = if o.result_ok {
1929 let result = unsafe { o.contents.result };
1930 unsafe { o.contents.result = std::ptr::null_mut() };
1931 CResult_ChannelInfoDecodeErrorZPtr { result }
1933 let err = unsafe { o.contents.err };
1934 unsafe { o.contents.err = std::ptr::null_mut(); }
1935 CResult_ChannelInfoDecodeErrorZPtr { err }
1939 result_ok: o.result_ok,
1943 impl Clone for CResult_ChannelInfoDecodeErrorZ {
1944 fn clone(&self) -> Self {
1946 Self { result_ok: true, contents: CResult_ChannelInfoDecodeErrorZPtr {
1947 result: Box::into_raw(Box::new(<crate::routing::network_graph::ChannelInfo>::clone(unsafe { &*self.contents.result })))
1950 Self { result_ok: false, contents: CResult_ChannelInfoDecodeErrorZPtr {
1951 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
1957 pub extern "C" fn CResult_ChannelInfoDecodeErrorZ_clone(orig: &CResult_ChannelInfoDecodeErrorZ) -> CResult_ChannelInfoDecodeErrorZ { orig.clone() }
1959 pub union CResult_RoutingFeesDecodeErrorZPtr {
1960 pub result: *mut crate::routing::network_graph::RoutingFees,
1961 pub err: *mut crate::ln::msgs::DecodeError,
1964 pub struct CResult_RoutingFeesDecodeErrorZ {
1965 pub contents: CResult_RoutingFeesDecodeErrorZPtr,
1966 pub result_ok: bool,
1969 pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_ok(o: crate::routing::network_graph::RoutingFees) -> CResult_RoutingFeesDecodeErrorZ {
1970 CResult_RoutingFeesDecodeErrorZ {
1971 contents: CResult_RoutingFeesDecodeErrorZPtr {
1972 result: Box::into_raw(Box::new(o)),
1978 pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RoutingFeesDecodeErrorZ {
1979 CResult_RoutingFeesDecodeErrorZ {
1980 contents: CResult_RoutingFeesDecodeErrorZPtr {
1981 err: Box::into_raw(Box::new(e)),
1987 pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_free(_res: CResult_RoutingFeesDecodeErrorZ) { }
1988 impl Drop for CResult_RoutingFeesDecodeErrorZ {
1989 fn drop(&mut self) {
1991 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1992 let _ = unsafe { Box::from_raw(self.contents.result) };
1995 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1996 let _ = unsafe { Box::from_raw(self.contents.err) };
2001 impl From<crate::c_types::CResultTempl<crate::routing::network_graph::RoutingFees, crate::ln::msgs::DecodeError>> for CResult_RoutingFeesDecodeErrorZ {
2002 fn from(mut o: crate::c_types::CResultTempl<crate::routing::network_graph::RoutingFees, crate::ln::msgs::DecodeError>) -> Self {
2003 let contents = if o.result_ok {
2004 let result = unsafe { o.contents.result };
2005 unsafe { o.contents.result = std::ptr::null_mut() };
2006 CResult_RoutingFeesDecodeErrorZPtr { result }
2008 let err = unsafe { o.contents.err };
2009 unsafe { o.contents.err = std::ptr::null_mut(); }
2010 CResult_RoutingFeesDecodeErrorZPtr { err }
2014 result_ok: o.result_ok,
2018 impl Clone for CResult_RoutingFeesDecodeErrorZ {
2019 fn clone(&self) -> Self {
2021 Self { result_ok: true, contents: CResult_RoutingFeesDecodeErrorZPtr {
2022 result: Box::into_raw(Box::new(<crate::routing::network_graph::RoutingFees>::clone(unsafe { &*self.contents.result })))
2025 Self { result_ok: false, contents: CResult_RoutingFeesDecodeErrorZPtr {
2026 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2032 pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_clone(orig: &CResult_RoutingFeesDecodeErrorZ) -> CResult_RoutingFeesDecodeErrorZ { orig.clone() }
2034 pub struct CVec_NetAddressZ {
2035 pub data: *mut crate::ln::msgs::NetAddress,
2038 impl CVec_NetAddressZ {
2039 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::NetAddress> {
2040 if self.datalen == 0 { return Vec::new(); }
2041 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2042 self.data = std::ptr::null_mut();
2046 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::NetAddress] {
2047 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2050 impl From<Vec<crate::ln::msgs::NetAddress>> for CVec_NetAddressZ {
2051 fn from(v: Vec<crate::ln::msgs::NetAddress>) -> Self {
2052 let datalen = v.len();
2053 let data = Box::into_raw(v.into_boxed_slice());
2054 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2058 pub extern "C" fn CVec_NetAddressZ_free(_res: CVec_NetAddressZ) { }
2059 impl Drop for CVec_NetAddressZ {
2060 fn drop(&mut self) {
2061 if self.datalen == 0 { return; }
2062 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2065 impl Clone for CVec_NetAddressZ {
2066 fn clone(&self) -> Self {
2067 let mut res = Vec::new();
2068 if self.datalen == 0 { return Self::from(res); }
2069 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
2074 pub union CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2075 pub result: *mut crate::routing::network_graph::NodeAnnouncementInfo,
2076 pub err: *mut crate::ln::msgs::DecodeError,
2079 pub struct CResult_NodeAnnouncementInfoDecodeErrorZ {
2080 pub contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr,
2081 pub result_ok: bool,
2084 pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o: crate::routing::network_graph::NodeAnnouncementInfo) -> CResult_NodeAnnouncementInfoDecodeErrorZ {
2085 CResult_NodeAnnouncementInfoDecodeErrorZ {
2086 contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2087 result: Box::into_raw(Box::new(o)),
2093 pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeAnnouncementInfoDecodeErrorZ {
2094 CResult_NodeAnnouncementInfoDecodeErrorZ {
2095 contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2096 err: Box::into_raw(Box::new(e)),
2102 pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res: CResult_NodeAnnouncementInfoDecodeErrorZ) { }
2103 impl Drop for CResult_NodeAnnouncementInfoDecodeErrorZ {
2104 fn drop(&mut self) {
2106 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2107 let _ = unsafe { Box::from_raw(self.contents.result) };
2110 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2111 let _ = unsafe { Box::from_raw(self.contents.err) };
2116 impl From<crate::c_types::CResultTempl<crate::routing::network_graph::NodeAnnouncementInfo, crate::ln::msgs::DecodeError>> for CResult_NodeAnnouncementInfoDecodeErrorZ {
2117 fn from(mut o: crate::c_types::CResultTempl<crate::routing::network_graph::NodeAnnouncementInfo, crate::ln::msgs::DecodeError>) -> Self {
2118 let contents = if o.result_ok {
2119 let result = unsafe { o.contents.result };
2120 unsafe { o.contents.result = std::ptr::null_mut() };
2121 CResult_NodeAnnouncementInfoDecodeErrorZPtr { result }
2123 let err = unsafe { o.contents.err };
2124 unsafe { o.contents.err = std::ptr::null_mut(); }
2125 CResult_NodeAnnouncementInfoDecodeErrorZPtr { err }
2129 result_ok: o.result_ok,
2133 impl Clone for CResult_NodeAnnouncementInfoDecodeErrorZ {
2134 fn clone(&self) -> Self {
2136 Self { result_ok: true, contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2137 result: Box::into_raw(Box::new(<crate::routing::network_graph::NodeAnnouncementInfo>::clone(unsafe { &*self.contents.result })))
2140 Self { result_ok: false, contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2141 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2147 pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig: &CResult_NodeAnnouncementInfoDecodeErrorZ) -> CResult_NodeAnnouncementInfoDecodeErrorZ { orig.clone() }
2149 pub struct CVec_u64Z {
2154 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<u64> {
2155 if self.datalen == 0 { return Vec::new(); }
2156 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2157 self.data = std::ptr::null_mut();
2161 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[u64] {
2162 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2165 impl From<Vec<u64>> for CVec_u64Z {
2166 fn from(v: Vec<u64>) -> Self {
2167 let datalen = v.len();
2168 let data = Box::into_raw(v.into_boxed_slice());
2169 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2173 pub extern "C" fn CVec_u64Z_free(_res: CVec_u64Z) { }
2174 impl Drop for CVec_u64Z {
2175 fn drop(&mut self) {
2176 if self.datalen == 0 { return; }
2177 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2180 impl Clone for CVec_u64Z {
2181 fn clone(&self) -> Self {
2182 let mut res = Vec::new();
2183 if self.datalen == 0 { return Self::from(res); }
2184 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
2189 pub union CResult_NodeInfoDecodeErrorZPtr {
2190 pub result: *mut crate::routing::network_graph::NodeInfo,
2191 pub err: *mut crate::ln::msgs::DecodeError,
2194 pub struct CResult_NodeInfoDecodeErrorZ {
2195 pub contents: CResult_NodeInfoDecodeErrorZPtr,
2196 pub result_ok: bool,
2199 pub extern "C" fn CResult_NodeInfoDecodeErrorZ_ok(o: crate::routing::network_graph::NodeInfo) -> CResult_NodeInfoDecodeErrorZ {
2200 CResult_NodeInfoDecodeErrorZ {
2201 contents: CResult_NodeInfoDecodeErrorZPtr {
2202 result: Box::into_raw(Box::new(o)),
2208 pub extern "C" fn CResult_NodeInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeInfoDecodeErrorZ {
2209 CResult_NodeInfoDecodeErrorZ {
2210 contents: CResult_NodeInfoDecodeErrorZPtr {
2211 err: Box::into_raw(Box::new(e)),
2217 pub extern "C" fn CResult_NodeInfoDecodeErrorZ_free(_res: CResult_NodeInfoDecodeErrorZ) { }
2218 impl Drop for CResult_NodeInfoDecodeErrorZ {
2219 fn drop(&mut self) {
2221 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2222 let _ = unsafe { Box::from_raw(self.contents.result) };
2225 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2226 let _ = unsafe { Box::from_raw(self.contents.err) };
2231 impl From<crate::c_types::CResultTempl<crate::routing::network_graph::NodeInfo, crate::ln::msgs::DecodeError>> for CResult_NodeInfoDecodeErrorZ {
2232 fn from(mut o: crate::c_types::CResultTempl<crate::routing::network_graph::NodeInfo, crate::ln::msgs::DecodeError>) -> Self {
2233 let contents = if o.result_ok {
2234 let result = unsafe { o.contents.result };
2235 unsafe { o.contents.result = std::ptr::null_mut() };
2236 CResult_NodeInfoDecodeErrorZPtr { result }
2238 let err = unsafe { o.contents.err };
2239 unsafe { o.contents.err = std::ptr::null_mut(); }
2240 CResult_NodeInfoDecodeErrorZPtr { err }
2244 result_ok: o.result_ok,
2248 impl Clone for CResult_NodeInfoDecodeErrorZ {
2249 fn clone(&self) -> Self {
2251 Self { result_ok: true, contents: CResult_NodeInfoDecodeErrorZPtr {
2252 result: Box::into_raw(Box::new(<crate::routing::network_graph::NodeInfo>::clone(unsafe { &*self.contents.result })))
2255 Self { result_ok: false, contents: CResult_NodeInfoDecodeErrorZPtr {
2256 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2262 pub extern "C" fn CResult_NodeInfoDecodeErrorZ_clone(orig: &CResult_NodeInfoDecodeErrorZ) -> CResult_NodeInfoDecodeErrorZ { orig.clone() }
2264 pub union CResult_NetworkGraphDecodeErrorZPtr {
2265 pub result: *mut crate::routing::network_graph::NetworkGraph,
2266 pub err: *mut crate::ln::msgs::DecodeError,
2269 pub struct CResult_NetworkGraphDecodeErrorZ {
2270 pub contents: CResult_NetworkGraphDecodeErrorZPtr,
2271 pub result_ok: bool,
2274 pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_ok(o: crate::routing::network_graph::NetworkGraph) -> CResult_NetworkGraphDecodeErrorZ {
2275 CResult_NetworkGraphDecodeErrorZ {
2276 contents: CResult_NetworkGraphDecodeErrorZPtr {
2277 result: Box::into_raw(Box::new(o)),
2283 pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NetworkGraphDecodeErrorZ {
2284 CResult_NetworkGraphDecodeErrorZ {
2285 contents: CResult_NetworkGraphDecodeErrorZPtr {
2286 err: Box::into_raw(Box::new(e)),
2292 pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_free(_res: CResult_NetworkGraphDecodeErrorZ) { }
2293 impl Drop for CResult_NetworkGraphDecodeErrorZ {
2294 fn drop(&mut self) {
2296 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2297 let _ = unsafe { Box::from_raw(self.contents.result) };
2300 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2301 let _ = unsafe { Box::from_raw(self.contents.err) };
2306 impl From<crate::c_types::CResultTempl<crate::routing::network_graph::NetworkGraph, crate::ln::msgs::DecodeError>> for CResult_NetworkGraphDecodeErrorZ {
2307 fn from(mut o: crate::c_types::CResultTempl<crate::routing::network_graph::NetworkGraph, crate::ln::msgs::DecodeError>) -> Self {
2308 let contents = if o.result_ok {
2309 let result = unsafe { o.contents.result };
2310 unsafe { o.contents.result = std::ptr::null_mut() };
2311 CResult_NetworkGraphDecodeErrorZPtr { result }
2313 let err = unsafe { o.contents.err };
2314 unsafe { o.contents.err = std::ptr::null_mut(); }
2315 CResult_NetworkGraphDecodeErrorZPtr { err }
2319 result_ok: o.result_ok,
2323 impl Clone for CResult_NetworkGraphDecodeErrorZ {
2324 fn clone(&self) -> Self {
2326 Self { result_ok: true, contents: CResult_NetworkGraphDecodeErrorZPtr {
2327 result: Box::into_raw(Box::new(<crate::routing::network_graph::NetworkGraph>::clone(unsafe { &*self.contents.result })))
2330 Self { result_ok: false, contents: CResult_NetworkGraphDecodeErrorZPtr {
2331 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2337 pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_clone(orig: &CResult_NetworkGraphDecodeErrorZ) -> CResult_NetworkGraphDecodeErrorZ { orig.clone() }
2339 pub struct C2Tuple_usizeTransactionZ {
2341 pub b: crate::c_types::Transaction,
2343 impl From<(usize, crate::c_types::Transaction)> for C2Tuple_usizeTransactionZ {
2344 fn from (tup: (usize, crate::c_types::Transaction)) -> Self {
2351 impl C2Tuple_usizeTransactionZ {
2352 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (usize, crate::c_types::Transaction) {
2357 pub extern "C" fn C2Tuple_usizeTransactionZ_new(a: usize, b: crate::c_types::Transaction) -> C2Tuple_usizeTransactionZ {
2358 C2Tuple_usizeTransactionZ { a, b, }
2362 pub extern "C" fn C2Tuple_usizeTransactionZ_free(_res: C2Tuple_usizeTransactionZ) { }
2364 pub struct CVec_C2Tuple_usizeTransactionZZ {
2365 pub data: *mut crate::c_types::derived::C2Tuple_usizeTransactionZ,
2368 impl CVec_C2Tuple_usizeTransactionZZ {
2369 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_usizeTransactionZ> {
2370 if self.datalen == 0 { return Vec::new(); }
2371 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2372 self.data = std::ptr::null_mut();
2376 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_usizeTransactionZ] {
2377 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2380 impl From<Vec<crate::c_types::derived::C2Tuple_usizeTransactionZ>> for CVec_C2Tuple_usizeTransactionZZ {
2381 fn from(v: Vec<crate::c_types::derived::C2Tuple_usizeTransactionZ>) -> Self {
2382 let datalen = v.len();
2383 let data = Box::into_raw(v.into_boxed_slice());
2384 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2388 pub extern "C" fn CVec_C2Tuple_usizeTransactionZZ_free(_res: CVec_C2Tuple_usizeTransactionZZ) { }
2389 impl Drop for CVec_C2Tuple_usizeTransactionZZ {
2390 fn drop(&mut self) {
2391 if self.datalen == 0 { return; }
2392 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2396 pub union CResult_NoneChannelMonitorUpdateErrZPtr {
2397 /// Note that this value is always NULL, as there are no contents in the OK variant
2398 pub result: *mut std::ffi::c_void,
2399 pub err: *mut crate::chain::channelmonitor::ChannelMonitorUpdateErr,
2402 pub struct CResult_NoneChannelMonitorUpdateErrZ {
2403 pub contents: CResult_NoneChannelMonitorUpdateErrZPtr,
2404 pub result_ok: bool,
2407 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_ok() -> CResult_NoneChannelMonitorUpdateErrZ {
2408 CResult_NoneChannelMonitorUpdateErrZ {
2409 contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2410 result: std::ptr::null_mut(),
2416 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_err(e: crate::chain::channelmonitor::ChannelMonitorUpdateErr) -> CResult_NoneChannelMonitorUpdateErrZ {
2417 CResult_NoneChannelMonitorUpdateErrZ {
2418 contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2419 err: Box::into_raw(Box::new(e)),
2425 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_free(_res: CResult_NoneChannelMonitorUpdateErrZ) { }
2426 impl Drop for CResult_NoneChannelMonitorUpdateErrZ {
2427 fn drop(&mut self) {
2430 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2431 let _ = unsafe { Box::from_raw(self.contents.err) };
2436 impl From<crate::c_types::CResultTempl<u8, crate::chain::channelmonitor::ChannelMonitorUpdateErr>> for CResult_NoneChannelMonitorUpdateErrZ {
2437 fn from(mut o: crate::c_types::CResultTempl<u8, crate::chain::channelmonitor::ChannelMonitorUpdateErr>) -> Self {
2438 let contents = if o.result_ok {
2439 let _ = unsafe { Box::from_raw(o.contents.result) };
2440 o.contents.result = std::ptr::null_mut();
2441 CResult_NoneChannelMonitorUpdateErrZPtr { result: std::ptr::null_mut() }
2443 let err = unsafe { o.contents.err };
2444 unsafe { o.contents.err = std::ptr::null_mut(); }
2445 CResult_NoneChannelMonitorUpdateErrZPtr { err }
2449 result_ok: o.result_ok,
2453 impl Clone for CResult_NoneChannelMonitorUpdateErrZ {
2454 fn clone(&self) -> Self {
2456 Self { result_ok: true, contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2457 result: std::ptr::null_mut()
2460 Self { result_ok: false, contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2461 err: Box::into_raw(Box::new(<crate::chain::channelmonitor::ChannelMonitorUpdateErr>::clone(unsafe { &*self.contents.err })))
2467 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_clone(orig: &CResult_NoneChannelMonitorUpdateErrZ) -> CResult_NoneChannelMonitorUpdateErrZ { orig.clone() }
2469 pub struct CVec_MonitorEventZ {
2470 pub data: *mut crate::chain::channelmonitor::MonitorEvent,
2473 impl CVec_MonitorEventZ {
2474 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::chain::channelmonitor::MonitorEvent> {
2475 if self.datalen == 0 { return Vec::new(); }
2476 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2477 self.data = std::ptr::null_mut();
2481 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::channelmonitor::MonitorEvent] {
2482 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2485 impl From<Vec<crate::chain::channelmonitor::MonitorEvent>> for CVec_MonitorEventZ {
2486 fn from(v: Vec<crate::chain::channelmonitor::MonitorEvent>) -> Self {
2487 let datalen = v.len();
2488 let data = Box::into_raw(v.into_boxed_slice());
2489 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2493 pub extern "C" fn CVec_MonitorEventZ_free(_res: CVec_MonitorEventZ) { }
2494 impl Drop for CVec_MonitorEventZ {
2495 fn drop(&mut self) {
2496 if self.datalen == 0 { return; }
2497 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2500 impl Clone for CVec_MonitorEventZ {
2501 fn clone(&self) -> Self {
2502 let mut res = Vec::new();
2503 if self.datalen == 0 { return Self::from(res); }
2504 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
2509 pub struct CVec_EventZ {
2510 pub data: *mut crate::util::events::Event,
2514 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::util::events::Event> {
2515 if self.datalen == 0 { return Vec::new(); }
2516 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2517 self.data = std::ptr::null_mut();
2521 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::util::events::Event] {
2522 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2525 impl From<Vec<crate::util::events::Event>> for CVec_EventZ {
2526 fn from(v: Vec<crate::util::events::Event>) -> Self {
2527 let datalen = v.len();
2528 let data = Box::into_raw(v.into_boxed_slice());
2529 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2533 pub extern "C" fn CVec_EventZ_free(_res: CVec_EventZ) { }
2534 impl Drop for CVec_EventZ {
2535 fn drop(&mut self) {
2536 if self.datalen == 0 { return; }
2537 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2540 impl Clone for CVec_EventZ {
2541 fn clone(&self) -> Self {
2542 let mut res = Vec::new();
2543 if self.datalen == 0 { return Self::from(res); }
2544 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
2549 pub union CResult_OutPointDecodeErrorZPtr {
2550 pub result: *mut crate::chain::transaction::OutPoint,
2551 pub err: *mut crate::ln::msgs::DecodeError,
2554 pub struct CResult_OutPointDecodeErrorZ {
2555 pub contents: CResult_OutPointDecodeErrorZPtr,
2556 pub result_ok: bool,
2559 pub extern "C" fn CResult_OutPointDecodeErrorZ_ok(o: crate::chain::transaction::OutPoint) -> CResult_OutPointDecodeErrorZ {
2560 CResult_OutPointDecodeErrorZ {
2561 contents: CResult_OutPointDecodeErrorZPtr {
2562 result: Box::into_raw(Box::new(o)),
2568 pub extern "C" fn CResult_OutPointDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_OutPointDecodeErrorZ {
2569 CResult_OutPointDecodeErrorZ {
2570 contents: CResult_OutPointDecodeErrorZPtr {
2571 err: Box::into_raw(Box::new(e)),
2577 pub extern "C" fn CResult_OutPointDecodeErrorZ_free(_res: CResult_OutPointDecodeErrorZ) { }
2578 impl Drop for CResult_OutPointDecodeErrorZ {
2579 fn drop(&mut self) {
2581 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2582 let _ = unsafe { Box::from_raw(self.contents.result) };
2585 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2586 let _ = unsafe { Box::from_raw(self.contents.err) };
2591 impl From<crate::c_types::CResultTempl<crate::chain::transaction::OutPoint, crate::ln::msgs::DecodeError>> for CResult_OutPointDecodeErrorZ {
2592 fn from(mut o: crate::c_types::CResultTempl<crate::chain::transaction::OutPoint, crate::ln::msgs::DecodeError>) -> Self {
2593 let contents = if o.result_ok {
2594 let result = unsafe { o.contents.result };
2595 unsafe { o.contents.result = std::ptr::null_mut() };
2596 CResult_OutPointDecodeErrorZPtr { result }
2598 let err = unsafe { o.contents.err };
2599 unsafe { o.contents.err = std::ptr::null_mut(); }
2600 CResult_OutPointDecodeErrorZPtr { err }
2604 result_ok: o.result_ok,
2608 impl Clone for CResult_OutPointDecodeErrorZ {
2609 fn clone(&self) -> Self {
2611 Self { result_ok: true, contents: CResult_OutPointDecodeErrorZPtr {
2612 result: Box::into_raw(Box::new(<crate::chain::transaction::OutPoint>::clone(unsafe { &*self.contents.result })))
2615 Self { result_ok: false, contents: CResult_OutPointDecodeErrorZPtr {
2616 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2622 pub extern "C" fn CResult_OutPointDecodeErrorZ_clone(orig: &CResult_OutPointDecodeErrorZ) -> CResult_OutPointDecodeErrorZ { orig.clone() }
2624 pub union CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2625 pub result: *mut crate::chain::channelmonitor::ChannelMonitorUpdate,
2626 pub err: *mut crate::ln::msgs::DecodeError,
2629 pub struct CResult_ChannelMonitorUpdateDecodeErrorZ {
2630 pub contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr,
2631 pub result_ok: bool,
2634 pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o: crate::chain::channelmonitor::ChannelMonitorUpdate) -> CResult_ChannelMonitorUpdateDecodeErrorZ {
2635 CResult_ChannelMonitorUpdateDecodeErrorZ {
2636 contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2637 result: Box::into_raw(Box::new(o)),
2643 pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelMonitorUpdateDecodeErrorZ {
2644 CResult_ChannelMonitorUpdateDecodeErrorZ {
2645 contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2646 err: Box::into_raw(Box::new(e)),
2652 pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res: CResult_ChannelMonitorUpdateDecodeErrorZ) { }
2653 impl Drop for CResult_ChannelMonitorUpdateDecodeErrorZ {
2654 fn drop(&mut self) {
2656 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2657 let _ = unsafe { Box::from_raw(self.contents.result) };
2660 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2661 let _ = unsafe { Box::from_raw(self.contents.err) };
2666 impl From<crate::c_types::CResultTempl<crate::chain::channelmonitor::ChannelMonitorUpdate, crate::ln::msgs::DecodeError>> for CResult_ChannelMonitorUpdateDecodeErrorZ {
2667 fn from(mut o: crate::c_types::CResultTempl<crate::chain::channelmonitor::ChannelMonitorUpdate, crate::ln::msgs::DecodeError>) -> Self {
2668 let contents = if o.result_ok {
2669 let result = unsafe { o.contents.result };
2670 unsafe { o.contents.result = std::ptr::null_mut() };
2671 CResult_ChannelMonitorUpdateDecodeErrorZPtr { result }
2673 let err = unsafe { o.contents.err };
2674 unsafe { o.contents.err = std::ptr::null_mut(); }
2675 CResult_ChannelMonitorUpdateDecodeErrorZPtr { err }
2679 result_ok: o.result_ok,
2683 impl Clone for CResult_ChannelMonitorUpdateDecodeErrorZ {
2684 fn clone(&self) -> Self {
2686 Self { result_ok: true, contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2687 result: Box::into_raw(Box::new(<crate::chain::channelmonitor::ChannelMonitorUpdate>::clone(unsafe { &*self.contents.result })))
2690 Self { result_ok: false, contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2691 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2697 pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig: &CResult_ChannelMonitorUpdateDecodeErrorZ) -> CResult_ChannelMonitorUpdateDecodeErrorZ { orig.clone() }
2699 pub union CResult_HTLCUpdateDecodeErrorZPtr {
2700 pub result: *mut crate::chain::channelmonitor::HTLCUpdate,
2701 pub err: *mut crate::ln::msgs::DecodeError,
2704 pub struct CResult_HTLCUpdateDecodeErrorZ {
2705 pub contents: CResult_HTLCUpdateDecodeErrorZPtr,
2706 pub result_ok: bool,
2709 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_ok(o: crate::chain::channelmonitor::HTLCUpdate) -> CResult_HTLCUpdateDecodeErrorZ {
2710 CResult_HTLCUpdateDecodeErrorZ {
2711 contents: CResult_HTLCUpdateDecodeErrorZPtr {
2712 result: Box::into_raw(Box::new(o)),
2718 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_HTLCUpdateDecodeErrorZ {
2719 CResult_HTLCUpdateDecodeErrorZ {
2720 contents: CResult_HTLCUpdateDecodeErrorZPtr {
2721 err: Box::into_raw(Box::new(e)),
2727 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_free(_res: CResult_HTLCUpdateDecodeErrorZ) { }
2728 impl Drop for CResult_HTLCUpdateDecodeErrorZ {
2729 fn drop(&mut self) {
2731 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2732 let _ = unsafe { Box::from_raw(self.contents.result) };
2735 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2736 let _ = unsafe { Box::from_raw(self.contents.err) };
2741 impl From<crate::c_types::CResultTempl<crate::chain::channelmonitor::HTLCUpdate, crate::ln::msgs::DecodeError>> for CResult_HTLCUpdateDecodeErrorZ {
2742 fn from(mut o: crate::c_types::CResultTempl<crate::chain::channelmonitor::HTLCUpdate, crate::ln::msgs::DecodeError>) -> Self {
2743 let contents = if o.result_ok {
2744 let result = unsafe { o.contents.result };
2745 unsafe { o.contents.result = std::ptr::null_mut() };
2746 CResult_HTLCUpdateDecodeErrorZPtr { result }
2748 let err = unsafe { o.contents.err };
2749 unsafe { o.contents.err = std::ptr::null_mut(); }
2750 CResult_HTLCUpdateDecodeErrorZPtr { err }
2754 result_ok: o.result_ok,
2758 impl Clone for CResult_HTLCUpdateDecodeErrorZ {
2759 fn clone(&self) -> Self {
2761 Self { result_ok: true, contents: CResult_HTLCUpdateDecodeErrorZPtr {
2762 result: Box::into_raw(Box::new(<crate::chain::channelmonitor::HTLCUpdate>::clone(unsafe { &*self.contents.result })))
2765 Self { result_ok: false, contents: CResult_HTLCUpdateDecodeErrorZPtr {
2766 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2772 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_clone(orig: &CResult_HTLCUpdateDecodeErrorZ) -> CResult_HTLCUpdateDecodeErrorZ { orig.clone() }
2774 pub union CResult_NoneMonitorUpdateErrorZPtr {
2775 /// Note that this value is always NULL, as there are no contents in the OK variant
2776 pub result: *mut std::ffi::c_void,
2777 pub err: *mut crate::chain::channelmonitor::MonitorUpdateError,
2780 pub struct CResult_NoneMonitorUpdateErrorZ {
2781 pub contents: CResult_NoneMonitorUpdateErrorZPtr,
2782 pub result_ok: bool,
2785 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_ok() -> CResult_NoneMonitorUpdateErrorZ {
2786 CResult_NoneMonitorUpdateErrorZ {
2787 contents: CResult_NoneMonitorUpdateErrorZPtr {
2788 result: std::ptr::null_mut(),
2794 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_err(e: crate::chain::channelmonitor::MonitorUpdateError) -> CResult_NoneMonitorUpdateErrorZ {
2795 CResult_NoneMonitorUpdateErrorZ {
2796 contents: CResult_NoneMonitorUpdateErrorZPtr {
2797 err: Box::into_raw(Box::new(e)),
2803 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_free(_res: CResult_NoneMonitorUpdateErrorZ) { }
2804 impl Drop for CResult_NoneMonitorUpdateErrorZ {
2805 fn drop(&mut self) {
2808 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2809 let _ = unsafe { Box::from_raw(self.contents.err) };
2814 impl From<crate::c_types::CResultTempl<u8, crate::chain::channelmonitor::MonitorUpdateError>> for CResult_NoneMonitorUpdateErrorZ {
2815 fn from(mut o: crate::c_types::CResultTempl<u8, crate::chain::channelmonitor::MonitorUpdateError>) -> Self {
2816 let contents = if o.result_ok {
2817 let _ = unsafe { Box::from_raw(o.contents.result) };
2818 o.contents.result = std::ptr::null_mut();
2819 CResult_NoneMonitorUpdateErrorZPtr { result: std::ptr::null_mut() }
2821 let err = unsafe { o.contents.err };
2822 unsafe { o.contents.err = std::ptr::null_mut(); }
2823 CResult_NoneMonitorUpdateErrorZPtr { err }
2827 result_ok: o.result_ok,
2831 impl Clone for CResult_NoneMonitorUpdateErrorZ {
2832 fn clone(&self) -> Self {
2834 Self { result_ok: true, contents: CResult_NoneMonitorUpdateErrorZPtr {
2835 result: std::ptr::null_mut()
2838 Self { result_ok: false, contents: CResult_NoneMonitorUpdateErrorZPtr {
2839 err: Box::into_raw(Box::new(<crate::chain::channelmonitor::MonitorUpdateError>::clone(unsafe { &*self.contents.err })))
2845 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_clone(orig: &CResult_NoneMonitorUpdateErrorZ) -> CResult_NoneMonitorUpdateErrorZ { orig.clone() }
2847 pub struct C2Tuple_OutPointScriptZ {
2848 pub a: crate::chain::transaction::OutPoint,
2849 pub b: crate::c_types::derived::CVec_u8Z,
2851 impl From<(crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z)> for C2Tuple_OutPointScriptZ {
2852 fn from (tup: (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z)) -> Self {
2859 impl C2Tuple_OutPointScriptZ {
2860 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z) {
2864 impl Clone for C2Tuple_OutPointScriptZ {
2865 fn clone(&self) -> Self {
2873 pub extern "C" fn C2Tuple_OutPointScriptZ_clone(orig: &C2Tuple_OutPointScriptZ) -> C2Tuple_OutPointScriptZ { orig.clone() }
2875 pub extern "C" fn C2Tuple_OutPointScriptZ_new(a: crate::chain::transaction::OutPoint, b: crate::c_types::derived::CVec_u8Z) -> C2Tuple_OutPointScriptZ {
2876 C2Tuple_OutPointScriptZ { a, b, }
2880 pub extern "C" fn C2Tuple_OutPointScriptZ_free(_res: C2Tuple_OutPointScriptZ) { }
2882 pub struct CVec_TransactionZ {
2883 pub data: *mut crate::c_types::Transaction,
2886 impl CVec_TransactionZ {
2887 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::Transaction> {
2888 if self.datalen == 0 { return Vec::new(); }
2889 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2890 self.data = std::ptr::null_mut();
2894 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::Transaction] {
2895 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2898 impl From<Vec<crate::c_types::Transaction>> for CVec_TransactionZ {
2899 fn from(v: Vec<crate::c_types::Transaction>) -> Self {
2900 let datalen = v.len();
2901 let data = Box::into_raw(v.into_boxed_slice());
2902 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2906 pub extern "C" fn CVec_TransactionZ_free(_res: CVec_TransactionZ) { }
2907 impl Drop for CVec_TransactionZ {
2908 fn drop(&mut self) {
2909 if self.datalen == 0 { return; }
2910 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2914 pub struct C2Tuple_u32TxOutZ {
2916 pub b: crate::c_types::TxOut,
2918 impl From<(u32, crate::c_types::TxOut)> for C2Tuple_u32TxOutZ {
2919 fn from (tup: (u32, crate::c_types::TxOut)) -> Self {
2926 impl C2Tuple_u32TxOutZ {
2927 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (u32, crate::c_types::TxOut) {
2931 impl Clone for C2Tuple_u32TxOutZ {
2932 fn clone(&self) -> Self {
2940 pub extern "C" fn C2Tuple_u32TxOutZ_clone(orig: &C2Tuple_u32TxOutZ) -> C2Tuple_u32TxOutZ { orig.clone() }
2942 pub extern "C" fn C2Tuple_u32TxOutZ_new(a: u32, b: crate::c_types::TxOut) -> C2Tuple_u32TxOutZ {
2943 C2Tuple_u32TxOutZ { a, b, }
2947 pub extern "C" fn C2Tuple_u32TxOutZ_free(_res: C2Tuple_u32TxOutZ) { }
2949 pub struct CVec_C2Tuple_u32TxOutZZ {
2950 pub data: *mut crate::c_types::derived::C2Tuple_u32TxOutZ,
2953 impl CVec_C2Tuple_u32TxOutZZ {
2954 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_u32TxOutZ> {
2955 if self.datalen == 0 { return Vec::new(); }
2956 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2957 self.data = std::ptr::null_mut();
2961 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_u32TxOutZ] {
2962 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2965 impl From<Vec<crate::c_types::derived::C2Tuple_u32TxOutZ>> for CVec_C2Tuple_u32TxOutZZ {
2966 fn from(v: Vec<crate::c_types::derived::C2Tuple_u32TxOutZ>) -> Self {
2967 let datalen = v.len();
2968 let data = Box::into_raw(v.into_boxed_slice());
2969 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2973 pub extern "C" fn CVec_C2Tuple_u32TxOutZZ_free(_res: CVec_C2Tuple_u32TxOutZZ) { }
2974 impl Drop for CVec_C2Tuple_u32TxOutZZ {
2975 fn drop(&mut self) {
2976 if self.datalen == 0 { return; }
2977 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2980 impl Clone for CVec_C2Tuple_u32TxOutZZ {
2981 fn clone(&self) -> Self {
2982 let mut res = Vec::new();
2983 if self.datalen == 0 { return Self::from(res); }
2984 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
2989 pub struct C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2990 pub a: crate::c_types::ThirtyTwoBytes,
2991 pub b: crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ,
2993 impl From<(crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ)> for C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2994 fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ)) -> Self {
3001 impl C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
3002 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ) {
3007 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 {
3008 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { a, b, }
3012 pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) { }
3014 pub struct CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
3015 pub data: *mut crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ,
3018 impl CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
3019 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ> {
3020 if self.datalen == 0 { return Vec::new(); }
3021 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3022 self.data = std::ptr::null_mut();
3026 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ] {
3027 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3030 impl From<Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ>> for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
3031 fn from(v: Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ>) -> Self {
3032 let datalen = v.len();
3033 let data = Box::into_raw(v.into_boxed_slice());
3034 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3038 pub extern "C" fn CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res: CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ) { }
3039 impl Drop for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
3040 fn drop(&mut self) {
3041 if self.datalen == 0 { return; }
3042 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3046 pub struct C2Tuple_BlockHashChannelMonitorZ {
3047 pub a: crate::c_types::ThirtyTwoBytes,
3048 pub b: crate::chain::channelmonitor::ChannelMonitor,
3050 impl From<(crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor)> for C2Tuple_BlockHashChannelMonitorZ {
3051 fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor)) -> Self {
3058 impl C2Tuple_BlockHashChannelMonitorZ {
3059 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor) {
3064 pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::chain::channelmonitor::ChannelMonitor) -> C2Tuple_BlockHashChannelMonitorZ {
3065 C2Tuple_BlockHashChannelMonitorZ { a, b, }
3069 pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_free(_res: C2Tuple_BlockHashChannelMonitorZ) { }
3071 pub union CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
3072 pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ,
3073 pub err: *mut crate::ln::msgs::DecodeError,
3076 pub struct CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3077 pub contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr,
3078 pub result_ok: bool,
3081 pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ) -> CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3082 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3083 contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
3084 result: Box::into_raw(Box::new(o)),
3090 pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3091 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3092 contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
3093 err: Box::into_raw(Box::new(e)),
3099 pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ) { }
3100 impl Drop for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3101 fn drop(&mut self) {
3103 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3104 let _ = unsafe { Box::from_raw(self.contents.result) };
3107 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3108 let _ = unsafe { Box::from_raw(self.contents.err) };
3113 impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ, crate::ln::msgs::DecodeError>> for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3114 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ, crate::ln::msgs::DecodeError>) -> Self {
3115 let contents = if o.result_ok {
3116 let result = unsafe { o.contents.result };
3117 unsafe { o.contents.result = std::ptr::null_mut() };
3118 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { result }
3120 let err = unsafe { o.contents.err };
3121 unsafe { o.contents.err = std::ptr::null_mut(); }
3122 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { err }
3126 result_ok: o.result_ok,
3131 pub struct CVec_SpendableOutputDescriptorZ {
3132 pub data: *mut crate::chain::keysinterface::SpendableOutputDescriptor,
3135 impl CVec_SpendableOutputDescriptorZ {
3136 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::chain::keysinterface::SpendableOutputDescriptor> {
3137 if self.datalen == 0 { return Vec::new(); }
3138 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3139 self.data = std::ptr::null_mut();
3143 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::keysinterface::SpendableOutputDescriptor] {
3144 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3147 impl From<Vec<crate::chain::keysinterface::SpendableOutputDescriptor>> for CVec_SpendableOutputDescriptorZ {
3148 fn from(v: Vec<crate::chain::keysinterface::SpendableOutputDescriptor>) -> Self {
3149 let datalen = v.len();
3150 let data = Box::into_raw(v.into_boxed_slice());
3151 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3155 pub extern "C" fn CVec_SpendableOutputDescriptorZ_free(_res: CVec_SpendableOutputDescriptorZ) { }
3156 impl Drop for CVec_SpendableOutputDescriptorZ {
3157 fn drop(&mut self) {
3158 if self.datalen == 0 { return; }
3159 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3162 impl Clone for CVec_SpendableOutputDescriptorZ {
3163 fn clone(&self) -> Self {
3164 let mut res = Vec::new();
3165 if self.datalen == 0 { return Self::from(res); }
3166 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
3171 pub union CResult_TxOutAccessErrorZPtr {
3172 pub result: *mut crate::c_types::TxOut,
3173 pub err: *mut crate::chain::AccessError,
3176 pub struct CResult_TxOutAccessErrorZ {
3177 pub contents: CResult_TxOutAccessErrorZPtr,
3178 pub result_ok: bool,
3181 pub extern "C" fn CResult_TxOutAccessErrorZ_ok(o: crate::c_types::TxOut) -> CResult_TxOutAccessErrorZ {
3182 CResult_TxOutAccessErrorZ {
3183 contents: CResult_TxOutAccessErrorZPtr {
3184 result: Box::into_raw(Box::new(o)),
3190 pub extern "C" fn CResult_TxOutAccessErrorZ_err(e: crate::chain::AccessError) -> CResult_TxOutAccessErrorZ {
3191 CResult_TxOutAccessErrorZ {
3192 contents: CResult_TxOutAccessErrorZPtr {
3193 err: Box::into_raw(Box::new(e)),
3199 pub extern "C" fn CResult_TxOutAccessErrorZ_free(_res: CResult_TxOutAccessErrorZ) { }
3200 impl Drop for CResult_TxOutAccessErrorZ {
3201 fn drop(&mut self) {
3203 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3204 let _ = unsafe { Box::from_raw(self.contents.result) };
3207 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3208 let _ = unsafe { Box::from_raw(self.contents.err) };
3213 impl From<crate::c_types::CResultTempl<crate::c_types::TxOut, crate::chain::AccessError>> for CResult_TxOutAccessErrorZ {
3214 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::TxOut, crate::chain::AccessError>) -> Self {
3215 let contents = if o.result_ok {
3216 let result = unsafe { o.contents.result };
3217 unsafe { o.contents.result = std::ptr::null_mut() };
3218 CResult_TxOutAccessErrorZPtr { result }
3220 let err = unsafe { o.contents.err };
3221 unsafe { o.contents.err = std::ptr::null_mut(); }
3222 CResult_TxOutAccessErrorZPtr { err }
3226 result_ok: o.result_ok,
3230 impl Clone for CResult_TxOutAccessErrorZ {
3231 fn clone(&self) -> Self {
3233 Self { result_ok: true, contents: CResult_TxOutAccessErrorZPtr {
3234 result: Box::into_raw(Box::new(<crate::c_types::TxOut>::clone(unsafe { &*self.contents.result })))
3237 Self { result_ok: false, contents: CResult_TxOutAccessErrorZPtr {
3238 err: Box::into_raw(Box::new(<crate::chain::AccessError>::clone(unsafe { &*self.contents.err })))
3244 pub extern "C" fn CResult_TxOutAccessErrorZ_clone(orig: &CResult_TxOutAccessErrorZ) -> CResult_TxOutAccessErrorZ { orig.clone() }
3246 pub union CResult_NoneAPIErrorZPtr {
3247 /// Note that this value is always NULL, as there are no contents in the OK variant
3248 pub result: *mut std::ffi::c_void,
3249 pub err: *mut crate::util::errors::APIError,
3252 pub struct CResult_NoneAPIErrorZ {
3253 pub contents: CResult_NoneAPIErrorZPtr,
3254 pub result_ok: bool,
3257 pub extern "C" fn CResult_NoneAPIErrorZ_ok() -> CResult_NoneAPIErrorZ {
3258 CResult_NoneAPIErrorZ {
3259 contents: CResult_NoneAPIErrorZPtr {
3260 result: std::ptr::null_mut(),
3266 pub extern "C" fn CResult_NoneAPIErrorZ_err(e: crate::util::errors::APIError) -> CResult_NoneAPIErrorZ {
3267 CResult_NoneAPIErrorZ {
3268 contents: CResult_NoneAPIErrorZPtr {
3269 err: Box::into_raw(Box::new(e)),
3275 pub extern "C" fn CResult_NoneAPIErrorZ_free(_res: CResult_NoneAPIErrorZ) { }
3276 impl Drop for CResult_NoneAPIErrorZ {
3277 fn drop(&mut self) {
3280 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3281 let _ = unsafe { Box::from_raw(self.contents.err) };
3286 impl From<crate::c_types::CResultTempl<u8, crate::util::errors::APIError>> for CResult_NoneAPIErrorZ {
3287 fn from(mut o: crate::c_types::CResultTempl<u8, crate::util::errors::APIError>) -> Self {
3288 let contents = if o.result_ok {
3289 let _ = unsafe { Box::from_raw(o.contents.result) };
3290 o.contents.result = std::ptr::null_mut();
3291 CResult_NoneAPIErrorZPtr { result: std::ptr::null_mut() }
3293 let err = unsafe { o.contents.err };
3294 unsafe { o.contents.err = std::ptr::null_mut(); }
3295 CResult_NoneAPIErrorZPtr { err }
3299 result_ok: o.result_ok,
3303 impl Clone for CResult_NoneAPIErrorZ {
3304 fn clone(&self) -> Self {
3306 Self { result_ok: true, contents: CResult_NoneAPIErrorZPtr {
3307 result: std::ptr::null_mut()
3310 Self { result_ok: false, contents: CResult_NoneAPIErrorZPtr {
3311 err: Box::into_raw(Box::new(<crate::util::errors::APIError>::clone(unsafe { &*self.contents.err })))
3317 pub extern "C" fn CResult_NoneAPIErrorZ_clone(orig: &CResult_NoneAPIErrorZ) -> CResult_NoneAPIErrorZ { orig.clone() }
3319 pub struct CVec_CResult_NoneAPIErrorZZ {
3320 pub data: *mut crate::c_types::derived::CResult_NoneAPIErrorZ,
3323 impl CVec_CResult_NoneAPIErrorZZ {
3324 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::CResult_NoneAPIErrorZ> {
3325 if self.datalen == 0 { return Vec::new(); }
3326 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3327 self.data = std::ptr::null_mut();
3331 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CResult_NoneAPIErrorZ] {
3332 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3335 impl From<Vec<crate::c_types::derived::CResult_NoneAPIErrorZ>> for CVec_CResult_NoneAPIErrorZZ {
3336 fn from(v: Vec<crate::c_types::derived::CResult_NoneAPIErrorZ>) -> Self {
3337 let datalen = v.len();
3338 let data = Box::into_raw(v.into_boxed_slice());
3339 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3343 pub extern "C" fn CVec_CResult_NoneAPIErrorZZ_free(_res: CVec_CResult_NoneAPIErrorZZ) { }
3344 impl Drop for CVec_CResult_NoneAPIErrorZZ {
3345 fn drop(&mut self) {
3346 if self.datalen == 0 { return; }
3347 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3350 impl Clone for CVec_CResult_NoneAPIErrorZZ {
3351 fn clone(&self) -> Self {
3352 let mut res = Vec::new();
3353 if self.datalen == 0 { return Self::from(res); }
3354 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
3359 pub struct CVec_APIErrorZ {
3360 pub data: *mut crate::util::errors::APIError,
3363 impl CVec_APIErrorZ {
3364 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::util::errors::APIError> {
3365 if self.datalen == 0 { return Vec::new(); }
3366 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3367 self.data = std::ptr::null_mut();
3371 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::util::errors::APIError] {
3372 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3375 impl From<Vec<crate::util::errors::APIError>> for CVec_APIErrorZ {
3376 fn from(v: Vec<crate::util::errors::APIError>) -> Self {
3377 let datalen = v.len();
3378 let data = Box::into_raw(v.into_boxed_slice());
3379 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3383 pub extern "C" fn CVec_APIErrorZ_free(_res: CVec_APIErrorZ) { }
3384 impl Drop for CVec_APIErrorZ {
3385 fn drop(&mut self) {
3386 if self.datalen == 0 { return; }
3387 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3390 impl Clone for CVec_APIErrorZ {
3391 fn clone(&self) -> Self {
3392 let mut res = Vec::new();
3393 if self.datalen == 0 { return Self::from(res); }
3394 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
3399 pub struct CVec_ChannelDetailsZ {
3400 pub data: *mut crate::ln::channelmanager::ChannelDetails,
3403 impl CVec_ChannelDetailsZ {
3404 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::channelmanager::ChannelDetails> {
3405 if self.datalen == 0 { return Vec::new(); }
3406 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3407 self.data = std::ptr::null_mut();
3411 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::channelmanager::ChannelDetails] {
3412 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3415 impl From<Vec<crate::ln::channelmanager::ChannelDetails>> for CVec_ChannelDetailsZ {
3416 fn from(v: Vec<crate::ln::channelmanager::ChannelDetails>) -> Self {
3417 let datalen = v.len();
3418 let data = Box::into_raw(v.into_boxed_slice());
3419 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3423 pub extern "C" fn CVec_ChannelDetailsZ_free(_res: CVec_ChannelDetailsZ) { }
3424 impl Drop for CVec_ChannelDetailsZ {
3425 fn drop(&mut self) {
3426 if self.datalen == 0 { return; }
3427 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3430 impl Clone for CVec_ChannelDetailsZ {
3431 fn clone(&self) -> Self {
3432 let mut res = Vec::new();
3433 if self.datalen == 0 { return Self::from(res); }
3434 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
3439 pub union CResult_NonePaymentSendFailureZPtr {
3440 /// Note that this value is always NULL, as there are no contents in the OK variant
3441 pub result: *mut std::ffi::c_void,
3442 pub err: *mut crate::ln::channelmanager::PaymentSendFailure,
3445 pub struct CResult_NonePaymentSendFailureZ {
3446 pub contents: CResult_NonePaymentSendFailureZPtr,
3447 pub result_ok: bool,
3450 pub extern "C" fn CResult_NonePaymentSendFailureZ_ok() -> CResult_NonePaymentSendFailureZ {
3451 CResult_NonePaymentSendFailureZ {
3452 contents: CResult_NonePaymentSendFailureZPtr {
3453 result: std::ptr::null_mut(),
3459 pub extern "C" fn CResult_NonePaymentSendFailureZ_err(e: crate::ln::channelmanager::PaymentSendFailure) -> CResult_NonePaymentSendFailureZ {
3460 CResult_NonePaymentSendFailureZ {
3461 contents: CResult_NonePaymentSendFailureZPtr {
3462 err: Box::into_raw(Box::new(e)),
3468 pub extern "C" fn CResult_NonePaymentSendFailureZ_free(_res: CResult_NonePaymentSendFailureZ) { }
3469 impl Drop for CResult_NonePaymentSendFailureZ {
3470 fn drop(&mut self) {
3473 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3474 let _ = unsafe { Box::from_raw(self.contents.err) };
3479 impl From<crate::c_types::CResultTempl<u8, crate::ln::channelmanager::PaymentSendFailure>> for CResult_NonePaymentSendFailureZ {
3480 fn from(mut o: crate::c_types::CResultTempl<u8, crate::ln::channelmanager::PaymentSendFailure>) -> Self {
3481 let contents = if o.result_ok {
3482 let _ = unsafe { Box::from_raw(o.contents.result) };
3483 o.contents.result = std::ptr::null_mut();
3484 CResult_NonePaymentSendFailureZPtr { result: std::ptr::null_mut() }
3486 let err = unsafe { o.contents.err };
3487 unsafe { o.contents.err = std::ptr::null_mut(); }
3488 CResult_NonePaymentSendFailureZPtr { err }
3492 result_ok: o.result_ok,
3496 impl Clone for CResult_NonePaymentSendFailureZ {
3497 fn clone(&self) -> Self {
3499 Self { result_ok: true, contents: CResult_NonePaymentSendFailureZPtr {
3500 result: std::ptr::null_mut()
3503 Self { result_ok: false, contents: CResult_NonePaymentSendFailureZPtr {
3504 err: Box::into_raw(Box::new(<crate::ln::channelmanager::PaymentSendFailure>::clone(unsafe { &*self.contents.err })))
3510 pub extern "C" fn CResult_NonePaymentSendFailureZ_clone(orig: &CResult_NonePaymentSendFailureZ) -> CResult_NonePaymentSendFailureZ { orig.clone() }
3512 pub struct CVec_ChannelMonitorZ {
3513 pub data: *mut crate::chain::channelmonitor::ChannelMonitor,
3516 impl CVec_ChannelMonitorZ {
3517 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::chain::channelmonitor::ChannelMonitor> {
3518 if self.datalen == 0 { return Vec::new(); }
3519 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3520 self.data = std::ptr::null_mut();
3524 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::channelmonitor::ChannelMonitor] {
3525 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3528 impl From<Vec<crate::chain::channelmonitor::ChannelMonitor>> for CVec_ChannelMonitorZ {
3529 fn from(v: Vec<crate::chain::channelmonitor::ChannelMonitor>) -> Self {
3530 let datalen = v.len();
3531 let data = Box::into_raw(v.into_boxed_slice());
3532 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3536 pub extern "C" fn CVec_ChannelMonitorZ_free(_res: CVec_ChannelMonitorZ) { }
3537 impl Drop for CVec_ChannelMonitorZ {
3538 fn drop(&mut self) {
3539 if self.datalen == 0 { return; }
3540 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3544 pub struct C2Tuple_BlockHashChannelManagerZ {
3545 pub a: crate::c_types::ThirtyTwoBytes,
3546 pub b: crate::ln::channelmanager::ChannelManager,
3548 impl From<(crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)> for C2Tuple_BlockHashChannelManagerZ {
3549 fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)) -> Self {
3556 impl C2Tuple_BlockHashChannelManagerZ {
3557 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager) {
3562 pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::ln::channelmanager::ChannelManager) -> C2Tuple_BlockHashChannelManagerZ {
3563 C2Tuple_BlockHashChannelManagerZ { a, b, }
3567 pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_free(_res: C2Tuple_BlockHashChannelManagerZ) { }
3569 pub union CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3570 pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ,
3571 pub err: *mut crate::ln::msgs::DecodeError,
3574 pub struct CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3575 pub contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr,
3576 pub result_ok: bool,
3579 pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3580 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3581 contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3582 result: Box::into_raw(Box::new(o)),
3588 pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3589 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3590 contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3591 err: Box::into_raw(Box::new(e)),
3597 pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ) { }
3598 impl Drop for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3599 fn drop(&mut self) {
3601 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3602 let _ = unsafe { Box::from_raw(self.contents.result) };
3605 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3606 let _ = unsafe { Box::from_raw(self.contents.err) };
3611 impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ, crate::ln::msgs::DecodeError>> for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3612 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ, crate::ln::msgs::DecodeError>) -> Self {
3613 let contents = if o.result_ok {
3614 let result = unsafe { o.contents.result };
3615 unsafe { o.contents.result = std::ptr::null_mut() };
3616 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { result }
3618 let err = unsafe { o.contents.err };
3619 unsafe { o.contents.err = std::ptr::null_mut(); }
3620 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { err }
3624 result_ok: o.result_ok,
3629 pub union CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3630 pub result: *mut crate::chain::keysinterface::SpendableOutputDescriptor,
3631 pub err: *mut crate::ln::msgs::DecodeError,
3634 pub struct CResult_SpendableOutputDescriptorDecodeErrorZ {
3635 pub contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr,
3636 pub result_ok: bool,
3639 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o: crate::chain::keysinterface::SpendableOutputDescriptor) -> CResult_SpendableOutputDescriptorDecodeErrorZ {
3640 CResult_SpendableOutputDescriptorDecodeErrorZ {
3641 contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3642 result: Box::into_raw(Box::new(o)),
3648 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_SpendableOutputDescriptorDecodeErrorZ {
3649 CResult_SpendableOutputDescriptorDecodeErrorZ {
3650 contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3651 err: Box::into_raw(Box::new(e)),
3657 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res: CResult_SpendableOutputDescriptorDecodeErrorZ) { }
3658 impl Drop for CResult_SpendableOutputDescriptorDecodeErrorZ {
3659 fn drop(&mut self) {
3661 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3662 let _ = unsafe { Box::from_raw(self.contents.result) };
3665 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3666 let _ = unsafe { Box::from_raw(self.contents.err) };
3671 impl From<crate::c_types::CResultTempl<crate::chain::keysinterface::SpendableOutputDescriptor, crate::ln::msgs::DecodeError>> for CResult_SpendableOutputDescriptorDecodeErrorZ {
3672 fn from(mut o: crate::c_types::CResultTempl<crate::chain::keysinterface::SpendableOutputDescriptor, crate::ln::msgs::DecodeError>) -> Self {
3673 let contents = if o.result_ok {
3674 let result = unsafe { o.contents.result };
3675 unsafe { o.contents.result = std::ptr::null_mut() };
3676 CResult_SpendableOutputDescriptorDecodeErrorZPtr { result }
3678 let err = unsafe { o.contents.err };
3679 unsafe { o.contents.err = std::ptr::null_mut(); }
3680 CResult_SpendableOutputDescriptorDecodeErrorZPtr { err }
3684 result_ok: o.result_ok,
3688 impl Clone for CResult_SpendableOutputDescriptorDecodeErrorZ {
3689 fn clone(&self) -> Self {
3691 Self { result_ok: true, contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3692 result: Box::into_raw(Box::new(<crate::chain::keysinterface::SpendableOutputDescriptor>::clone(unsafe { &*self.contents.result })))
3695 Self { result_ok: false, contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3696 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
3702 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig: &CResult_SpendableOutputDescriptorDecodeErrorZ) -> CResult_SpendableOutputDescriptorDecodeErrorZ { orig.clone() }
3704 pub struct C2Tuple_SignatureCVec_SignatureZZ {
3705 pub a: crate::c_types::Signature,
3706 pub b: crate::c_types::derived::CVec_SignatureZ,
3708 impl From<(crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ)> for C2Tuple_SignatureCVec_SignatureZZ {
3709 fn from (tup: (crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ)) -> Self {
3716 impl C2Tuple_SignatureCVec_SignatureZZ {
3717 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ) {
3721 impl Clone for C2Tuple_SignatureCVec_SignatureZZ {
3722 fn clone(&self) -> Self {
3730 pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_clone(orig: &C2Tuple_SignatureCVec_SignatureZZ) -> C2Tuple_SignatureCVec_SignatureZZ { orig.clone() }
3732 pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_new(a: crate::c_types::Signature, b: crate::c_types::derived::CVec_SignatureZ) -> C2Tuple_SignatureCVec_SignatureZZ {
3733 C2Tuple_SignatureCVec_SignatureZZ { a, b, }
3737 pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_free(_res: C2Tuple_SignatureCVec_SignatureZZ) { }
3739 pub union CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3740 pub result: *mut crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ,
3741 /// Note that this value is always NULL, as there are no contents in the Err variant
3742 pub err: *mut std::ffi::c_void,
3745 pub struct CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3746 pub contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr,
3747 pub result_ok: bool,
3750 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o: crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ) -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3751 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3752 contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3753 result: Box::into_raw(Box::new(o)),
3759 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3760 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3761 contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3762 err: std::ptr::null_mut(),
3768 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ) { }
3769 impl Drop for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3770 fn drop(&mut self) {
3772 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3773 let _ = unsafe { Box::from_raw(self.contents.result) };
3779 impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ, u8>> for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3780 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ, u8>) -> Self {
3781 let contents = if o.result_ok {
3782 let result = unsafe { o.contents.result };
3783 unsafe { o.contents.result = std::ptr::null_mut() };
3784 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { result }
3786 let _ = unsafe { Box::from_raw(o.contents.err) };
3787 o.contents.err = std::ptr::null_mut();
3788 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { err: std::ptr::null_mut() }
3792 result_ok: o.result_ok,
3796 impl Clone for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3797 fn clone(&self) -> Self {
3799 Self { result_ok: true, contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3800 result: Box::into_raw(Box::new(<crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ>::clone(unsafe { &*self.contents.result })))
3803 Self { result_ok: false, contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3804 err: std::ptr::null_mut()
3810 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig: &CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ) -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { orig.clone() }
3812 pub union CResult_SignatureNoneZPtr {
3813 pub result: *mut crate::c_types::Signature,
3814 /// Note that this value is always NULL, as there are no contents in the Err variant
3815 pub err: *mut std::ffi::c_void,
3818 pub struct CResult_SignatureNoneZ {
3819 pub contents: CResult_SignatureNoneZPtr,
3820 pub result_ok: bool,
3823 pub extern "C" fn CResult_SignatureNoneZ_ok(o: crate::c_types::Signature) -> CResult_SignatureNoneZ {
3824 CResult_SignatureNoneZ {
3825 contents: CResult_SignatureNoneZPtr {
3826 result: Box::into_raw(Box::new(o)),
3832 pub extern "C" fn CResult_SignatureNoneZ_err() -> CResult_SignatureNoneZ {
3833 CResult_SignatureNoneZ {
3834 contents: CResult_SignatureNoneZPtr {
3835 err: std::ptr::null_mut(),
3841 pub extern "C" fn CResult_SignatureNoneZ_free(_res: CResult_SignatureNoneZ) { }
3842 impl Drop for CResult_SignatureNoneZ {
3843 fn drop(&mut self) {
3845 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3846 let _ = unsafe { Box::from_raw(self.contents.result) };
3852 impl From<crate::c_types::CResultTempl<crate::c_types::Signature, u8>> for CResult_SignatureNoneZ {
3853 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::Signature, u8>) -> Self {
3854 let contents = if o.result_ok {
3855 let result = unsafe { o.contents.result };
3856 unsafe { o.contents.result = std::ptr::null_mut() };
3857 CResult_SignatureNoneZPtr { result }
3859 let _ = unsafe { Box::from_raw(o.contents.err) };
3860 o.contents.err = std::ptr::null_mut();
3861 CResult_SignatureNoneZPtr { err: std::ptr::null_mut() }
3865 result_ok: o.result_ok,
3869 impl Clone for CResult_SignatureNoneZ {
3870 fn clone(&self) -> Self {
3872 Self { result_ok: true, contents: CResult_SignatureNoneZPtr {
3873 result: Box::into_raw(Box::new(<crate::c_types::Signature>::clone(unsafe { &*self.contents.result })))
3876 Self { result_ok: false, contents: CResult_SignatureNoneZPtr {
3877 err: std::ptr::null_mut()
3883 pub extern "C" fn CResult_SignatureNoneZ_clone(orig: &CResult_SignatureNoneZ) -> CResult_SignatureNoneZ { orig.clone() }
3885 pub union CResult_SignDecodeErrorZPtr {
3886 pub result: *mut crate::chain::keysinterface::Sign,
3887 pub err: *mut crate::ln::msgs::DecodeError,
3890 pub struct CResult_SignDecodeErrorZ {
3891 pub contents: CResult_SignDecodeErrorZPtr,
3892 pub result_ok: bool,
3895 pub extern "C" fn CResult_SignDecodeErrorZ_ok(o: crate::chain::keysinterface::Sign) -> CResult_SignDecodeErrorZ {
3896 CResult_SignDecodeErrorZ {
3897 contents: CResult_SignDecodeErrorZPtr {
3898 result: Box::into_raw(Box::new(o)),
3904 pub extern "C" fn CResult_SignDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_SignDecodeErrorZ {
3905 CResult_SignDecodeErrorZ {
3906 contents: CResult_SignDecodeErrorZPtr {
3907 err: Box::into_raw(Box::new(e)),
3913 pub extern "C" fn CResult_SignDecodeErrorZ_free(_res: CResult_SignDecodeErrorZ) { }
3914 impl Drop for CResult_SignDecodeErrorZ {
3915 fn drop(&mut self) {
3917 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3918 let _ = unsafe { Box::from_raw(self.contents.result) };
3921 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3922 let _ = unsafe { Box::from_raw(self.contents.err) };
3927 impl From<crate::c_types::CResultTempl<crate::chain::keysinterface::Sign, crate::ln::msgs::DecodeError>> for CResult_SignDecodeErrorZ {
3928 fn from(mut o: crate::c_types::CResultTempl<crate::chain::keysinterface::Sign, crate::ln::msgs::DecodeError>) -> Self {
3929 let contents = if o.result_ok {
3930 let result = unsafe { o.contents.result };
3931 unsafe { o.contents.result = std::ptr::null_mut() };
3932 CResult_SignDecodeErrorZPtr { result }
3934 let err = unsafe { o.contents.err };
3935 unsafe { o.contents.err = std::ptr::null_mut(); }
3936 CResult_SignDecodeErrorZPtr { err }
3940 result_ok: o.result_ok,
3944 impl Clone for CResult_SignDecodeErrorZ {
3945 fn clone(&self) -> Self {
3947 Self { result_ok: true, contents: CResult_SignDecodeErrorZPtr {
3948 result: Box::into_raw(Box::new(<crate::chain::keysinterface::Sign>::clone(unsafe { &*self.contents.result })))
3951 Self { result_ok: false, contents: CResult_SignDecodeErrorZPtr {
3952 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
3958 pub extern "C" fn CResult_SignDecodeErrorZ_clone(orig: &CResult_SignDecodeErrorZ) -> CResult_SignDecodeErrorZ { orig.clone() }
3960 pub struct CVec_CVec_u8ZZ {
3961 pub data: *mut crate::c_types::derived::CVec_u8Z,
3964 impl CVec_CVec_u8ZZ {
3965 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::CVec_u8Z> {
3966 if self.datalen == 0 { return Vec::new(); }
3967 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3968 self.data = std::ptr::null_mut();
3972 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CVec_u8Z] {
3973 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3976 impl From<Vec<crate::c_types::derived::CVec_u8Z>> for CVec_CVec_u8ZZ {
3977 fn from(v: Vec<crate::c_types::derived::CVec_u8Z>) -> Self {
3978 let datalen = v.len();
3979 let data = Box::into_raw(v.into_boxed_slice());
3980 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3984 pub extern "C" fn CVec_CVec_u8ZZ_free(_res: CVec_CVec_u8ZZ) { }
3985 impl Drop for CVec_CVec_u8ZZ {
3986 fn drop(&mut self) {
3987 if self.datalen == 0 { return; }
3988 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3991 impl Clone for CVec_CVec_u8ZZ {
3992 fn clone(&self) -> Self {
3993 let mut res = Vec::new();
3994 if self.datalen == 0 { return Self::from(res); }
3995 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4000 pub union CResult_CVec_CVec_u8ZZNoneZPtr {
4001 pub result: *mut crate::c_types::derived::CVec_CVec_u8ZZ,
4002 /// Note that this value is always NULL, as there are no contents in the Err variant
4003 pub err: *mut std::ffi::c_void,
4006 pub struct CResult_CVec_CVec_u8ZZNoneZ {
4007 pub contents: CResult_CVec_CVec_u8ZZNoneZPtr,
4008 pub result_ok: bool,
4011 pub extern "C" fn CResult_CVec_CVec_u8ZZNoneZ_ok(o: crate::c_types::derived::CVec_CVec_u8ZZ) -> CResult_CVec_CVec_u8ZZNoneZ {
4012 CResult_CVec_CVec_u8ZZNoneZ {
4013 contents: CResult_CVec_CVec_u8ZZNoneZPtr {
4014 result: Box::into_raw(Box::new(o)),
4020 pub extern "C" fn CResult_CVec_CVec_u8ZZNoneZ_err() -> CResult_CVec_CVec_u8ZZNoneZ {
4021 CResult_CVec_CVec_u8ZZNoneZ {
4022 contents: CResult_CVec_CVec_u8ZZNoneZPtr {
4023 err: std::ptr::null_mut(),
4029 pub extern "C" fn CResult_CVec_CVec_u8ZZNoneZ_free(_res: CResult_CVec_CVec_u8ZZNoneZ) { }
4030 impl Drop for CResult_CVec_CVec_u8ZZNoneZ {
4031 fn drop(&mut self) {
4033 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4034 let _ = unsafe { Box::from_raw(self.contents.result) };
4040 impl From<crate::c_types::CResultTempl<crate::c_types::derived::CVec_CVec_u8ZZ, u8>> for CResult_CVec_CVec_u8ZZNoneZ {
4041 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CVec_CVec_u8ZZ, u8>) -> Self {
4042 let contents = if o.result_ok {
4043 let result = unsafe { o.contents.result };
4044 unsafe { o.contents.result = std::ptr::null_mut() };
4045 CResult_CVec_CVec_u8ZZNoneZPtr { result }
4047 let _ = unsafe { Box::from_raw(o.contents.err) };
4048 o.contents.err = std::ptr::null_mut();
4049 CResult_CVec_CVec_u8ZZNoneZPtr { err: std::ptr::null_mut() }
4053 result_ok: o.result_ok,
4057 impl Clone for CResult_CVec_CVec_u8ZZNoneZ {
4058 fn clone(&self) -> Self {
4060 Self { result_ok: true, contents: CResult_CVec_CVec_u8ZZNoneZPtr {
4061 result: Box::into_raw(Box::new(<crate::c_types::derived::CVec_CVec_u8ZZ>::clone(unsafe { &*self.contents.result })))
4064 Self { result_ok: false, contents: CResult_CVec_CVec_u8ZZNoneZPtr {
4065 err: std::ptr::null_mut()
4071 pub extern "C" fn CResult_CVec_CVec_u8ZZNoneZ_clone(orig: &CResult_CVec_CVec_u8ZZNoneZ) -> CResult_CVec_CVec_u8ZZNoneZ { orig.clone() }
4073 pub union CResult_InMemorySignerDecodeErrorZPtr {
4074 pub result: *mut crate::chain::keysinterface::InMemorySigner,
4075 pub err: *mut crate::ln::msgs::DecodeError,
4078 pub struct CResult_InMemorySignerDecodeErrorZ {
4079 pub contents: CResult_InMemorySignerDecodeErrorZPtr,
4080 pub result_ok: bool,
4083 pub extern "C" fn CResult_InMemorySignerDecodeErrorZ_ok(o: crate::chain::keysinterface::InMemorySigner) -> CResult_InMemorySignerDecodeErrorZ {
4084 CResult_InMemorySignerDecodeErrorZ {
4085 contents: CResult_InMemorySignerDecodeErrorZPtr {
4086 result: Box::into_raw(Box::new(o)),
4092 pub extern "C" fn CResult_InMemorySignerDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InMemorySignerDecodeErrorZ {
4093 CResult_InMemorySignerDecodeErrorZ {
4094 contents: CResult_InMemorySignerDecodeErrorZPtr {
4095 err: Box::into_raw(Box::new(e)),
4101 pub extern "C" fn CResult_InMemorySignerDecodeErrorZ_free(_res: CResult_InMemorySignerDecodeErrorZ) { }
4102 impl Drop for CResult_InMemorySignerDecodeErrorZ {
4103 fn drop(&mut self) {
4105 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4106 let _ = unsafe { Box::from_raw(self.contents.result) };
4109 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4110 let _ = unsafe { Box::from_raw(self.contents.err) };
4115 impl From<crate::c_types::CResultTempl<crate::chain::keysinterface::InMemorySigner, crate::ln::msgs::DecodeError>> for CResult_InMemorySignerDecodeErrorZ {
4116 fn from(mut o: crate::c_types::CResultTempl<crate::chain::keysinterface::InMemorySigner, crate::ln::msgs::DecodeError>) -> Self {
4117 let contents = if o.result_ok {
4118 let result = unsafe { o.contents.result };
4119 unsafe { o.contents.result = std::ptr::null_mut() };
4120 CResult_InMemorySignerDecodeErrorZPtr { result }
4122 let err = unsafe { o.contents.err };
4123 unsafe { o.contents.err = std::ptr::null_mut(); }
4124 CResult_InMemorySignerDecodeErrorZPtr { err }
4128 result_ok: o.result_ok,
4132 impl Clone for CResult_InMemorySignerDecodeErrorZ {
4133 fn clone(&self) -> Self {
4135 Self { result_ok: true, contents: CResult_InMemorySignerDecodeErrorZPtr {
4136 result: Box::into_raw(Box::new(<crate::chain::keysinterface::InMemorySigner>::clone(unsafe { &*self.contents.result })))
4139 Self { result_ok: false, contents: CResult_InMemorySignerDecodeErrorZPtr {
4140 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4146 pub extern "C" fn CResult_InMemorySignerDecodeErrorZ_clone(orig: &CResult_InMemorySignerDecodeErrorZ) -> CResult_InMemorySignerDecodeErrorZ { orig.clone() }
4148 pub struct CVec_TxOutZ {
4149 pub data: *mut crate::c_types::TxOut,
4153 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::TxOut> {
4154 if self.datalen == 0 { return Vec::new(); }
4155 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4156 self.data = std::ptr::null_mut();
4160 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::TxOut] {
4161 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4164 impl From<Vec<crate::c_types::TxOut>> for CVec_TxOutZ {
4165 fn from(v: Vec<crate::c_types::TxOut>) -> Self {
4166 let datalen = v.len();
4167 let data = Box::into_raw(v.into_boxed_slice());
4168 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4172 pub extern "C" fn CVec_TxOutZ_free(_res: CVec_TxOutZ) { }
4173 impl Drop for CVec_TxOutZ {
4174 fn drop(&mut self) {
4175 if self.datalen == 0 { return; }
4176 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4179 impl Clone for CVec_TxOutZ {
4180 fn clone(&self) -> Self {
4181 let mut res = Vec::new();
4182 if self.datalen == 0 { return Self::from(res); }
4183 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4188 pub union CResult_TransactionNoneZPtr {
4189 pub result: *mut crate::c_types::Transaction,
4190 /// Note that this value is always NULL, as there are no contents in the Err variant
4191 pub err: *mut std::ffi::c_void,
4194 pub struct CResult_TransactionNoneZ {
4195 pub contents: CResult_TransactionNoneZPtr,
4196 pub result_ok: bool,
4199 pub extern "C" fn CResult_TransactionNoneZ_ok(o: crate::c_types::Transaction) -> CResult_TransactionNoneZ {
4200 CResult_TransactionNoneZ {
4201 contents: CResult_TransactionNoneZPtr {
4202 result: Box::into_raw(Box::new(o)),
4208 pub extern "C" fn CResult_TransactionNoneZ_err() -> CResult_TransactionNoneZ {
4209 CResult_TransactionNoneZ {
4210 contents: CResult_TransactionNoneZPtr {
4211 err: std::ptr::null_mut(),
4217 pub extern "C" fn CResult_TransactionNoneZ_free(_res: CResult_TransactionNoneZ) { }
4218 impl Drop for CResult_TransactionNoneZ {
4219 fn drop(&mut self) {
4221 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4222 let _ = unsafe { Box::from_raw(self.contents.result) };
4228 impl From<crate::c_types::CResultTempl<crate::c_types::Transaction, u8>> for CResult_TransactionNoneZ {
4229 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::Transaction, u8>) -> Self {
4230 let contents = if o.result_ok {
4231 let result = unsafe { o.contents.result };
4232 unsafe { o.contents.result = std::ptr::null_mut() };
4233 CResult_TransactionNoneZPtr { result }
4235 let _ = unsafe { Box::from_raw(o.contents.err) };
4236 o.contents.err = std::ptr::null_mut();
4237 CResult_TransactionNoneZPtr { err: std::ptr::null_mut() }
4241 result_ok: o.result_ok,
4246 pub struct CVec_RouteHopZ {
4247 pub data: *mut crate::routing::router::RouteHop,
4250 impl CVec_RouteHopZ {
4251 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::routing::router::RouteHop> {
4252 if self.datalen == 0 { return Vec::new(); }
4253 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4254 self.data = std::ptr::null_mut();
4258 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::routing::router::RouteHop] {
4259 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4262 impl From<Vec<crate::routing::router::RouteHop>> for CVec_RouteHopZ {
4263 fn from(v: Vec<crate::routing::router::RouteHop>) -> Self {
4264 let datalen = v.len();
4265 let data = Box::into_raw(v.into_boxed_slice());
4266 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4270 pub extern "C" fn CVec_RouteHopZ_free(_res: CVec_RouteHopZ) { }
4271 impl Drop for CVec_RouteHopZ {
4272 fn drop(&mut self) {
4273 if self.datalen == 0 { return; }
4274 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4277 impl Clone for CVec_RouteHopZ {
4278 fn clone(&self) -> Self {
4279 let mut res = Vec::new();
4280 if self.datalen == 0 { return Self::from(res); }
4281 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4286 pub struct CVec_CVec_RouteHopZZ {
4287 pub data: *mut crate::c_types::derived::CVec_RouteHopZ,
4290 impl CVec_CVec_RouteHopZZ {
4291 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::CVec_RouteHopZ> {
4292 if self.datalen == 0 { return Vec::new(); }
4293 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4294 self.data = std::ptr::null_mut();
4298 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CVec_RouteHopZ] {
4299 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4302 impl From<Vec<crate::c_types::derived::CVec_RouteHopZ>> for CVec_CVec_RouteHopZZ {
4303 fn from(v: Vec<crate::c_types::derived::CVec_RouteHopZ>) -> Self {
4304 let datalen = v.len();
4305 let data = Box::into_raw(v.into_boxed_slice());
4306 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4310 pub extern "C" fn CVec_CVec_RouteHopZZ_free(_res: CVec_CVec_RouteHopZZ) { }
4311 impl Drop for CVec_CVec_RouteHopZZ {
4312 fn drop(&mut self) {
4313 if self.datalen == 0 { return; }
4314 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4317 impl Clone for CVec_CVec_RouteHopZZ {
4318 fn clone(&self) -> Self {
4319 let mut res = Vec::new();
4320 if self.datalen == 0 { return Self::from(res); }
4321 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4326 pub union CResult_RouteDecodeErrorZPtr {
4327 pub result: *mut crate::routing::router::Route,
4328 pub err: *mut crate::ln::msgs::DecodeError,
4331 pub struct CResult_RouteDecodeErrorZ {
4332 pub contents: CResult_RouteDecodeErrorZPtr,
4333 pub result_ok: bool,
4336 pub extern "C" fn CResult_RouteDecodeErrorZ_ok(o: crate::routing::router::Route) -> CResult_RouteDecodeErrorZ {
4337 CResult_RouteDecodeErrorZ {
4338 contents: CResult_RouteDecodeErrorZPtr {
4339 result: Box::into_raw(Box::new(o)),
4345 pub extern "C" fn CResult_RouteDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RouteDecodeErrorZ {
4346 CResult_RouteDecodeErrorZ {
4347 contents: CResult_RouteDecodeErrorZPtr {
4348 err: Box::into_raw(Box::new(e)),
4354 pub extern "C" fn CResult_RouteDecodeErrorZ_free(_res: CResult_RouteDecodeErrorZ) { }
4355 impl Drop for CResult_RouteDecodeErrorZ {
4356 fn drop(&mut self) {
4358 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4359 let _ = unsafe { Box::from_raw(self.contents.result) };
4362 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4363 let _ = unsafe { Box::from_raw(self.contents.err) };
4368 impl From<crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::DecodeError>> for CResult_RouteDecodeErrorZ {
4369 fn from(mut o: crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::DecodeError>) -> Self {
4370 let contents = if o.result_ok {
4371 let result = unsafe { o.contents.result };
4372 unsafe { o.contents.result = std::ptr::null_mut() };
4373 CResult_RouteDecodeErrorZPtr { result }
4375 let err = unsafe { o.contents.err };
4376 unsafe { o.contents.err = std::ptr::null_mut(); }
4377 CResult_RouteDecodeErrorZPtr { err }
4381 result_ok: o.result_ok,
4385 impl Clone for CResult_RouteDecodeErrorZ {
4386 fn clone(&self) -> Self {
4388 Self { result_ok: true, contents: CResult_RouteDecodeErrorZPtr {
4389 result: Box::into_raw(Box::new(<crate::routing::router::Route>::clone(unsafe { &*self.contents.result })))
4392 Self { result_ok: false, contents: CResult_RouteDecodeErrorZPtr {
4393 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4399 pub extern "C" fn CResult_RouteDecodeErrorZ_clone(orig: &CResult_RouteDecodeErrorZ) -> CResult_RouteDecodeErrorZ { orig.clone() }
4401 pub struct CVec_RouteHintZ {
4402 pub data: *mut crate::routing::router::RouteHint,
4405 impl CVec_RouteHintZ {
4406 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::routing::router::RouteHint> {
4407 if self.datalen == 0 { return Vec::new(); }
4408 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4409 self.data = std::ptr::null_mut();
4413 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::routing::router::RouteHint] {
4414 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4417 impl From<Vec<crate::routing::router::RouteHint>> for CVec_RouteHintZ {
4418 fn from(v: Vec<crate::routing::router::RouteHint>) -> Self {
4419 let datalen = v.len();
4420 let data = Box::into_raw(v.into_boxed_slice());
4421 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4425 pub extern "C" fn CVec_RouteHintZ_free(_res: CVec_RouteHintZ) { }
4426 impl Drop for CVec_RouteHintZ {
4427 fn drop(&mut self) {
4428 if self.datalen == 0 { return; }
4429 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4432 impl Clone for CVec_RouteHintZ {
4433 fn clone(&self) -> Self {
4434 let mut res = Vec::new();
4435 if self.datalen == 0 { return Self::from(res); }
4436 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4441 pub union CResult_RouteLightningErrorZPtr {
4442 pub result: *mut crate::routing::router::Route,
4443 pub err: *mut crate::ln::msgs::LightningError,
4446 pub struct CResult_RouteLightningErrorZ {
4447 pub contents: CResult_RouteLightningErrorZPtr,
4448 pub result_ok: bool,
4451 pub extern "C" fn CResult_RouteLightningErrorZ_ok(o: crate::routing::router::Route) -> CResult_RouteLightningErrorZ {
4452 CResult_RouteLightningErrorZ {
4453 contents: CResult_RouteLightningErrorZPtr {
4454 result: Box::into_raw(Box::new(o)),
4460 pub extern "C" fn CResult_RouteLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_RouteLightningErrorZ {
4461 CResult_RouteLightningErrorZ {
4462 contents: CResult_RouteLightningErrorZPtr {
4463 err: Box::into_raw(Box::new(e)),
4469 pub extern "C" fn CResult_RouteLightningErrorZ_free(_res: CResult_RouteLightningErrorZ) { }
4470 impl Drop for CResult_RouteLightningErrorZ {
4471 fn drop(&mut self) {
4473 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4474 let _ = unsafe { Box::from_raw(self.contents.result) };
4477 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4478 let _ = unsafe { Box::from_raw(self.contents.err) };
4483 impl From<crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::LightningError>> for CResult_RouteLightningErrorZ {
4484 fn from(mut o: crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::LightningError>) -> Self {
4485 let contents = if o.result_ok {
4486 let result = unsafe { o.contents.result };
4487 unsafe { o.contents.result = std::ptr::null_mut() };
4488 CResult_RouteLightningErrorZPtr { result }
4490 let err = unsafe { o.contents.err };
4491 unsafe { o.contents.err = std::ptr::null_mut(); }
4492 CResult_RouteLightningErrorZPtr { err }
4496 result_ok: o.result_ok,
4500 impl Clone for CResult_RouteLightningErrorZ {
4501 fn clone(&self) -> Self {
4503 Self { result_ok: true, contents: CResult_RouteLightningErrorZPtr {
4504 result: Box::into_raw(Box::new(<crate::routing::router::Route>::clone(unsafe { &*self.contents.result })))
4507 Self { result_ok: false, contents: CResult_RouteLightningErrorZPtr {
4508 err: Box::into_raw(Box::new(<crate::ln::msgs::LightningError>::clone(unsafe { &*self.contents.err })))
4514 pub extern "C" fn CResult_RouteLightningErrorZ_clone(orig: &CResult_RouteLightningErrorZ) -> CResult_RouteLightningErrorZ { orig.clone() }
4516 pub union CResult_NetAddressu8ZPtr {
4517 pub result: *mut crate::ln::msgs::NetAddress,
4521 pub struct CResult_NetAddressu8Z {
4522 pub contents: CResult_NetAddressu8ZPtr,
4523 pub result_ok: bool,
4526 pub extern "C" fn CResult_NetAddressu8Z_ok(o: crate::ln::msgs::NetAddress) -> CResult_NetAddressu8Z {
4527 CResult_NetAddressu8Z {
4528 contents: CResult_NetAddressu8ZPtr {
4529 result: Box::into_raw(Box::new(o)),
4535 pub extern "C" fn CResult_NetAddressu8Z_err(e: u8) -> CResult_NetAddressu8Z {
4536 CResult_NetAddressu8Z {
4537 contents: CResult_NetAddressu8ZPtr {
4538 err: Box::into_raw(Box::new(e)),
4544 pub extern "C" fn CResult_NetAddressu8Z_free(_res: CResult_NetAddressu8Z) { }
4545 impl Drop for CResult_NetAddressu8Z {
4546 fn drop(&mut self) {
4548 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4549 let _ = unsafe { Box::from_raw(self.contents.result) };
4552 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4553 let _ = unsafe { Box::from_raw(self.contents.err) };
4558 impl From<crate::c_types::CResultTempl<crate::ln::msgs::NetAddress, u8>> for CResult_NetAddressu8Z {
4559 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::NetAddress, u8>) -> Self {
4560 let contents = if o.result_ok {
4561 let result = unsafe { o.contents.result };
4562 unsafe { o.contents.result = std::ptr::null_mut() };
4563 CResult_NetAddressu8ZPtr { result }
4565 let err = unsafe { o.contents.err };
4566 unsafe { o.contents.err = std::ptr::null_mut(); }
4567 CResult_NetAddressu8ZPtr { err }
4571 result_ok: o.result_ok,
4575 impl Clone for CResult_NetAddressu8Z {
4576 fn clone(&self) -> Self {
4578 Self { result_ok: true, contents: CResult_NetAddressu8ZPtr {
4579 result: Box::into_raw(Box::new(<crate::ln::msgs::NetAddress>::clone(unsafe { &*self.contents.result })))
4582 Self { result_ok: false, contents: CResult_NetAddressu8ZPtr {
4583 err: Box::into_raw(Box::new(<u8>::clone(unsafe { &*self.contents.err })))
4589 pub extern "C" fn CResult_NetAddressu8Z_clone(orig: &CResult_NetAddressu8Z) -> CResult_NetAddressu8Z { orig.clone() }
4591 pub union CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4592 pub result: *mut crate::c_types::derived::CResult_NetAddressu8Z,
4593 pub err: *mut crate::ln::msgs::DecodeError,
4596 pub struct CResult_CResult_NetAddressu8ZDecodeErrorZ {
4597 pub contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr,
4598 pub result_ok: bool,
4601 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o: crate::c_types::derived::CResult_NetAddressu8Z) -> CResult_CResult_NetAddressu8ZDecodeErrorZ {
4602 CResult_CResult_NetAddressu8ZDecodeErrorZ {
4603 contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4604 result: Box::into_raw(Box::new(o)),
4610 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CResult_NetAddressu8ZDecodeErrorZ {
4611 CResult_CResult_NetAddressu8ZDecodeErrorZ {
4612 contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4613 err: Box::into_raw(Box::new(e)),
4619 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res: CResult_CResult_NetAddressu8ZDecodeErrorZ) { }
4620 impl Drop for CResult_CResult_NetAddressu8ZDecodeErrorZ {
4621 fn drop(&mut self) {
4623 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4624 let _ = unsafe { Box::from_raw(self.contents.result) };
4627 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4628 let _ = unsafe { Box::from_raw(self.contents.err) };
4633 impl From<crate::c_types::CResultTempl<crate::c_types::derived::CResult_NetAddressu8Z, crate::ln::msgs::DecodeError>> for CResult_CResult_NetAddressu8ZDecodeErrorZ {
4634 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CResult_NetAddressu8Z, crate::ln::msgs::DecodeError>) -> Self {
4635 let contents = if o.result_ok {
4636 let result = unsafe { o.contents.result };
4637 unsafe { o.contents.result = std::ptr::null_mut() };
4638 CResult_CResult_NetAddressu8ZDecodeErrorZPtr { result }
4640 let err = unsafe { o.contents.err };
4641 unsafe { o.contents.err = std::ptr::null_mut(); }
4642 CResult_CResult_NetAddressu8ZDecodeErrorZPtr { err }
4646 result_ok: o.result_ok,
4650 impl Clone for CResult_CResult_NetAddressu8ZDecodeErrorZ {
4651 fn clone(&self) -> Self {
4653 Self { result_ok: true, contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4654 result: Box::into_raw(Box::new(<crate::c_types::derived::CResult_NetAddressu8Z>::clone(unsafe { &*self.contents.result })))
4657 Self { result_ok: false, contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4658 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4664 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig: &CResult_CResult_NetAddressu8ZDecodeErrorZ) -> CResult_CResult_NetAddressu8ZDecodeErrorZ { orig.clone() }
4666 pub struct CVec_UpdateAddHTLCZ {
4667 pub data: *mut crate::ln::msgs::UpdateAddHTLC,
4670 impl CVec_UpdateAddHTLCZ {
4671 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateAddHTLC> {
4672 if self.datalen == 0 { return Vec::new(); }
4673 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4674 self.data = std::ptr::null_mut();
4678 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateAddHTLC] {
4679 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4682 impl From<Vec<crate::ln::msgs::UpdateAddHTLC>> for CVec_UpdateAddHTLCZ {
4683 fn from(v: Vec<crate::ln::msgs::UpdateAddHTLC>) -> Self {
4684 let datalen = v.len();
4685 let data = Box::into_raw(v.into_boxed_slice());
4686 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4690 pub extern "C" fn CVec_UpdateAddHTLCZ_free(_res: CVec_UpdateAddHTLCZ) { }
4691 impl Drop for CVec_UpdateAddHTLCZ {
4692 fn drop(&mut self) {
4693 if self.datalen == 0 { return; }
4694 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4697 impl Clone for CVec_UpdateAddHTLCZ {
4698 fn clone(&self) -> Self {
4699 let mut res = Vec::new();
4700 if self.datalen == 0 { return Self::from(res); }
4701 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4706 pub struct CVec_UpdateFulfillHTLCZ {
4707 pub data: *mut crate::ln::msgs::UpdateFulfillHTLC,
4710 impl CVec_UpdateFulfillHTLCZ {
4711 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateFulfillHTLC> {
4712 if self.datalen == 0 { return Vec::new(); }
4713 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4714 self.data = std::ptr::null_mut();
4718 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateFulfillHTLC] {
4719 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4722 impl From<Vec<crate::ln::msgs::UpdateFulfillHTLC>> for CVec_UpdateFulfillHTLCZ {
4723 fn from(v: Vec<crate::ln::msgs::UpdateFulfillHTLC>) -> Self {
4724 let datalen = v.len();
4725 let data = Box::into_raw(v.into_boxed_slice());
4726 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4730 pub extern "C" fn CVec_UpdateFulfillHTLCZ_free(_res: CVec_UpdateFulfillHTLCZ) { }
4731 impl Drop for CVec_UpdateFulfillHTLCZ {
4732 fn drop(&mut self) {
4733 if self.datalen == 0 { return; }
4734 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4737 impl Clone for CVec_UpdateFulfillHTLCZ {
4738 fn clone(&self) -> Self {
4739 let mut res = Vec::new();
4740 if self.datalen == 0 { return Self::from(res); }
4741 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4746 pub struct CVec_UpdateFailHTLCZ {
4747 pub data: *mut crate::ln::msgs::UpdateFailHTLC,
4750 impl CVec_UpdateFailHTLCZ {
4751 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateFailHTLC> {
4752 if self.datalen == 0 { return Vec::new(); }
4753 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4754 self.data = std::ptr::null_mut();
4758 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateFailHTLC] {
4759 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4762 impl From<Vec<crate::ln::msgs::UpdateFailHTLC>> for CVec_UpdateFailHTLCZ {
4763 fn from(v: Vec<crate::ln::msgs::UpdateFailHTLC>) -> Self {
4764 let datalen = v.len();
4765 let data = Box::into_raw(v.into_boxed_slice());
4766 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4770 pub extern "C" fn CVec_UpdateFailHTLCZ_free(_res: CVec_UpdateFailHTLCZ) { }
4771 impl Drop for CVec_UpdateFailHTLCZ {
4772 fn drop(&mut self) {
4773 if self.datalen == 0 { return; }
4774 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4777 impl Clone for CVec_UpdateFailHTLCZ {
4778 fn clone(&self) -> Self {
4779 let mut res = Vec::new();
4780 if self.datalen == 0 { return Self::from(res); }
4781 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4786 pub struct CVec_UpdateFailMalformedHTLCZ {
4787 pub data: *mut crate::ln::msgs::UpdateFailMalformedHTLC,
4790 impl CVec_UpdateFailMalformedHTLCZ {
4791 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateFailMalformedHTLC> {
4792 if self.datalen == 0 { return Vec::new(); }
4793 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4794 self.data = std::ptr::null_mut();
4798 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateFailMalformedHTLC] {
4799 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4802 impl From<Vec<crate::ln::msgs::UpdateFailMalformedHTLC>> for CVec_UpdateFailMalformedHTLCZ {
4803 fn from(v: Vec<crate::ln::msgs::UpdateFailMalformedHTLC>) -> Self {
4804 let datalen = v.len();
4805 let data = Box::into_raw(v.into_boxed_slice());
4806 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4810 pub extern "C" fn CVec_UpdateFailMalformedHTLCZ_free(_res: CVec_UpdateFailMalformedHTLCZ) { }
4811 impl Drop for CVec_UpdateFailMalformedHTLCZ {
4812 fn drop(&mut self) {
4813 if self.datalen == 0 { return; }
4814 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4817 impl Clone for CVec_UpdateFailMalformedHTLCZ {
4818 fn clone(&self) -> Self {
4819 let mut res = Vec::new();
4820 if self.datalen == 0 { return Self::from(res); }
4821 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4826 pub union CResult_AcceptChannelDecodeErrorZPtr {
4827 pub result: *mut crate::ln::msgs::AcceptChannel,
4828 pub err: *mut crate::ln::msgs::DecodeError,
4831 pub struct CResult_AcceptChannelDecodeErrorZ {
4832 pub contents: CResult_AcceptChannelDecodeErrorZPtr,
4833 pub result_ok: bool,
4836 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_ok(o: crate::ln::msgs::AcceptChannel) -> CResult_AcceptChannelDecodeErrorZ {
4837 CResult_AcceptChannelDecodeErrorZ {
4838 contents: CResult_AcceptChannelDecodeErrorZPtr {
4839 result: Box::into_raw(Box::new(o)),
4845 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_AcceptChannelDecodeErrorZ {
4846 CResult_AcceptChannelDecodeErrorZ {
4847 contents: CResult_AcceptChannelDecodeErrorZPtr {
4848 err: Box::into_raw(Box::new(e)),
4854 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_free(_res: CResult_AcceptChannelDecodeErrorZ) { }
4855 impl Drop for CResult_AcceptChannelDecodeErrorZ {
4856 fn drop(&mut self) {
4858 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4859 let _ = unsafe { Box::from_raw(self.contents.result) };
4862 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4863 let _ = unsafe { Box::from_raw(self.contents.err) };
4868 impl From<crate::c_types::CResultTempl<crate::ln::msgs::AcceptChannel, crate::ln::msgs::DecodeError>> for CResult_AcceptChannelDecodeErrorZ {
4869 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::AcceptChannel, crate::ln::msgs::DecodeError>) -> Self {
4870 let contents = if o.result_ok {
4871 let result = unsafe { o.contents.result };
4872 unsafe { o.contents.result = std::ptr::null_mut() };
4873 CResult_AcceptChannelDecodeErrorZPtr { result }
4875 let err = unsafe { o.contents.err };
4876 unsafe { o.contents.err = std::ptr::null_mut(); }
4877 CResult_AcceptChannelDecodeErrorZPtr { err }
4881 result_ok: o.result_ok,
4885 impl Clone for CResult_AcceptChannelDecodeErrorZ {
4886 fn clone(&self) -> Self {
4888 Self { result_ok: true, contents: CResult_AcceptChannelDecodeErrorZPtr {
4889 result: Box::into_raw(Box::new(<crate::ln::msgs::AcceptChannel>::clone(unsafe { &*self.contents.result })))
4892 Self { result_ok: false, contents: CResult_AcceptChannelDecodeErrorZPtr {
4893 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4899 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_clone(orig: &CResult_AcceptChannelDecodeErrorZ) -> CResult_AcceptChannelDecodeErrorZ { orig.clone() }
4901 pub union CResult_AnnouncementSignaturesDecodeErrorZPtr {
4902 pub result: *mut crate::ln::msgs::AnnouncementSignatures,
4903 pub err: *mut crate::ln::msgs::DecodeError,
4906 pub struct CResult_AnnouncementSignaturesDecodeErrorZ {
4907 pub contents: CResult_AnnouncementSignaturesDecodeErrorZPtr,
4908 pub result_ok: bool,
4911 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_ok(o: crate::ln::msgs::AnnouncementSignatures) -> CResult_AnnouncementSignaturesDecodeErrorZ {
4912 CResult_AnnouncementSignaturesDecodeErrorZ {
4913 contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4914 result: Box::into_raw(Box::new(o)),
4920 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_AnnouncementSignaturesDecodeErrorZ {
4921 CResult_AnnouncementSignaturesDecodeErrorZ {
4922 contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4923 err: Box::into_raw(Box::new(e)),
4929 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_free(_res: CResult_AnnouncementSignaturesDecodeErrorZ) { }
4930 impl Drop for CResult_AnnouncementSignaturesDecodeErrorZ {
4931 fn drop(&mut self) {
4933 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4934 let _ = unsafe { Box::from_raw(self.contents.result) };
4937 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4938 let _ = unsafe { Box::from_raw(self.contents.err) };
4943 impl From<crate::c_types::CResultTempl<crate::ln::msgs::AnnouncementSignatures, crate::ln::msgs::DecodeError>> for CResult_AnnouncementSignaturesDecodeErrorZ {
4944 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::AnnouncementSignatures, crate::ln::msgs::DecodeError>) -> Self {
4945 let contents = if o.result_ok {
4946 let result = unsafe { o.contents.result };
4947 unsafe { o.contents.result = std::ptr::null_mut() };
4948 CResult_AnnouncementSignaturesDecodeErrorZPtr { result }
4950 let err = unsafe { o.contents.err };
4951 unsafe { o.contents.err = std::ptr::null_mut(); }
4952 CResult_AnnouncementSignaturesDecodeErrorZPtr { err }
4956 result_ok: o.result_ok,
4960 impl Clone for CResult_AnnouncementSignaturesDecodeErrorZ {
4961 fn clone(&self) -> Self {
4963 Self { result_ok: true, contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4964 result: Box::into_raw(Box::new(<crate::ln::msgs::AnnouncementSignatures>::clone(unsafe { &*self.contents.result })))
4967 Self { result_ok: false, contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4968 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4974 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig: &CResult_AnnouncementSignaturesDecodeErrorZ) -> CResult_AnnouncementSignaturesDecodeErrorZ { orig.clone() }
4976 pub union CResult_ChannelReestablishDecodeErrorZPtr {
4977 pub result: *mut crate::ln::msgs::ChannelReestablish,
4978 pub err: *mut crate::ln::msgs::DecodeError,
4981 pub struct CResult_ChannelReestablishDecodeErrorZ {
4982 pub contents: CResult_ChannelReestablishDecodeErrorZPtr,
4983 pub result_ok: bool,
4986 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_ok(o: crate::ln::msgs::ChannelReestablish) -> CResult_ChannelReestablishDecodeErrorZ {
4987 CResult_ChannelReestablishDecodeErrorZ {
4988 contents: CResult_ChannelReestablishDecodeErrorZPtr {
4989 result: Box::into_raw(Box::new(o)),
4995 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelReestablishDecodeErrorZ {
4996 CResult_ChannelReestablishDecodeErrorZ {
4997 contents: CResult_ChannelReestablishDecodeErrorZPtr {
4998 err: Box::into_raw(Box::new(e)),
5004 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_free(_res: CResult_ChannelReestablishDecodeErrorZ) { }
5005 impl Drop for CResult_ChannelReestablishDecodeErrorZ {
5006 fn drop(&mut self) {
5008 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5009 let _ = unsafe { Box::from_raw(self.contents.result) };
5012 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5013 let _ = unsafe { Box::from_raw(self.contents.err) };
5018 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ChannelReestablish, crate::ln::msgs::DecodeError>> for CResult_ChannelReestablishDecodeErrorZ {
5019 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ChannelReestablish, crate::ln::msgs::DecodeError>) -> Self {
5020 let contents = if o.result_ok {
5021 let result = unsafe { o.contents.result };
5022 unsafe { o.contents.result = std::ptr::null_mut() };
5023 CResult_ChannelReestablishDecodeErrorZPtr { result }
5025 let err = unsafe { o.contents.err };
5026 unsafe { o.contents.err = std::ptr::null_mut(); }
5027 CResult_ChannelReestablishDecodeErrorZPtr { err }
5031 result_ok: o.result_ok,
5035 impl Clone for CResult_ChannelReestablishDecodeErrorZ {
5036 fn clone(&self) -> Self {
5038 Self { result_ok: true, contents: CResult_ChannelReestablishDecodeErrorZPtr {
5039 result: Box::into_raw(Box::new(<crate::ln::msgs::ChannelReestablish>::clone(unsafe { &*self.contents.result })))
5042 Self { result_ok: false, contents: CResult_ChannelReestablishDecodeErrorZPtr {
5043 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5049 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_clone(orig: &CResult_ChannelReestablishDecodeErrorZ) -> CResult_ChannelReestablishDecodeErrorZ { orig.clone() }
5051 pub union CResult_ClosingSignedDecodeErrorZPtr {
5052 pub result: *mut crate::ln::msgs::ClosingSigned,
5053 pub err: *mut crate::ln::msgs::DecodeError,
5056 pub struct CResult_ClosingSignedDecodeErrorZ {
5057 pub contents: CResult_ClosingSignedDecodeErrorZPtr,
5058 pub result_ok: bool,
5061 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_ok(o: crate::ln::msgs::ClosingSigned) -> CResult_ClosingSignedDecodeErrorZ {
5062 CResult_ClosingSignedDecodeErrorZ {
5063 contents: CResult_ClosingSignedDecodeErrorZPtr {
5064 result: Box::into_raw(Box::new(o)),
5070 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ClosingSignedDecodeErrorZ {
5071 CResult_ClosingSignedDecodeErrorZ {
5072 contents: CResult_ClosingSignedDecodeErrorZPtr {
5073 err: Box::into_raw(Box::new(e)),
5079 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_free(_res: CResult_ClosingSignedDecodeErrorZ) { }
5080 impl Drop for CResult_ClosingSignedDecodeErrorZ {
5081 fn drop(&mut self) {
5083 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5084 let _ = unsafe { Box::from_raw(self.contents.result) };
5087 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5088 let _ = unsafe { Box::from_raw(self.contents.err) };
5093 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ClosingSigned, crate::ln::msgs::DecodeError>> for CResult_ClosingSignedDecodeErrorZ {
5094 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ClosingSigned, crate::ln::msgs::DecodeError>) -> Self {
5095 let contents = if o.result_ok {
5096 let result = unsafe { o.contents.result };
5097 unsafe { o.contents.result = std::ptr::null_mut() };
5098 CResult_ClosingSignedDecodeErrorZPtr { result }
5100 let err = unsafe { o.contents.err };
5101 unsafe { o.contents.err = std::ptr::null_mut(); }
5102 CResult_ClosingSignedDecodeErrorZPtr { err }
5106 result_ok: o.result_ok,
5110 impl Clone for CResult_ClosingSignedDecodeErrorZ {
5111 fn clone(&self) -> Self {
5113 Self { result_ok: true, contents: CResult_ClosingSignedDecodeErrorZPtr {
5114 result: Box::into_raw(Box::new(<crate::ln::msgs::ClosingSigned>::clone(unsafe { &*self.contents.result })))
5117 Self { result_ok: false, contents: CResult_ClosingSignedDecodeErrorZPtr {
5118 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5124 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_clone(orig: &CResult_ClosingSignedDecodeErrorZ) -> CResult_ClosingSignedDecodeErrorZ { orig.clone() }
5126 pub union CResult_CommitmentSignedDecodeErrorZPtr {
5127 pub result: *mut crate::ln::msgs::CommitmentSigned,
5128 pub err: *mut crate::ln::msgs::DecodeError,
5131 pub struct CResult_CommitmentSignedDecodeErrorZ {
5132 pub contents: CResult_CommitmentSignedDecodeErrorZPtr,
5133 pub result_ok: bool,
5136 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_ok(o: crate::ln::msgs::CommitmentSigned) -> CResult_CommitmentSignedDecodeErrorZ {
5137 CResult_CommitmentSignedDecodeErrorZ {
5138 contents: CResult_CommitmentSignedDecodeErrorZPtr {
5139 result: Box::into_raw(Box::new(o)),
5145 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CommitmentSignedDecodeErrorZ {
5146 CResult_CommitmentSignedDecodeErrorZ {
5147 contents: CResult_CommitmentSignedDecodeErrorZPtr {
5148 err: Box::into_raw(Box::new(e)),
5154 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_free(_res: CResult_CommitmentSignedDecodeErrorZ) { }
5155 impl Drop for CResult_CommitmentSignedDecodeErrorZ {
5156 fn drop(&mut self) {
5158 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5159 let _ = unsafe { Box::from_raw(self.contents.result) };
5162 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5163 let _ = unsafe { Box::from_raw(self.contents.err) };
5168 impl From<crate::c_types::CResultTempl<crate::ln::msgs::CommitmentSigned, crate::ln::msgs::DecodeError>> for CResult_CommitmentSignedDecodeErrorZ {
5169 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::CommitmentSigned, crate::ln::msgs::DecodeError>) -> Self {
5170 let contents = if o.result_ok {
5171 let result = unsafe { o.contents.result };
5172 unsafe { o.contents.result = std::ptr::null_mut() };
5173 CResult_CommitmentSignedDecodeErrorZPtr { result }
5175 let err = unsafe { o.contents.err };
5176 unsafe { o.contents.err = std::ptr::null_mut(); }
5177 CResult_CommitmentSignedDecodeErrorZPtr { err }
5181 result_ok: o.result_ok,
5185 impl Clone for CResult_CommitmentSignedDecodeErrorZ {
5186 fn clone(&self) -> Self {
5188 Self { result_ok: true, contents: CResult_CommitmentSignedDecodeErrorZPtr {
5189 result: Box::into_raw(Box::new(<crate::ln::msgs::CommitmentSigned>::clone(unsafe { &*self.contents.result })))
5192 Self { result_ok: false, contents: CResult_CommitmentSignedDecodeErrorZPtr {
5193 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5199 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_clone(orig: &CResult_CommitmentSignedDecodeErrorZ) -> CResult_CommitmentSignedDecodeErrorZ { orig.clone() }
5201 pub union CResult_FundingCreatedDecodeErrorZPtr {
5202 pub result: *mut crate::ln::msgs::FundingCreated,
5203 pub err: *mut crate::ln::msgs::DecodeError,
5206 pub struct CResult_FundingCreatedDecodeErrorZ {
5207 pub contents: CResult_FundingCreatedDecodeErrorZPtr,
5208 pub result_ok: bool,
5211 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_ok(o: crate::ln::msgs::FundingCreated) -> CResult_FundingCreatedDecodeErrorZ {
5212 CResult_FundingCreatedDecodeErrorZ {
5213 contents: CResult_FundingCreatedDecodeErrorZPtr {
5214 result: Box::into_raw(Box::new(o)),
5220 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingCreatedDecodeErrorZ {
5221 CResult_FundingCreatedDecodeErrorZ {
5222 contents: CResult_FundingCreatedDecodeErrorZPtr {
5223 err: Box::into_raw(Box::new(e)),
5229 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_free(_res: CResult_FundingCreatedDecodeErrorZ) { }
5230 impl Drop for CResult_FundingCreatedDecodeErrorZ {
5231 fn drop(&mut self) {
5233 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5234 let _ = unsafe { Box::from_raw(self.contents.result) };
5237 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5238 let _ = unsafe { Box::from_raw(self.contents.err) };
5243 impl From<crate::c_types::CResultTempl<crate::ln::msgs::FundingCreated, crate::ln::msgs::DecodeError>> for CResult_FundingCreatedDecodeErrorZ {
5244 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::FundingCreated, crate::ln::msgs::DecodeError>) -> Self {
5245 let contents = if o.result_ok {
5246 let result = unsafe { o.contents.result };
5247 unsafe { o.contents.result = std::ptr::null_mut() };
5248 CResult_FundingCreatedDecodeErrorZPtr { result }
5250 let err = unsafe { o.contents.err };
5251 unsafe { o.contents.err = std::ptr::null_mut(); }
5252 CResult_FundingCreatedDecodeErrorZPtr { err }
5256 result_ok: o.result_ok,
5260 impl Clone for CResult_FundingCreatedDecodeErrorZ {
5261 fn clone(&self) -> Self {
5263 Self { result_ok: true, contents: CResult_FundingCreatedDecodeErrorZPtr {
5264 result: Box::into_raw(Box::new(<crate::ln::msgs::FundingCreated>::clone(unsafe { &*self.contents.result })))
5267 Self { result_ok: false, contents: CResult_FundingCreatedDecodeErrorZPtr {
5268 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5274 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_clone(orig: &CResult_FundingCreatedDecodeErrorZ) -> CResult_FundingCreatedDecodeErrorZ { orig.clone() }
5276 pub union CResult_FundingSignedDecodeErrorZPtr {
5277 pub result: *mut crate::ln::msgs::FundingSigned,
5278 pub err: *mut crate::ln::msgs::DecodeError,
5281 pub struct CResult_FundingSignedDecodeErrorZ {
5282 pub contents: CResult_FundingSignedDecodeErrorZPtr,
5283 pub result_ok: bool,
5286 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_ok(o: crate::ln::msgs::FundingSigned) -> CResult_FundingSignedDecodeErrorZ {
5287 CResult_FundingSignedDecodeErrorZ {
5288 contents: CResult_FundingSignedDecodeErrorZPtr {
5289 result: Box::into_raw(Box::new(o)),
5295 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingSignedDecodeErrorZ {
5296 CResult_FundingSignedDecodeErrorZ {
5297 contents: CResult_FundingSignedDecodeErrorZPtr {
5298 err: Box::into_raw(Box::new(e)),
5304 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_free(_res: CResult_FundingSignedDecodeErrorZ) { }
5305 impl Drop for CResult_FundingSignedDecodeErrorZ {
5306 fn drop(&mut self) {
5308 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5309 let _ = unsafe { Box::from_raw(self.contents.result) };
5312 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5313 let _ = unsafe { Box::from_raw(self.contents.err) };
5318 impl From<crate::c_types::CResultTempl<crate::ln::msgs::FundingSigned, crate::ln::msgs::DecodeError>> for CResult_FundingSignedDecodeErrorZ {
5319 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::FundingSigned, crate::ln::msgs::DecodeError>) -> Self {
5320 let contents = if o.result_ok {
5321 let result = unsafe { o.contents.result };
5322 unsafe { o.contents.result = std::ptr::null_mut() };
5323 CResult_FundingSignedDecodeErrorZPtr { result }
5325 let err = unsafe { o.contents.err };
5326 unsafe { o.contents.err = std::ptr::null_mut(); }
5327 CResult_FundingSignedDecodeErrorZPtr { err }
5331 result_ok: o.result_ok,
5335 impl Clone for CResult_FundingSignedDecodeErrorZ {
5336 fn clone(&self) -> Self {
5338 Self { result_ok: true, contents: CResult_FundingSignedDecodeErrorZPtr {
5339 result: Box::into_raw(Box::new(<crate::ln::msgs::FundingSigned>::clone(unsafe { &*self.contents.result })))
5342 Self { result_ok: false, contents: CResult_FundingSignedDecodeErrorZPtr {
5343 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5349 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_clone(orig: &CResult_FundingSignedDecodeErrorZ) -> CResult_FundingSignedDecodeErrorZ { orig.clone() }
5351 pub union CResult_FundingLockedDecodeErrorZPtr {
5352 pub result: *mut crate::ln::msgs::FundingLocked,
5353 pub err: *mut crate::ln::msgs::DecodeError,
5356 pub struct CResult_FundingLockedDecodeErrorZ {
5357 pub contents: CResult_FundingLockedDecodeErrorZPtr,
5358 pub result_ok: bool,
5361 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_ok(o: crate::ln::msgs::FundingLocked) -> CResult_FundingLockedDecodeErrorZ {
5362 CResult_FundingLockedDecodeErrorZ {
5363 contents: CResult_FundingLockedDecodeErrorZPtr {
5364 result: Box::into_raw(Box::new(o)),
5370 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingLockedDecodeErrorZ {
5371 CResult_FundingLockedDecodeErrorZ {
5372 contents: CResult_FundingLockedDecodeErrorZPtr {
5373 err: Box::into_raw(Box::new(e)),
5379 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_free(_res: CResult_FundingLockedDecodeErrorZ) { }
5380 impl Drop for CResult_FundingLockedDecodeErrorZ {
5381 fn drop(&mut self) {
5383 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5384 let _ = unsafe { Box::from_raw(self.contents.result) };
5387 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5388 let _ = unsafe { Box::from_raw(self.contents.err) };
5393 impl From<crate::c_types::CResultTempl<crate::ln::msgs::FundingLocked, crate::ln::msgs::DecodeError>> for CResult_FundingLockedDecodeErrorZ {
5394 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::FundingLocked, crate::ln::msgs::DecodeError>) -> Self {
5395 let contents = if o.result_ok {
5396 let result = unsafe { o.contents.result };
5397 unsafe { o.contents.result = std::ptr::null_mut() };
5398 CResult_FundingLockedDecodeErrorZPtr { result }
5400 let err = unsafe { o.contents.err };
5401 unsafe { o.contents.err = std::ptr::null_mut(); }
5402 CResult_FundingLockedDecodeErrorZPtr { err }
5406 result_ok: o.result_ok,
5410 impl Clone for CResult_FundingLockedDecodeErrorZ {
5411 fn clone(&self) -> Self {
5413 Self { result_ok: true, contents: CResult_FundingLockedDecodeErrorZPtr {
5414 result: Box::into_raw(Box::new(<crate::ln::msgs::FundingLocked>::clone(unsafe { &*self.contents.result })))
5417 Self { result_ok: false, contents: CResult_FundingLockedDecodeErrorZPtr {
5418 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5424 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_clone(orig: &CResult_FundingLockedDecodeErrorZ) -> CResult_FundingLockedDecodeErrorZ { orig.clone() }
5426 pub union CResult_InitDecodeErrorZPtr {
5427 pub result: *mut crate::ln::msgs::Init,
5428 pub err: *mut crate::ln::msgs::DecodeError,
5431 pub struct CResult_InitDecodeErrorZ {
5432 pub contents: CResult_InitDecodeErrorZPtr,
5433 pub result_ok: bool,
5436 pub extern "C" fn CResult_InitDecodeErrorZ_ok(o: crate::ln::msgs::Init) -> CResult_InitDecodeErrorZ {
5437 CResult_InitDecodeErrorZ {
5438 contents: CResult_InitDecodeErrorZPtr {
5439 result: Box::into_raw(Box::new(o)),
5445 pub extern "C" fn CResult_InitDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InitDecodeErrorZ {
5446 CResult_InitDecodeErrorZ {
5447 contents: CResult_InitDecodeErrorZPtr {
5448 err: Box::into_raw(Box::new(e)),
5454 pub extern "C" fn CResult_InitDecodeErrorZ_free(_res: CResult_InitDecodeErrorZ) { }
5455 impl Drop for CResult_InitDecodeErrorZ {
5456 fn drop(&mut self) {
5458 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5459 let _ = unsafe { Box::from_raw(self.contents.result) };
5462 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5463 let _ = unsafe { Box::from_raw(self.contents.err) };
5468 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Init, crate::ln::msgs::DecodeError>> for CResult_InitDecodeErrorZ {
5469 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Init, crate::ln::msgs::DecodeError>) -> Self {
5470 let contents = if o.result_ok {
5471 let result = unsafe { o.contents.result };
5472 unsafe { o.contents.result = std::ptr::null_mut() };
5473 CResult_InitDecodeErrorZPtr { result }
5475 let err = unsafe { o.contents.err };
5476 unsafe { o.contents.err = std::ptr::null_mut(); }
5477 CResult_InitDecodeErrorZPtr { err }
5481 result_ok: o.result_ok,
5485 impl Clone for CResult_InitDecodeErrorZ {
5486 fn clone(&self) -> Self {
5488 Self { result_ok: true, contents: CResult_InitDecodeErrorZPtr {
5489 result: Box::into_raw(Box::new(<crate::ln::msgs::Init>::clone(unsafe { &*self.contents.result })))
5492 Self { result_ok: false, contents: CResult_InitDecodeErrorZPtr {
5493 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5499 pub extern "C" fn CResult_InitDecodeErrorZ_clone(orig: &CResult_InitDecodeErrorZ) -> CResult_InitDecodeErrorZ { orig.clone() }
5501 pub union CResult_OpenChannelDecodeErrorZPtr {
5502 pub result: *mut crate::ln::msgs::OpenChannel,
5503 pub err: *mut crate::ln::msgs::DecodeError,
5506 pub struct CResult_OpenChannelDecodeErrorZ {
5507 pub contents: CResult_OpenChannelDecodeErrorZPtr,
5508 pub result_ok: bool,
5511 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_ok(o: crate::ln::msgs::OpenChannel) -> CResult_OpenChannelDecodeErrorZ {
5512 CResult_OpenChannelDecodeErrorZ {
5513 contents: CResult_OpenChannelDecodeErrorZPtr {
5514 result: Box::into_raw(Box::new(o)),
5520 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_OpenChannelDecodeErrorZ {
5521 CResult_OpenChannelDecodeErrorZ {
5522 contents: CResult_OpenChannelDecodeErrorZPtr {
5523 err: Box::into_raw(Box::new(e)),
5529 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_free(_res: CResult_OpenChannelDecodeErrorZ) { }
5530 impl Drop for CResult_OpenChannelDecodeErrorZ {
5531 fn drop(&mut self) {
5533 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5534 let _ = unsafe { Box::from_raw(self.contents.result) };
5537 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5538 let _ = unsafe { Box::from_raw(self.contents.err) };
5543 impl From<crate::c_types::CResultTempl<crate::ln::msgs::OpenChannel, crate::ln::msgs::DecodeError>> for CResult_OpenChannelDecodeErrorZ {
5544 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::OpenChannel, crate::ln::msgs::DecodeError>) -> Self {
5545 let contents = if o.result_ok {
5546 let result = unsafe { o.contents.result };
5547 unsafe { o.contents.result = std::ptr::null_mut() };
5548 CResult_OpenChannelDecodeErrorZPtr { result }
5550 let err = unsafe { o.contents.err };
5551 unsafe { o.contents.err = std::ptr::null_mut(); }
5552 CResult_OpenChannelDecodeErrorZPtr { err }
5556 result_ok: o.result_ok,
5560 impl Clone for CResult_OpenChannelDecodeErrorZ {
5561 fn clone(&self) -> Self {
5563 Self { result_ok: true, contents: CResult_OpenChannelDecodeErrorZPtr {
5564 result: Box::into_raw(Box::new(<crate::ln::msgs::OpenChannel>::clone(unsafe { &*self.contents.result })))
5567 Self { result_ok: false, contents: CResult_OpenChannelDecodeErrorZPtr {
5568 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5574 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_clone(orig: &CResult_OpenChannelDecodeErrorZ) -> CResult_OpenChannelDecodeErrorZ { orig.clone() }
5576 pub union CResult_RevokeAndACKDecodeErrorZPtr {
5577 pub result: *mut crate::ln::msgs::RevokeAndACK,
5578 pub err: *mut crate::ln::msgs::DecodeError,
5581 pub struct CResult_RevokeAndACKDecodeErrorZ {
5582 pub contents: CResult_RevokeAndACKDecodeErrorZPtr,
5583 pub result_ok: bool,
5586 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_ok(o: crate::ln::msgs::RevokeAndACK) -> CResult_RevokeAndACKDecodeErrorZ {
5587 CResult_RevokeAndACKDecodeErrorZ {
5588 contents: CResult_RevokeAndACKDecodeErrorZPtr {
5589 result: Box::into_raw(Box::new(o)),
5595 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RevokeAndACKDecodeErrorZ {
5596 CResult_RevokeAndACKDecodeErrorZ {
5597 contents: CResult_RevokeAndACKDecodeErrorZPtr {
5598 err: Box::into_raw(Box::new(e)),
5604 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_free(_res: CResult_RevokeAndACKDecodeErrorZ) { }
5605 impl Drop for CResult_RevokeAndACKDecodeErrorZ {
5606 fn drop(&mut self) {
5608 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5609 let _ = unsafe { Box::from_raw(self.contents.result) };
5612 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5613 let _ = unsafe { Box::from_raw(self.contents.err) };
5618 impl From<crate::c_types::CResultTempl<crate::ln::msgs::RevokeAndACK, crate::ln::msgs::DecodeError>> for CResult_RevokeAndACKDecodeErrorZ {
5619 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::RevokeAndACK, crate::ln::msgs::DecodeError>) -> Self {
5620 let contents = if o.result_ok {
5621 let result = unsafe { o.contents.result };
5622 unsafe { o.contents.result = std::ptr::null_mut() };
5623 CResult_RevokeAndACKDecodeErrorZPtr { result }
5625 let err = unsafe { o.contents.err };
5626 unsafe { o.contents.err = std::ptr::null_mut(); }
5627 CResult_RevokeAndACKDecodeErrorZPtr { err }
5631 result_ok: o.result_ok,
5635 impl Clone for CResult_RevokeAndACKDecodeErrorZ {
5636 fn clone(&self) -> Self {
5638 Self { result_ok: true, contents: CResult_RevokeAndACKDecodeErrorZPtr {
5639 result: Box::into_raw(Box::new(<crate::ln::msgs::RevokeAndACK>::clone(unsafe { &*self.contents.result })))
5642 Self { result_ok: false, contents: CResult_RevokeAndACKDecodeErrorZPtr {
5643 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5649 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_clone(orig: &CResult_RevokeAndACKDecodeErrorZ) -> CResult_RevokeAndACKDecodeErrorZ { orig.clone() }
5651 pub union CResult_ShutdownDecodeErrorZPtr {
5652 pub result: *mut crate::ln::msgs::Shutdown,
5653 pub err: *mut crate::ln::msgs::DecodeError,
5656 pub struct CResult_ShutdownDecodeErrorZ {
5657 pub contents: CResult_ShutdownDecodeErrorZPtr,
5658 pub result_ok: bool,
5661 pub extern "C" fn CResult_ShutdownDecodeErrorZ_ok(o: crate::ln::msgs::Shutdown) -> CResult_ShutdownDecodeErrorZ {
5662 CResult_ShutdownDecodeErrorZ {
5663 contents: CResult_ShutdownDecodeErrorZPtr {
5664 result: Box::into_raw(Box::new(o)),
5670 pub extern "C" fn CResult_ShutdownDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ShutdownDecodeErrorZ {
5671 CResult_ShutdownDecodeErrorZ {
5672 contents: CResult_ShutdownDecodeErrorZPtr {
5673 err: Box::into_raw(Box::new(e)),
5679 pub extern "C" fn CResult_ShutdownDecodeErrorZ_free(_res: CResult_ShutdownDecodeErrorZ) { }
5680 impl Drop for CResult_ShutdownDecodeErrorZ {
5681 fn drop(&mut self) {
5683 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5684 let _ = unsafe { Box::from_raw(self.contents.result) };
5687 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5688 let _ = unsafe { Box::from_raw(self.contents.err) };
5693 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Shutdown, crate::ln::msgs::DecodeError>> for CResult_ShutdownDecodeErrorZ {
5694 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Shutdown, crate::ln::msgs::DecodeError>) -> Self {
5695 let contents = if o.result_ok {
5696 let result = unsafe { o.contents.result };
5697 unsafe { o.contents.result = std::ptr::null_mut() };
5698 CResult_ShutdownDecodeErrorZPtr { result }
5700 let err = unsafe { o.contents.err };
5701 unsafe { o.contents.err = std::ptr::null_mut(); }
5702 CResult_ShutdownDecodeErrorZPtr { err }
5706 result_ok: o.result_ok,
5710 impl Clone for CResult_ShutdownDecodeErrorZ {
5711 fn clone(&self) -> Self {
5713 Self { result_ok: true, contents: CResult_ShutdownDecodeErrorZPtr {
5714 result: Box::into_raw(Box::new(<crate::ln::msgs::Shutdown>::clone(unsafe { &*self.contents.result })))
5717 Self { result_ok: false, contents: CResult_ShutdownDecodeErrorZPtr {
5718 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5724 pub extern "C" fn CResult_ShutdownDecodeErrorZ_clone(orig: &CResult_ShutdownDecodeErrorZ) -> CResult_ShutdownDecodeErrorZ { orig.clone() }
5726 pub union CResult_UpdateFailHTLCDecodeErrorZPtr {
5727 pub result: *mut crate::ln::msgs::UpdateFailHTLC,
5728 pub err: *mut crate::ln::msgs::DecodeError,
5731 pub struct CResult_UpdateFailHTLCDecodeErrorZ {
5732 pub contents: CResult_UpdateFailHTLCDecodeErrorZPtr,
5733 pub result_ok: bool,
5736 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFailHTLC) -> CResult_UpdateFailHTLCDecodeErrorZ {
5737 CResult_UpdateFailHTLCDecodeErrorZ {
5738 contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5739 result: Box::into_raw(Box::new(o)),
5745 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFailHTLCDecodeErrorZ {
5746 CResult_UpdateFailHTLCDecodeErrorZ {
5747 contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5748 err: Box::into_raw(Box::new(e)),
5754 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_free(_res: CResult_UpdateFailHTLCDecodeErrorZ) { }
5755 impl Drop for CResult_UpdateFailHTLCDecodeErrorZ {
5756 fn drop(&mut self) {
5758 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5759 let _ = unsafe { Box::from_raw(self.contents.result) };
5762 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5763 let _ = unsafe { Box::from_raw(self.contents.err) };
5768 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateFailHTLCDecodeErrorZ {
5769 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailHTLC, crate::ln::msgs::DecodeError>) -> Self {
5770 let contents = if o.result_ok {
5771 let result = unsafe { o.contents.result };
5772 unsafe { o.contents.result = std::ptr::null_mut() };
5773 CResult_UpdateFailHTLCDecodeErrorZPtr { result }
5775 let err = unsafe { o.contents.err };
5776 unsafe { o.contents.err = std::ptr::null_mut(); }
5777 CResult_UpdateFailHTLCDecodeErrorZPtr { err }
5781 result_ok: o.result_ok,
5785 impl Clone for CResult_UpdateFailHTLCDecodeErrorZ {
5786 fn clone(&self) -> Self {
5788 Self { result_ok: true, contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5789 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFailHTLC>::clone(unsafe { &*self.contents.result })))
5792 Self { result_ok: false, contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5793 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5799 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFailHTLCDecodeErrorZ) -> CResult_UpdateFailHTLCDecodeErrorZ { orig.clone() }
5801 pub union CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5802 pub result: *mut crate::ln::msgs::UpdateFailMalformedHTLC,
5803 pub err: *mut crate::ln::msgs::DecodeError,
5806 pub struct CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5807 pub contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr,
5808 pub result_ok: bool,
5811 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFailMalformedHTLC) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5812 CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5813 contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5814 result: Box::into_raw(Box::new(o)),
5820 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5821 CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5822 contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5823 err: Box::into_raw(Box::new(e)),
5829 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res: CResult_UpdateFailMalformedHTLCDecodeErrorZ) { }
5830 impl Drop for CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5831 fn drop(&mut self) {
5833 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5834 let _ = unsafe { Box::from_raw(self.contents.result) };
5837 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5838 let _ = unsafe { Box::from_raw(self.contents.err) };
5843 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailMalformedHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5844 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailMalformedHTLC, crate::ln::msgs::DecodeError>) -> Self {
5845 let contents = if o.result_ok {
5846 let result = unsafe { o.contents.result };
5847 unsafe { o.contents.result = std::ptr::null_mut() };
5848 CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { result }
5850 let err = unsafe { o.contents.err };
5851 unsafe { o.contents.err = std::ptr::null_mut(); }
5852 CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { err }
5856 result_ok: o.result_ok,
5860 impl Clone for CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5861 fn clone(&self) -> Self {
5863 Self { result_ok: true, contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5864 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFailMalformedHTLC>::clone(unsafe { &*self.contents.result })))
5867 Self { result_ok: false, contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5868 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5874 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFailMalformedHTLCDecodeErrorZ) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ { orig.clone() }
5876 pub union CResult_UpdateFeeDecodeErrorZPtr {
5877 pub result: *mut crate::ln::msgs::UpdateFee,
5878 pub err: *mut crate::ln::msgs::DecodeError,
5881 pub struct CResult_UpdateFeeDecodeErrorZ {
5882 pub contents: CResult_UpdateFeeDecodeErrorZPtr,
5883 pub result_ok: bool,
5886 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFee) -> CResult_UpdateFeeDecodeErrorZ {
5887 CResult_UpdateFeeDecodeErrorZ {
5888 contents: CResult_UpdateFeeDecodeErrorZPtr {
5889 result: Box::into_raw(Box::new(o)),
5895 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFeeDecodeErrorZ {
5896 CResult_UpdateFeeDecodeErrorZ {
5897 contents: CResult_UpdateFeeDecodeErrorZPtr {
5898 err: Box::into_raw(Box::new(e)),
5904 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_free(_res: CResult_UpdateFeeDecodeErrorZ) { }
5905 impl Drop for CResult_UpdateFeeDecodeErrorZ {
5906 fn drop(&mut self) {
5908 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5909 let _ = unsafe { Box::from_raw(self.contents.result) };
5912 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5913 let _ = unsafe { Box::from_raw(self.contents.err) };
5918 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFee, crate::ln::msgs::DecodeError>> for CResult_UpdateFeeDecodeErrorZ {
5919 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFee, crate::ln::msgs::DecodeError>) -> Self {
5920 let contents = if o.result_ok {
5921 let result = unsafe { o.contents.result };
5922 unsafe { o.contents.result = std::ptr::null_mut() };
5923 CResult_UpdateFeeDecodeErrorZPtr { result }
5925 let err = unsafe { o.contents.err };
5926 unsafe { o.contents.err = std::ptr::null_mut(); }
5927 CResult_UpdateFeeDecodeErrorZPtr { err }
5931 result_ok: o.result_ok,
5935 impl Clone for CResult_UpdateFeeDecodeErrorZ {
5936 fn clone(&self) -> Self {
5938 Self { result_ok: true, contents: CResult_UpdateFeeDecodeErrorZPtr {
5939 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFee>::clone(unsafe { &*self.contents.result })))
5942 Self { result_ok: false, contents: CResult_UpdateFeeDecodeErrorZPtr {
5943 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5949 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_clone(orig: &CResult_UpdateFeeDecodeErrorZ) -> CResult_UpdateFeeDecodeErrorZ { orig.clone() }
5951 pub union CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5952 pub result: *mut crate::ln::msgs::UpdateFulfillHTLC,
5953 pub err: *mut crate::ln::msgs::DecodeError,
5956 pub struct CResult_UpdateFulfillHTLCDecodeErrorZ {
5957 pub contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr,
5958 pub result_ok: bool,
5961 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFulfillHTLC) -> CResult_UpdateFulfillHTLCDecodeErrorZ {
5962 CResult_UpdateFulfillHTLCDecodeErrorZ {
5963 contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5964 result: Box::into_raw(Box::new(o)),
5970 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFulfillHTLCDecodeErrorZ {
5971 CResult_UpdateFulfillHTLCDecodeErrorZ {
5972 contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5973 err: Box::into_raw(Box::new(e)),
5979 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res: CResult_UpdateFulfillHTLCDecodeErrorZ) { }
5980 impl Drop for CResult_UpdateFulfillHTLCDecodeErrorZ {
5981 fn drop(&mut self) {
5983 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5984 let _ = unsafe { Box::from_raw(self.contents.result) };
5987 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5988 let _ = unsafe { Box::from_raw(self.contents.err) };
5993 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFulfillHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateFulfillHTLCDecodeErrorZ {
5994 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFulfillHTLC, crate::ln::msgs::DecodeError>) -> Self {
5995 let contents = if o.result_ok {
5996 let result = unsafe { o.contents.result };
5997 unsafe { o.contents.result = std::ptr::null_mut() };
5998 CResult_UpdateFulfillHTLCDecodeErrorZPtr { result }
6000 let err = unsafe { o.contents.err };
6001 unsafe { o.contents.err = std::ptr::null_mut(); }
6002 CResult_UpdateFulfillHTLCDecodeErrorZPtr { err }
6006 result_ok: o.result_ok,
6010 impl Clone for CResult_UpdateFulfillHTLCDecodeErrorZ {
6011 fn clone(&self) -> Self {
6013 Self { result_ok: true, contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
6014 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFulfillHTLC>::clone(unsafe { &*self.contents.result })))
6017 Self { result_ok: false, contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
6018 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6024 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFulfillHTLCDecodeErrorZ) -> CResult_UpdateFulfillHTLCDecodeErrorZ { orig.clone() }
6026 pub union CResult_UpdateAddHTLCDecodeErrorZPtr {
6027 pub result: *mut crate::ln::msgs::UpdateAddHTLC,
6028 pub err: *mut crate::ln::msgs::DecodeError,
6031 pub struct CResult_UpdateAddHTLCDecodeErrorZ {
6032 pub contents: CResult_UpdateAddHTLCDecodeErrorZPtr,
6033 pub result_ok: bool,
6036 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateAddHTLC) -> CResult_UpdateAddHTLCDecodeErrorZ {
6037 CResult_UpdateAddHTLCDecodeErrorZ {
6038 contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
6039 result: Box::into_raw(Box::new(o)),
6045 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateAddHTLCDecodeErrorZ {
6046 CResult_UpdateAddHTLCDecodeErrorZ {
6047 contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
6048 err: Box::into_raw(Box::new(e)),
6054 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_free(_res: CResult_UpdateAddHTLCDecodeErrorZ) { }
6055 impl Drop for CResult_UpdateAddHTLCDecodeErrorZ {
6056 fn drop(&mut self) {
6058 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6059 let _ = unsafe { Box::from_raw(self.contents.result) };
6062 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6063 let _ = unsafe { Box::from_raw(self.contents.err) };
6068 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateAddHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateAddHTLCDecodeErrorZ {
6069 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateAddHTLC, crate::ln::msgs::DecodeError>) -> Self {
6070 let contents = if o.result_ok {
6071 let result = unsafe { o.contents.result };
6072 unsafe { o.contents.result = std::ptr::null_mut() };
6073 CResult_UpdateAddHTLCDecodeErrorZPtr { result }
6075 let err = unsafe { o.contents.err };
6076 unsafe { o.contents.err = std::ptr::null_mut(); }
6077 CResult_UpdateAddHTLCDecodeErrorZPtr { err }
6081 result_ok: o.result_ok,
6085 impl Clone for CResult_UpdateAddHTLCDecodeErrorZ {
6086 fn clone(&self) -> Self {
6088 Self { result_ok: true, contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
6089 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateAddHTLC>::clone(unsafe { &*self.contents.result })))
6092 Self { result_ok: false, contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
6093 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6099 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_clone(orig: &CResult_UpdateAddHTLCDecodeErrorZ) -> CResult_UpdateAddHTLCDecodeErrorZ { orig.clone() }
6101 pub union CResult_PingDecodeErrorZPtr {
6102 pub result: *mut crate::ln::msgs::Ping,
6103 pub err: *mut crate::ln::msgs::DecodeError,
6106 pub struct CResult_PingDecodeErrorZ {
6107 pub contents: CResult_PingDecodeErrorZPtr,
6108 pub result_ok: bool,
6111 pub extern "C" fn CResult_PingDecodeErrorZ_ok(o: crate::ln::msgs::Ping) -> CResult_PingDecodeErrorZ {
6112 CResult_PingDecodeErrorZ {
6113 contents: CResult_PingDecodeErrorZPtr {
6114 result: Box::into_raw(Box::new(o)),
6120 pub extern "C" fn CResult_PingDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_PingDecodeErrorZ {
6121 CResult_PingDecodeErrorZ {
6122 contents: CResult_PingDecodeErrorZPtr {
6123 err: Box::into_raw(Box::new(e)),
6129 pub extern "C" fn CResult_PingDecodeErrorZ_free(_res: CResult_PingDecodeErrorZ) { }
6130 impl Drop for CResult_PingDecodeErrorZ {
6131 fn drop(&mut self) {
6133 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6134 let _ = unsafe { Box::from_raw(self.contents.result) };
6137 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6138 let _ = unsafe { Box::from_raw(self.contents.err) };
6143 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Ping, crate::ln::msgs::DecodeError>> for CResult_PingDecodeErrorZ {
6144 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Ping, crate::ln::msgs::DecodeError>) -> Self {
6145 let contents = if o.result_ok {
6146 let result = unsafe { o.contents.result };
6147 unsafe { o.contents.result = std::ptr::null_mut() };
6148 CResult_PingDecodeErrorZPtr { result }
6150 let err = unsafe { o.contents.err };
6151 unsafe { o.contents.err = std::ptr::null_mut(); }
6152 CResult_PingDecodeErrorZPtr { err }
6156 result_ok: o.result_ok,
6160 impl Clone for CResult_PingDecodeErrorZ {
6161 fn clone(&self) -> Self {
6163 Self { result_ok: true, contents: CResult_PingDecodeErrorZPtr {
6164 result: Box::into_raw(Box::new(<crate::ln::msgs::Ping>::clone(unsafe { &*self.contents.result })))
6167 Self { result_ok: false, contents: CResult_PingDecodeErrorZPtr {
6168 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6174 pub extern "C" fn CResult_PingDecodeErrorZ_clone(orig: &CResult_PingDecodeErrorZ) -> CResult_PingDecodeErrorZ { orig.clone() }
6176 pub union CResult_PongDecodeErrorZPtr {
6177 pub result: *mut crate::ln::msgs::Pong,
6178 pub err: *mut crate::ln::msgs::DecodeError,
6181 pub struct CResult_PongDecodeErrorZ {
6182 pub contents: CResult_PongDecodeErrorZPtr,
6183 pub result_ok: bool,
6186 pub extern "C" fn CResult_PongDecodeErrorZ_ok(o: crate::ln::msgs::Pong) -> CResult_PongDecodeErrorZ {
6187 CResult_PongDecodeErrorZ {
6188 contents: CResult_PongDecodeErrorZPtr {
6189 result: Box::into_raw(Box::new(o)),
6195 pub extern "C" fn CResult_PongDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_PongDecodeErrorZ {
6196 CResult_PongDecodeErrorZ {
6197 contents: CResult_PongDecodeErrorZPtr {
6198 err: Box::into_raw(Box::new(e)),
6204 pub extern "C" fn CResult_PongDecodeErrorZ_free(_res: CResult_PongDecodeErrorZ) { }
6205 impl Drop for CResult_PongDecodeErrorZ {
6206 fn drop(&mut self) {
6208 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6209 let _ = unsafe { Box::from_raw(self.contents.result) };
6212 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6213 let _ = unsafe { Box::from_raw(self.contents.err) };
6218 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Pong, crate::ln::msgs::DecodeError>> for CResult_PongDecodeErrorZ {
6219 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Pong, crate::ln::msgs::DecodeError>) -> Self {
6220 let contents = if o.result_ok {
6221 let result = unsafe { o.contents.result };
6222 unsafe { o.contents.result = std::ptr::null_mut() };
6223 CResult_PongDecodeErrorZPtr { result }
6225 let err = unsafe { o.contents.err };
6226 unsafe { o.contents.err = std::ptr::null_mut(); }
6227 CResult_PongDecodeErrorZPtr { err }
6231 result_ok: o.result_ok,
6235 impl Clone for CResult_PongDecodeErrorZ {
6236 fn clone(&self) -> Self {
6238 Self { result_ok: true, contents: CResult_PongDecodeErrorZPtr {
6239 result: Box::into_raw(Box::new(<crate::ln::msgs::Pong>::clone(unsafe { &*self.contents.result })))
6242 Self { result_ok: false, contents: CResult_PongDecodeErrorZPtr {
6243 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6249 pub extern "C" fn CResult_PongDecodeErrorZ_clone(orig: &CResult_PongDecodeErrorZ) -> CResult_PongDecodeErrorZ { orig.clone() }
6251 pub union CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6252 pub result: *mut crate::ln::msgs::UnsignedChannelAnnouncement,
6253 pub err: *mut crate::ln::msgs::DecodeError,
6256 pub struct CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6257 pub contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr,
6258 pub result_ok: bool,
6261 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedChannelAnnouncement) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6262 CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6263 contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6264 result: Box::into_raw(Box::new(o)),
6270 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6271 CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6272 contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6273 err: Box::into_raw(Box::new(e)),
6279 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res: CResult_UnsignedChannelAnnouncementDecodeErrorZ) { }
6280 impl Drop for CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6281 fn drop(&mut self) {
6283 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6284 let _ = unsafe { Box::from_raw(self.contents.result) };
6287 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6288 let _ = unsafe { Box::from_raw(self.contents.err) };
6293 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelAnnouncement, crate::ln::msgs::DecodeError>> for CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6294 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6295 let contents = if o.result_ok {
6296 let result = unsafe { o.contents.result };
6297 unsafe { o.contents.result = std::ptr::null_mut() };
6298 CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { result }
6300 let err = unsafe { o.contents.err };
6301 unsafe { o.contents.err = std::ptr::null_mut(); }
6302 CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { err }
6306 result_ok: o.result_ok,
6310 impl Clone for CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6311 fn clone(&self) -> Self {
6313 Self { result_ok: true, contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6314 result: Box::into_raw(Box::new(<crate::ln::msgs::UnsignedChannelAnnouncement>::clone(unsafe { &*self.contents.result })))
6317 Self { result_ok: false, contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6318 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6324 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig: &CResult_UnsignedChannelAnnouncementDecodeErrorZ) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ { orig.clone() }
6326 pub union CResult_ChannelAnnouncementDecodeErrorZPtr {
6327 pub result: *mut crate::ln::msgs::ChannelAnnouncement,
6328 pub err: *mut crate::ln::msgs::DecodeError,
6331 pub struct CResult_ChannelAnnouncementDecodeErrorZ {
6332 pub contents: CResult_ChannelAnnouncementDecodeErrorZPtr,
6333 pub result_ok: bool,
6336 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::ChannelAnnouncement) -> CResult_ChannelAnnouncementDecodeErrorZ {
6337 CResult_ChannelAnnouncementDecodeErrorZ {
6338 contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6339 result: Box::into_raw(Box::new(o)),
6345 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelAnnouncementDecodeErrorZ {
6346 CResult_ChannelAnnouncementDecodeErrorZ {
6347 contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6348 err: Box::into_raw(Box::new(e)),
6354 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_free(_res: CResult_ChannelAnnouncementDecodeErrorZ) { }
6355 impl Drop for CResult_ChannelAnnouncementDecodeErrorZ {
6356 fn drop(&mut self) {
6358 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6359 let _ = unsafe { Box::from_raw(self.contents.result) };
6362 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6363 let _ = unsafe { Box::from_raw(self.contents.err) };
6368 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::DecodeError>> for CResult_ChannelAnnouncementDecodeErrorZ {
6369 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6370 let contents = if o.result_ok {
6371 let result = unsafe { o.contents.result };
6372 unsafe { o.contents.result = std::ptr::null_mut() };
6373 CResult_ChannelAnnouncementDecodeErrorZPtr { result }
6375 let err = unsafe { o.contents.err };
6376 unsafe { o.contents.err = std::ptr::null_mut(); }
6377 CResult_ChannelAnnouncementDecodeErrorZPtr { err }
6381 result_ok: o.result_ok,
6385 impl Clone for CResult_ChannelAnnouncementDecodeErrorZ {
6386 fn clone(&self) -> Self {
6388 Self { result_ok: true, contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6389 result: Box::into_raw(Box::new(<crate::ln::msgs::ChannelAnnouncement>::clone(unsafe { &*self.contents.result })))
6392 Self { result_ok: false, contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6393 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6399 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_clone(orig: &CResult_ChannelAnnouncementDecodeErrorZ) -> CResult_ChannelAnnouncementDecodeErrorZ { orig.clone() }
6401 pub union CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6402 pub result: *mut crate::ln::msgs::UnsignedChannelUpdate,
6403 pub err: *mut crate::ln::msgs::DecodeError,
6406 pub struct CResult_UnsignedChannelUpdateDecodeErrorZ {
6407 pub contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr,
6408 pub result_ok: bool,
6411 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedChannelUpdate) -> CResult_UnsignedChannelUpdateDecodeErrorZ {
6412 CResult_UnsignedChannelUpdateDecodeErrorZ {
6413 contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6414 result: Box::into_raw(Box::new(o)),
6420 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedChannelUpdateDecodeErrorZ {
6421 CResult_UnsignedChannelUpdateDecodeErrorZ {
6422 contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6423 err: Box::into_raw(Box::new(e)),
6429 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res: CResult_UnsignedChannelUpdateDecodeErrorZ) { }
6430 impl Drop for CResult_UnsignedChannelUpdateDecodeErrorZ {
6431 fn drop(&mut self) {
6433 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6434 let _ = unsafe { Box::from_raw(self.contents.result) };
6437 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6438 let _ = unsafe { Box::from_raw(self.contents.err) };
6443 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelUpdate, crate::ln::msgs::DecodeError>> for CResult_UnsignedChannelUpdateDecodeErrorZ {
6444 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelUpdate, crate::ln::msgs::DecodeError>) -> Self {
6445 let contents = if o.result_ok {
6446 let result = unsafe { o.contents.result };
6447 unsafe { o.contents.result = std::ptr::null_mut() };
6448 CResult_UnsignedChannelUpdateDecodeErrorZPtr { result }
6450 let err = unsafe { o.contents.err };
6451 unsafe { o.contents.err = std::ptr::null_mut(); }
6452 CResult_UnsignedChannelUpdateDecodeErrorZPtr { err }
6456 result_ok: o.result_ok,
6460 impl Clone for CResult_UnsignedChannelUpdateDecodeErrorZ {
6461 fn clone(&self) -> Self {
6463 Self { result_ok: true, contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6464 result: Box::into_raw(Box::new(<crate::ln::msgs::UnsignedChannelUpdate>::clone(unsafe { &*self.contents.result })))
6467 Self { result_ok: false, contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6468 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6474 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig: &CResult_UnsignedChannelUpdateDecodeErrorZ) -> CResult_UnsignedChannelUpdateDecodeErrorZ { orig.clone() }
6476 pub union CResult_ChannelUpdateDecodeErrorZPtr {
6477 pub result: *mut crate::ln::msgs::ChannelUpdate,
6478 pub err: *mut crate::ln::msgs::DecodeError,
6481 pub struct CResult_ChannelUpdateDecodeErrorZ {
6482 pub contents: CResult_ChannelUpdateDecodeErrorZPtr,
6483 pub result_ok: bool,
6486 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_ok(o: crate::ln::msgs::ChannelUpdate) -> CResult_ChannelUpdateDecodeErrorZ {
6487 CResult_ChannelUpdateDecodeErrorZ {
6488 contents: CResult_ChannelUpdateDecodeErrorZPtr {
6489 result: Box::into_raw(Box::new(o)),
6495 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelUpdateDecodeErrorZ {
6496 CResult_ChannelUpdateDecodeErrorZ {
6497 contents: CResult_ChannelUpdateDecodeErrorZPtr {
6498 err: Box::into_raw(Box::new(e)),
6504 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_free(_res: CResult_ChannelUpdateDecodeErrorZ) { }
6505 impl Drop for CResult_ChannelUpdateDecodeErrorZ {
6506 fn drop(&mut self) {
6508 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6509 let _ = unsafe { Box::from_raw(self.contents.result) };
6512 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6513 let _ = unsafe { Box::from_raw(self.contents.err) };
6518 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ChannelUpdate, crate::ln::msgs::DecodeError>> for CResult_ChannelUpdateDecodeErrorZ {
6519 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ChannelUpdate, crate::ln::msgs::DecodeError>) -> Self {
6520 let contents = if o.result_ok {
6521 let result = unsafe { o.contents.result };
6522 unsafe { o.contents.result = std::ptr::null_mut() };
6523 CResult_ChannelUpdateDecodeErrorZPtr { result }
6525 let err = unsafe { o.contents.err };
6526 unsafe { o.contents.err = std::ptr::null_mut(); }
6527 CResult_ChannelUpdateDecodeErrorZPtr { err }
6531 result_ok: o.result_ok,
6535 impl Clone for CResult_ChannelUpdateDecodeErrorZ {
6536 fn clone(&self) -> Self {
6538 Self { result_ok: true, contents: CResult_ChannelUpdateDecodeErrorZPtr {
6539 result: Box::into_raw(Box::new(<crate::ln::msgs::ChannelUpdate>::clone(unsafe { &*self.contents.result })))
6542 Self { result_ok: false, contents: CResult_ChannelUpdateDecodeErrorZPtr {
6543 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6549 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_clone(orig: &CResult_ChannelUpdateDecodeErrorZ) -> CResult_ChannelUpdateDecodeErrorZ { orig.clone() }
6551 pub union CResult_ErrorMessageDecodeErrorZPtr {
6552 pub result: *mut crate::ln::msgs::ErrorMessage,
6553 pub err: *mut crate::ln::msgs::DecodeError,
6556 pub struct CResult_ErrorMessageDecodeErrorZ {
6557 pub contents: CResult_ErrorMessageDecodeErrorZPtr,
6558 pub result_ok: bool,
6561 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_ok(o: crate::ln::msgs::ErrorMessage) -> CResult_ErrorMessageDecodeErrorZ {
6562 CResult_ErrorMessageDecodeErrorZ {
6563 contents: CResult_ErrorMessageDecodeErrorZPtr {
6564 result: Box::into_raw(Box::new(o)),
6570 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ErrorMessageDecodeErrorZ {
6571 CResult_ErrorMessageDecodeErrorZ {
6572 contents: CResult_ErrorMessageDecodeErrorZPtr {
6573 err: Box::into_raw(Box::new(e)),
6579 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_free(_res: CResult_ErrorMessageDecodeErrorZ) { }
6580 impl Drop for CResult_ErrorMessageDecodeErrorZ {
6581 fn drop(&mut self) {
6583 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6584 let _ = unsafe { Box::from_raw(self.contents.result) };
6587 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6588 let _ = unsafe { Box::from_raw(self.contents.err) };
6593 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ErrorMessage, crate::ln::msgs::DecodeError>> for CResult_ErrorMessageDecodeErrorZ {
6594 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ErrorMessage, crate::ln::msgs::DecodeError>) -> Self {
6595 let contents = if o.result_ok {
6596 let result = unsafe { o.contents.result };
6597 unsafe { o.contents.result = std::ptr::null_mut() };
6598 CResult_ErrorMessageDecodeErrorZPtr { result }
6600 let err = unsafe { o.contents.err };
6601 unsafe { o.contents.err = std::ptr::null_mut(); }
6602 CResult_ErrorMessageDecodeErrorZPtr { err }
6606 result_ok: o.result_ok,
6610 impl Clone for CResult_ErrorMessageDecodeErrorZ {
6611 fn clone(&self) -> Self {
6613 Self { result_ok: true, contents: CResult_ErrorMessageDecodeErrorZPtr {
6614 result: Box::into_raw(Box::new(<crate::ln::msgs::ErrorMessage>::clone(unsafe { &*self.contents.result })))
6617 Self { result_ok: false, contents: CResult_ErrorMessageDecodeErrorZPtr {
6618 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6624 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_clone(orig: &CResult_ErrorMessageDecodeErrorZ) -> CResult_ErrorMessageDecodeErrorZ { orig.clone() }
6626 pub union CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6627 pub result: *mut crate::ln::msgs::UnsignedNodeAnnouncement,
6628 pub err: *mut crate::ln::msgs::DecodeError,
6631 pub struct CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6632 pub contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr,
6633 pub result_ok: bool,
6636 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedNodeAnnouncement) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6637 CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6638 contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6639 result: Box::into_raw(Box::new(o)),
6645 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6646 CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6647 contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6648 err: Box::into_raw(Box::new(e)),
6654 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res: CResult_UnsignedNodeAnnouncementDecodeErrorZ) { }
6655 impl Drop for CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6656 fn drop(&mut self) {
6658 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6659 let _ = unsafe { Box::from_raw(self.contents.result) };
6662 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6663 let _ = unsafe { Box::from_raw(self.contents.err) };
6668 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UnsignedNodeAnnouncement, crate::ln::msgs::DecodeError>> for CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6669 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UnsignedNodeAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6670 let contents = if o.result_ok {
6671 let result = unsafe { o.contents.result };
6672 unsafe { o.contents.result = std::ptr::null_mut() };
6673 CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { result }
6675 let err = unsafe { o.contents.err };
6676 unsafe { o.contents.err = std::ptr::null_mut(); }
6677 CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { err }
6681 result_ok: o.result_ok,
6685 impl Clone for CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6686 fn clone(&self) -> Self {
6688 Self { result_ok: true, contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6689 result: Box::into_raw(Box::new(<crate::ln::msgs::UnsignedNodeAnnouncement>::clone(unsafe { &*self.contents.result })))
6692 Self { result_ok: false, contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6693 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6699 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig: &CResult_UnsignedNodeAnnouncementDecodeErrorZ) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ { orig.clone() }
6701 pub union CResult_NodeAnnouncementDecodeErrorZPtr {
6702 pub result: *mut crate::ln::msgs::NodeAnnouncement,
6703 pub err: *mut crate::ln::msgs::DecodeError,
6706 pub struct CResult_NodeAnnouncementDecodeErrorZ {
6707 pub contents: CResult_NodeAnnouncementDecodeErrorZPtr,
6708 pub result_ok: bool,
6711 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::NodeAnnouncement) -> CResult_NodeAnnouncementDecodeErrorZ {
6712 CResult_NodeAnnouncementDecodeErrorZ {
6713 contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6714 result: Box::into_raw(Box::new(o)),
6720 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeAnnouncementDecodeErrorZ {
6721 CResult_NodeAnnouncementDecodeErrorZ {
6722 contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6723 err: Box::into_raw(Box::new(e)),
6729 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_free(_res: CResult_NodeAnnouncementDecodeErrorZ) { }
6730 impl Drop for CResult_NodeAnnouncementDecodeErrorZ {
6731 fn drop(&mut self) {
6733 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6734 let _ = unsafe { Box::from_raw(self.contents.result) };
6737 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6738 let _ = unsafe { Box::from_raw(self.contents.err) };
6743 impl From<crate::c_types::CResultTempl<crate::ln::msgs::NodeAnnouncement, crate::ln::msgs::DecodeError>> for CResult_NodeAnnouncementDecodeErrorZ {
6744 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::NodeAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6745 let contents = if o.result_ok {
6746 let result = unsafe { o.contents.result };
6747 unsafe { o.contents.result = std::ptr::null_mut() };
6748 CResult_NodeAnnouncementDecodeErrorZPtr { result }
6750 let err = unsafe { o.contents.err };
6751 unsafe { o.contents.err = std::ptr::null_mut(); }
6752 CResult_NodeAnnouncementDecodeErrorZPtr { err }
6756 result_ok: o.result_ok,
6760 impl Clone for CResult_NodeAnnouncementDecodeErrorZ {
6761 fn clone(&self) -> Self {
6763 Self { result_ok: true, contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6764 result: Box::into_raw(Box::new(<crate::ln::msgs::NodeAnnouncement>::clone(unsafe { &*self.contents.result })))
6767 Self { result_ok: false, contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6768 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6774 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_clone(orig: &CResult_NodeAnnouncementDecodeErrorZ) -> CResult_NodeAnnouncementDecodeErrorZ { orig.clone() }
6776 pub union CResult_QueryShortChannelIdsDecodeErrorZPtr {
6777 pub result: *mut crate::ln::msgs::QueryShortChannelIds,
6778 pub err: *mut crate::ln::msgs::DecodeError,
6781 pub struct CResult_QueryShortChannelIdsDecodeErrorZ {
6782 pub contents: CResult_QueryShortChannelIdsDecodeErrorZPtr,
6783 pub result_ok: bool,
6786 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_ok(o: crate::ln::msgs::QueryShortChannelIds) -> CResult_QueryShortChannelIdsDecodeErrorZ {
6787 CResult_QueryShortChannelIdsDecodeErrorZ {
6788 contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6789 result: Box::into_raw(Box::new(o)),
6795 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_QueryShortChannelIdsDecodeErrorZ {
6796 CResult_QueryShortChannelIdsDecodeErrorZ {
6797 contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6798 err: Box::into_raw(Box::new(e)),
6804 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_free(_res: CResult_QueryShortChannelIdsDecodeErrorZ) { }
6805 impl Drop for CResult_QueryShortChannelIdsDecodeErrorZ {
6806 fn drop(&mut self) {
6808 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6809 let _ = unsafe { Box::from_raw(self.contents.result) };
6812 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6813 let _ = unsafe { Box::from_raw(self.contents.err) };
6818 impl From<crate::c_types::CResultTempl<crate::ln::msgs::QueryShortChannelIds, crate::ln::msgs::DecodeError>> for CResult_QueryShortChannelIdsDecodeErrorZ {
6819 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::QueryShortChannelIds, crate::ln::msgs::DecodeError>) -> Self {
6820 let contents = if o.result_ok {
6821 let result = unsafe { o.contents.result };
6822 unsafe { o.contents.result = std::ptr::null_mut() };
6823 CResult_QueryShortChannelIdsDecodeErrorZPtr { result }
6825 let err = unsafe { o.contents.err };
6826 unsafe { o.contents.err = std::ptr::null_mut(); }
6827 CResult_QueryShortChannelIdsDecodeErrorZPtr { err }
6831 result_ok: o.result_ok,
6835 impl Clone for CResult_QueryShortChannelIdsDecodeErrorZ {
6836 fn clone(&self) -> Self {
6838 Self { result_ok: true, contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6839 result: Box::into_raw(Box::new(<crate::ln::msgs::QueryShortChannelIds>::clone(unsafe { &*self.contents.result })))
6842 Self { result_ok: false, contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6843 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6849 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig: &CResult_QueryShortChannelIdsDecodeErrorZ) -> CResult_QueryShortChannelIdsDecodeErrorZ { orig.clone() }
6851 pub union CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6852 pub result: *mut crate::ln::msgs::ReplyShortChannelIdsEnd,
6853 pub err: *mut crate::ln::msgs::DecodeError,
6856 pub struct CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6857 pub contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr,
6858 pub result_ok: bool,
6861 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o: crate::ln::msgs::ReplyShortChannelIdsEnd) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6862 CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6863 contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6864 result: Box::into_raw(Box::new(o)),
6870 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6871 CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6872 contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6873 err: Box::into_raw(Box::new(e)),
6879 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res: CResult_ReplyShortChannelIdsEndDecodeErrorZ) { }
6880 impl Drop for CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6881 fn drop(&mut self) {
6883 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6884 let _ = unsafe { Box::from_raw(self.contents.result) };
6887 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6888 let _ = unsafe { Box::from_raw(self.contents.err) };
6893 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ReplyShortChannelIdsEnd, crate::ln::msgs::DecodeError>> for CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6894 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ReplyShortChannelIdsEnd, crate::ln::msgs::DecodeError>) -> Self {
6895 let contents = if o.result_ok {
6896 let result = unsafe { o.contents.result };
6897 unsafe { o.contents.result = std::ptr::null_mut() };
6898 CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { result }
6900 let err = unsafe { o.contents.err };
6901 unsafe { o.contents.err = std::ptr::null_mut(); }
6902 CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { err }
6906 result_ok: o.result_ok,
6910 impl Clone for CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6911 fn clone(&self) -> Self {
6913 Self { result_ok: true, contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6914 result: Box::into_raw(Box::new(<crate::ln::msgs::ReplyShortChannelIdsEnd>::clone(unsafe { &*self.contents.result })))
6917 Self { result_ok: false, contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6918 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6924 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig: &CResult_ReplyShortChannelIdsEndDecodeErrorZ) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ { orig.clone() }
6926 pub union CResult_QueryChannelRangeDecodeErrorZPtr {
6927 pub result: *mut crate::ln::msgs::QueryChannelRange,
6928 pub err: *mut crate::ln::msgs::DecodeError,
6931 pub struct CResult_QueryChannelRangeDecodeErrorZ {
6932 pub contents: CResult_QueryChannelRangeDecodeErrorZPtr,
6933 pub result_ok: bool,
6936 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_ok(o: crate::ln::msgs::QueryChannelRange) -> CResult_QueryChannelRangeDecodeErrorZ {
6937 CResult_QueryChannelRangeDecodeErrorZ {
6938 contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6939 result: Box::into_raw(Box::new(o)),
6945 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_QueryChannelRangeDecodeErrorZ {
6946 CResult_QueryChannelRangeDecodeErrorZ {
6947 contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6948 err: Box::into_raw(Box::new(e)),
6954 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_free(_res: CResult_QueryChannelRangeDecodeErrorZ) { }
6955 impl Drop for CResult_QueryChannelRangeDecodeErrorZ {
6956 fn drop(&mut self) {
6958 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6959 let _ = unsafe { Box::from_raw(self.contents.result) };
6962 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6963 let _ = unsafe { Box::from_raw(self.contents.err) };
6968 impl From<crate::c_types::CResultTempl<crate::ln::msgs::QueryChannelRange, crate::ln::msgs::DecodeError>> for CResult_QueryChannelRangeDecodeErrorZ {
6969 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::QueryChannelRange, crate::ln::msgs::DecodeError>) -> Self {
6970 let contents = if o.result_ok {
6971 let result = unsafe { o.contents.result };
6972 unsafe { o.contents.result = std::ptr::null_mut() };
6973 CResult_QueryChannelRangeDecodeErrorZPtr { result }
6975 let err = unsafe { o.contents.err };
6976 unsafe { o.contents.err = std::ptr::null_mut(); }
6977 CResult_QueryChannelRangeDecodeErrorZPtr { err }
6981 result_ok: o.result_ok,
6985 impl Clone for CResult_QueryChannelRangeDecodeErrorZ {
6986 fn clone(&self) -> Self {
6988 Self { result_ok: true, contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6989 result: Box::into_raw(Box::new(<crate::ln::msgs::QueryChannelRange>::clone(unsafe { &*self.contents.result })))
6992 Self { result_ok: false, contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6993 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6999 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_clone(orig: &CResult_QueryChannelRangeDecodeErrorZ) -> CResult_QueryChannelRangeDecodeErrorZ { orig.clone() }
7001 pub union CResult_ReplyChannelRangeDecodeErrorZPtr {
7002 pub result: *mut crate::ln::msgs::ReplyChannelRange,
7003 pub err: *mut crate::ln::msgs::DecodeError,
7006 pub struct CResult_ReplyChannelRangeDecodeErrorZ {
7007 pub contents: CResult_ReplyChannelRangeDecodeErrorZPtr,
7008 pub result_ok: bool,
7011 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_ok(o: crate::ln::msgs::ReplyChannelRange) -> CResult_ReplyChannelRangeDecodeErrorZ {
7012 CResult_ReplyChannelRangeDecodeErrorZ {
7013 contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
7014 result: Box::into_raw(Box::new(o)),
7020 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ReplyChannelRangeDecodeErrorZ {
7021 CResult_ReplyChannelRangeDecodeErrorZ {
7022 contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
7023 err: Box::into_raw(Box::new(e)),
7029 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_free(_res: CResult_ReplyChannelRangeDecodeErrorZ) { }
7030 impl Drop for CResult_ReplyChannelRangeDecodeErrorZ {
7031 fn drop(&mut self) {
7033 if unsafe { !(self.contents.result as *mut ()).is_null() } {
7034 let _ = unsafe { Box::from_raw(self.contents.result) };
7037 if unsafe { !(self.contents.err as *mut ()).is_null() } {
7038 let _ = unsafe { Box::from_raw(self.contents.err) };
7043 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ReplyChannelRange, crate::ln::msgs::DecodeError>> for CResult_ReplyChannelRangeDecodeErrorZ {
7044 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ReplyChannelRange, crate::ln::msgs::DecodeError>) -> Self {
7045 let contents = if o.result_ok {
7046 let result = unsafe { o.contents.result };
7047 unsafe { o.contents.result = std::ptr::null_mut() };
7048 CResult_ReplyChannelRangeDecodeErrorZPtr { result }
7050 let err = unsafe { o.contents.err };
7051 unsafe { o.contents.err = std::ptr::null_mut(); }
7052 CResult_ReplyChannelRangeDecodeErrorZPtr { err }
7056 result_ok: o.result_ok,
7060 impl Clone for CResult_ReplyChannelRangeDecodeErrorZ {
7061 fn clone(&self) -> Self {
7063 Self { result_ok: true, contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
7064 result: Box::into_raw(Box::new(<crate::ln::msgs::ReplyChannelRange>::clone(unsafe { &*self.contents.result })))
7067 Self { result_ok: false, contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
7068 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
7074 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_clone(orig: &CResult_ReplyChannelRangeDecodeErrorZ) -> CResult_ReplyChannelRangeDecodeErrorZ { orig.clone() }
7076 pub union CResult_GossipTimestampFilterDecodeErrorZPtr {
7077 pub result: *mut crate::ln::msgs::GossipTimestampFilter,
7078 pub err: *mut crate::ln::msgs::DecodeError,
7081 pub struct CResult_GossipTimestampFilterDecodeErrorZ {
7082 pub contents: CResult_GossipTimestampFilterDecodeErrorZPtr,
7083 pub result_ok: bool,
7086 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_ok(o: crate::ln::msgs::GossipTimestampFilter) -> CResult_GossipTimestampFilterDecodeErrorZ {
7087 CResult_GossipTimestampFilterDecodeErrorZ {
7088 contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
7089 result: Box::into_raw(Box::new(o)),
7095 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_GossipTimestampFilterDecodeErrorZ {
7096 CResult_GossipTimestampFilterDecodeErrorZ {
7097 contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
7098 err: Box::into_raw(Box::new(e)),
7104 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_free(_res: CResult_GossipTimestampFilterDecodeErrorZ) { }
7105 impl Drop for CResult_GossipTimestampFilterDecodeErrorZ {
7106 fn drop(&mut self) {
7108 if unsafe { !(self.contents.result as *mut ()).is_null() } {
7109 let _ = unsafe { Box::from_raw(self.contents.result) };
7112 if unsafe { !(self.contents.err as *mut ()).is_null() } {
7113 let _ = unsafe { Box::from_raw(self.contents.err) };
7118 impl From<crate::c_types::CResultTempl<crate::ln::msgs::GossipTimestampFilter, crate::ln::msgs::DecodeError>> for CResult_GossipTimestampFilterDecodeErrorZ {
7119 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::GossipTimestampFilter, crate::ln::msgs::DecodeError>) -> Self {
7120 let contents = if o.result_ok {
7121 let result = unsafe { o.contents.result };
7122 unsafe { o.contents.result = std::ptr::null_mut() };
7123 CResult_GossipTimestampFilterDecodeErrorZPtr { result }
7125 let err = unsafe { o.contents.err };
7126 unsafe { o.contents.err = std::ptr::null_mut(); }
7127 CResult_GossipTimestampFilterDecodeErrorZPtr { err }
7131 result_ok: o.result_ok,
7135 impl Clone for CResult_GossipTimestampFilterDecodeErrorZ {
7136 fn clone(&self) -> Self {
7138 Self { result_ok: true, contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
7139 result: Box::into_raw(Box::new(<crate::ln::msgs::GossipTimestampFilter>::clone(unsafe { &*self.contents.result })))
7142 Self { result_ok: false, contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
7143 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
7149 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_clone(orig: &CResult_GossipTimestampFilterDecodeErrorZ) -> CResult_GossipTimestampFilterDecodeErrorZ { orig.clone() }