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_PublicKeyZ {
954 pub data: *mut crate::c_types::PublicKey,
957 impl CVec_PublicKeyZ {
958 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::PublicKey> {
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::c_types::PublicKey] {
966 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
969 impl From<Vec<crate::c_types::PublicKey>> for CVec_PublicKeyZ {
970 fn from(v: Vec<crate::c_types::PublicKey>) -> 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_PublicKeyZ_free(_res: CVec_PublicKeyZ) { }
978 impl Drop for CVec_PublicKeyZ {
980 if self.datalen == 0 { return; }
981 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
985 pub struct CVec_u8Z {
990 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<u8> {
991 if self.datalen == 0 { return Vec::new(); }
992 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
993 self.data = std::ptr::null_mut();
997 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[u8] {
998 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
1001 impl From<Vec<u8>> for CVec_u8Z {
1002 fn from(v: Vec<u8>) -> Self {
1003 let datalen = v.len();
1004 let data = Box::into_raw(v.into_boxed_slice());
1005 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
1009 pub extern "C" fn CVec_u8Z_free(_res: CVec_u8Z) { }
1010 impl Drop for CVec_u8Z {
1011 fn drop(&mut self) {
1012 if self.datalen == 0 { return; }
1013 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
1016 impl Clone for CVec_u8Z {
1017 fn clone(&self) -> Self {
1018 let mut res = Vec::new();
1019 if self.datalen == 0 { return Self::from(res); }
1020 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
1025 pub union CResult_CVec_u8ZPeerHandleErrorZPtr {
1026 pub result: *mut crate::c_types::derived::CVec_u8Z,
1027 pub err: *mut crate::ln::peer_handler::PeerHandleError,
1030 pub struct CResult_CVec_u8ZPeerHandleErrorZ {
1031 pub contents: CResult_CVec_u8ZPeerHandleErrorZPtr,
1032 pub result_ok: bool,
1035 pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_ok(o: crate::c_types::derived::CVec_u8Z) -> CResult_CVec_u8ZPeerHandleErrorZ {
1036 CResult_CVec_u8ZPeerHandleErrorZ {
1037 contents: CResult_CVec_u8ZPeerHandleErrorZPtr {
1038 result: Box::into_raw(Box::new(o)),
1044 pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_CVec_u8ZPeerHandleErrorZ {
1045 CResult_CVec_u8ZPeerHandleErrorZ {
1046 contents: CResult_CVec_u8ZPeerHandleErrorZPtr {
1047 err: Box::into_raw(Box::new(e)),
1053 pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_free(_res: CResult_CVec_u8ZPeerHandleErrorZ) { }
1054 impl Drop for CResult_CVec_u8ZPeerHandleErrorZ {
1055 fn drop(&mut self) {
1057 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1058 let _ = unsafe { Box::from_raw(self.contents.result) };
1061 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1062 let _ = unsafe { Box::from_raw(self.contents.err) };
1067 impl From<crate::c_types::CResultTempl<crate::c_types::derived::CVec_u8Z, crate::ln::peer_handler::PeerHandleError>> for CResult_CVec_u8ZPeerHandleErrorZ {
1068 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CVec_u8Z, crate::ln::peer_handler::PeerHandleError>) -> Self {
1069 let contents = if o.result_ok {
1070 let result = unsafe { o.contents.result };
1071 unsafe { o.contents.result = std::ptr::null_mut() };
1072 CResult_CVec_u8ZPeerHandleErrorZPtr { result }
1074 let err = unsafe { o.contents.err };
1075 unsafe { o.contents.err = std::ptr::null_mut(); }
1076 CResult_CVec_u8ZPeerHandleErrorZPtr { err }
1080 result_ok: o.result_ok,
1084 impl Clone for CResult_CVec_u8ZPeerHandleErrorZ {
1085 fn clone(&self) -> Self {
1087 Self { result_ok: true, contents: CResult_CVec_u8ZPeerHandleErrorZPtr {
1088 result: Box::into_raw(Box::new(<crate::c_types::derived::CVec_u8Z>::clone(unsafe { &*self.contents.result })))
1091 Self { result_ok: false, contents: CResult_CVec_u8ZPeerHandleErrorZPtr {
1092 err: Box::into_raw(Box::new(<crate::ln::peer_handler::PeerHandleError>::clone(unsafe { &*self.contents.err })))
1098 pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_clone(orig: &CResult_CVec_u8ZPeerHandleErrorZ) -> CResult_CVec_u8ZPeerHandleErrorZ { orig.clone() }
1100 pub union CResult_NonePeerHandleErrorZPtr {
1101 /// Note that this value is always NULL, as there are no contents in the OK variant
1102 pub result: *mut std::ffi::c_void,
1103 pub err: *mut crate::ln::peer_handler::PeerHandleError,
1106 pub struct CResult_NonePeerHandleErrorZ {
1107 pub contents: CResult_NonePeerHandleErrorZPtr,
1108 pub result_ok: bool,
1111 pub extern "C" fn CResult_NonePeerHandleErrorZ_ok() -> CResult_NonePeerHandleErrorZ {
1112 CResult_NonePeerHandleErrorZ {
1113 contents: CResult_NonePeerHandleErrorZPtr {
1114 result: std::ptr::null_mut(),
1120 pub extern "C" fn CResult_NonePeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_NonePeerHandleErrorZ {
1121 CResult_NonePeerHandleErrorZ {
1122 contents: CResult_NonePeerHandleErrorZPtr {
1123 err: Box::into_raw(Box::new(e)),
1129 pub extern "C" fn CResult_NonePeerHandleErrorZ_free(_res: CResult_NonePeerHandleErrorZ) { }
1130 impl Drop for CResult_NonePeerHandleErrorZ {
1131 fn drop(&mut self) {
1134 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1135 let _ = unsafe { Box::from_raw(self.contents.err) };
1140 impl From<crate::c_types::CResultTempl<u8, crate::ln::peer_handler::PeerHandleError>> for CResult_NonePeerHandleErrorZ {
1141 fn from(mut o: crate::c_types::CResultTempl<u8, crate::ln::peer_handler::PeerHandleError>) -> Self {
1142 let contents = if o.result_ok {
1143 let _ = unsafe { Box::from_raw(o.contents.result) };
1144 o.contents.result = std::ptr::null_mut();
1145 CResult_NonePeerHandleErrorZPtr { result: std::ptr::null_mut() }
1147 let err = unsafe { o.contents.err };
1148 unsafe { o.contents.err = std::ptr::null_mut(); }
1149 CResult_NonePeerHandleErrorZPtr { err }
1153 result_ok: o.result_ok,
1157 impl Clone for CResult_NonePeerHandleErrorZ {
1158 fn clone(&self) -> Self {
1160 Self { result_ok: true, contents: CResult_NonePeerHandleErrorZPtr {
1161 result: std::ptr::null_mut()
1164 Self { result_ok: false, contents: CResult_NonePeerHandleErrorZPtr {
1165 err: Box::into_raw(Box::new(<crate::ln::peer_handler::PeerHandleError>::clone(unsafe { &*self.contents.err })))
1171 pub extern "C" fn CResult_NonePeerHandleErrorZ_clone(orig: &CResult_NonePeerHandleErrorZ) -> CResult_NonePeerHandleErrorZ { orig.clone() }
1173 pub union CResult_boolPeerHandleErrorZPtr {
1174 pub result: *mut bool,
1175 pub err: *mut crate::ln::peer_handler::PeerHandleError,
1178 pub struct CResult_boolPeerHandleErrorZ {
1179 pub contents: CResult_boolPeerHandleErrorZPtr,
1180 pub result_ok: bool,
1183 pub extern "C" fn CResult_boolPeerHandleErrorZ_ok(o: bool) -> CResult_boolPeerHandleErrorZ {
1184 CResult_boolPeerHandleErrorZ {
1185 contents: CResult_boolPeerHandleErrorZPtr {
1186 result: Box::into_raw(Box::new(o)),
1192 pub extern "C" fn CResult_boolPeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_boolPeerHandleErrorZ {
1193 CResult_boolPeerHandleErrorZ {
1194 contents: CResult_boolPeerHandleErrorZPtr {
1195 err: Box::into_raw(Box::new(e)),
1201 pub extern "C" fn CResult_boolPeerHandleErrorZ_free(_res: CResult_boolPeerHandleErrorZ) { }
1202 impl Drop for CResult_boolPeerHandleErrorZ {
1203 fn drop(&mut self) {
1205 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1206 let _ = unsafe { Box::from_raw(self.contents.result) };
1209 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1210 let _ = unsafe { Box::from_raw(self.contents.err) };
1215 impl From<crate::c_types::CResultTempl<bool, crate::ln::peer_handler::PeerHandleError>> for CResult_boolPeerHandleErrorZ {
1216 fn from(mut o: crate::c_types::CResultTempl<bool, crate::ln::peer_handler::PeerHandleError>) -> Self {
1217 let contents = if o.result_ok {
1218 let result = unsafe { o.contents.result };
1219 unsafe { o.contents.result = std::ptr::null_mut() };
1220 CResult_boolPeerHandleErrorZPtr { result }
1222 let err = unsafe { o.contents.err };
1223 unsafe { o.contents.err = std::ptr::null_mut(); }
1224 CResult_boolPeerHandleErrorZPtr { err }
1228 result_ok: o.result_ok,
1232 impl Clone for CResult_boolPeerHandleErrorZ {
1233 fn clone(&self) -> Self {
1235 Self { result_ok: true, contents: CResult_boolPeerHandleErrorZPtr {
1236 result: Box::into_raw(Box::new(<bool>::clone(unsafe { &*self.contents.result })))
1239 Self { result_ok: false, contents: CResult_boolPeerHandleErrorZPtr {
1240 err: Box::into_raw(Box::new(<crate::ln::peer_handler::PeerHandleError>::clone(unsafe { &*self.contents.err })))
1246 pub extern "C" fn CResult_boolPeerHandleErrorZ_clone(orig: &CResult_boolPeerHandleErrorZ) -> CResult_boolPeerHandleErrorZ { orig.clone() }
1248 pub union CResult_InitFeaturesDecodeErrorZPtr {
1249 pub result: *mut crate::ln::features::InitFeatures,
1250 pub err: *mut crate::ln::msgs::DecodeError,
1253 pub struct CResult_InitFeaturesDecodeErrorZ {
1254 pub contents: CResult_InitFeaturesDecodeErrorZPtr,
1255 pub result_ok: bool,
1258 pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_ok(o: crate::ln::features::InitFeatures) -> CResult_InitFeaturesDecodeErrorZ {
1259 CResult_InitFeaturesDecodeErrorZ {
1260 contents: CResult_InitFeaturesDecodeErrorZPtr {
1261 result: Box::into_raw(Box::new(o)),
1267 pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InitFeaturesDecodeErrorZ {
1268 CResult_InitFeaturesDecodeErrorZ {
1269 contents: CResult_InitFeaturesDecodeErrorZPtr {
1270 err: Box::into_raw(Box::new(e)),
1276 pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_free(_res: CResult_InitFeaturesDecodeErrorZ) { }
1277 impl Drop for CResult_InitFeaturesDecodeErrorZ {
1278 fn drop(&mut self) {
1280 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1281 let _ = unsafe { Box::from_raw(self.contents.result) };
1284 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1285 let _ = unsafe { Box::from_raw(self.contents.err) };
1290 impl From<crate::c_types::CResultTempl<crate::ln::features::InitFeatures, crate::ln::msgs::DecodeError>> for CResult_InitFeaturesDecodeErrorZ {
1291 fn from(mut o: crate::c_types::CResultTempl<crate::ln::features::InitFeatures, crate::ln::msgs::DecodeError>) -> Self {
1292 let contents = if o.result_ok {
1293 let result = unsafe { o.contents.result };
1294 unsafe { o.contents.result = std::ptr::null_mut() };
1295 CResult_InitFeaturesDecodeErrorZPtr { result }
1297 let err = unsafe { o.contents.err };
1298 unsafe { o.contents.err = std::ptr::null_mut(); }
1299 CResult_InitFeaturesDecodeErrorZPtr { err }
1303 result_ok: o.result_ok,
1308 pub union CResult_NodeFeaturesDecodeErrorZPtr {
1309 pub result: *mut crate::ln::features::NodeFeatures,
1310 pub err: *mut crate::ln::msgs::DecodeError,
1313 pub struct CResult_NodeFeaturesDecodeErrorZ {
1314 pub contents: CResult_NodeFeaturesDecodeErrorZPtr,
1315 pub result_ok: bool,
1318 pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_ok(o: crate::ln::features::NodeFeatures) -> CResult_NodeFeaturesDecodeErrorZ {
1319 CResult_NodeFeaturesDecodeErrorZ {
1320 contents: CResult_NodeFeaturesDecodeErrorZPtr {
1321 result: Box::into_raw(Box::new(o)),
1327 pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeFeaturesDecodeErrorZ {
1328 CResult_NodeFeaturesDecodeErrorZ {
1329 contents: CResult_NodeFeaturesDecodeErrorZPtr {
1330 err: Box::into_raw(Box::new(e)),
1336 pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_free(_res: CResult_NodeFeaturesDecodeErrorZ) { }
1337 impl Drop for CResult_NodeFeaturesDecodeErrorZ {
1338 fn drop(&mut self) {
1340 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1341 let _ = unsafe { Box::from_raw(self.contents.result) };
1344 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1345 let _ = unsafe { Box::from_raw(self.contents.err) };
1350 impl From<crate::c_types::CResultTempl<crate::ln::features::NodeFeatures, crate::ln::msgs::DecodeError>> for CResult_NodeFeaturesDecodeErrorZ {
1351 fn from(mut o: crate::c_types::CResultTempl<crate::ln::features::NodeFeatures, crate::ln::msgs::DecodeError>) -> Self {
1352 let contents = if o.result_ok {
1353 let result = unsafe { o.contents.result };
1354 unsafe { o.contents.result = std::ptr::null_mut() };
1355 CResult_NodeFeaturesDecodeErrorZPtr { result }
1357 let err = unsafe { o.contents.err };
1358 unsafe { o.contents.err = std::ptr::null_mut(); }
1359 CResult_NodeFeaturesDecodeErrorZPtr { err }
1363 result_ok: o.result_ok,
1368 pub union CResult_ChannelFeaturesDecodeErrorZPtr {
1369 pub result: *mut crate::ln::features::ChannelFeatures,
1370 pub err: *mut crate::ln::msgs::DecodeError,
1373 pub struct CResult_ChannelFeaturesDecodeErrorZ {
1374 pub contents: CResult_ChannelFeaturesDecodeErrorZPtr,
1375 pub result_ok: bool,
1378 pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_ok(o: crate::ln::features::ChannelFeatures) -> CResult_ChannelFeaturesDecodeErrorZ {
1379 CResult_ChannelFeaturesDecodeErrorZ {
1380 contents: CResult_ChannelFeaturesDecodeErrorZPtr {
1381 result: Box::into_raw(Box::new(o)),
1387 pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelFeaturesDecodeErrorZ {
1388 CResult_ChannelFeaturesDecodeErrorZ {
1389 contents: CResult_ChannelFeaturesDecodeErrorZPtr {
1390 err: Box::into_raw(Box::new(e)),
1396 pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_free(_res: CResult_ChannelFeaturesDecodeErrorZ) { }
1397 impl Drop for CResult_ChannelFeaturesDecodeErrorZ {
1398 fn drop(&mut self) {
1400 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1401 let _ = unsafe { Box::from_raw(self.contents.result) };
1404 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1405 let _ = unsafe { Box::from_raw(self.contents.err) };
1410 impl From<crate::c_types::CResultTempl<crate::ln::features::ChannelFeatures, crate::ln::msgs::DecodeError>> for CResult_ChannelFeaturesDecodeErrorZ {
1411 fn from(mut o: crate::c_types::CResultTempl<crate::ln::features::ChannelFeatures, crate::ln::msgs::DecodeError>) -> Self {
1412 let contents = if o.result_ok {
1413 let result = unsafe { o.contents.result };
1414 unsafe { o.contents.result = std::ptr::null_mut() };
1415 CResult_ChannelFeaturesDecodeErrorZPtr { result }
1417 let err = unsafe { o.contents.err };
1418 unsafe { o.contents.err = std::ptr::null_mut(); }
1419 CResult_ChannelFeaturesDecodeErrorZPtr { err }
1423 result_ok: o.result_ok,
1428 pub union CResult_ChannelConfigDecodeErrorZPtr {
1429 pub result: *mut crate::util::config::ChannelConfig,
1430 pub err: *mut crate::ln::msgs::DecodeError,
1433 pub struct CResult_ChannelConfigDecodeErrorZ {
1434 pub contents: CResult_ChannelConfigDecodeErrorZPtr,
1435 pub result_ok: bool,
1438 pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_ok(o: crate::util::config::ChannelConfig) -> CResult_ChannelConfigDecodeErrorZ {
1439 CResult_ChannelConfigDecodeErrorZ {
1440 contents: CResult_ChannelConfigDecodeErrorZPtr {
1441 result: Box::into_raw(Box::new(o)),
1447 pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelConfigDecodeErrorZ {
1448 CResult_ChannelConfigDecodeErrorZ {
1449 contents: CResult_ChannelConfigDecodeErrorZPtr {
1450 err: Box::into_raw(Box::new(e)),
1456 pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_free(_res: CResult_ChannelConfigDecodeErrorZ) { }
1457 impl Drop for CResult_ChannelConfigDecodeErrorZ {
1458 fn drop(&mut self) {
1460 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1461 let _ = unsafe { Box::from_raw(self.contents.result) };
1464 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1465 let _ = unsafe { Box::from_raw(self.contents.err) };
1470 impl From<crate::c_types::CResultTempl<crate::util::config::ChannelConfig, crate::ln::msgs::DecodeError>> for CResult_ChannelConfigDecodeErrorZ {
1471 fn from(mut o: crate::c_types::CResultTempl<crate::util::config::ChannelConfig, crate::ln::msgs::DecodeError>) -> Self {
1472 let contents = if o.result_ok {
1473 let result = unsafe { o.contents.result };
1474 unsafe { o.contents.result = std::ptr::null_mut() };
1475 CResult_ChannelConfigDecodeErrorZPtr { result }
1477 let err = unsafe { o.contents.err };
1478 unsafe { o.contents.err = std::ptr::null_mut(); }
1479 CResult_ChannelConfigDecodeErrorZPtr { err }
1483 result_ok: o.result_ok,
1487 impl Clone for CResult_ChannelConfigDecodeErrorZ {
1488 fn clone(&self) -> Self {
1490 Self { result_ok: true, contents: CResult_ChannelConfigDecodeErrorZPtr {
1491 result: Box::into_raw(Box::new(<crate::util::config::ChannelConfig>::clone(unsafe { &*self.contents.result })))
1494 Self { result_ok: false, contents: CResult_ChannelConfigDecodeErrorZPtr {
1495 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
1501 pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_clone(orig: &CResult_ChannelConfigDecodeErrorZ) -> CResult_ChannelConfigDecodeErrorZ { orig.clone() }
1503 pub union CResult_boolLightningErrorZPtr {
1504 pub result: *mut bool,
1505 pub err: *mut crate::ln::msgs::LightningError,
1508 pub struct CResult_boolLightningErrorZ {
1509 pub contents: CResult_boolLightningErrorZPtr,
1510 pub result_ok: bool,
1513 pub extern "C" fn CResult_boolLightningErrorZ_ok(o: bool) -> CResult_boolLightningErrorZ {
1514 CResult_boolLightningErrorZ {
1515 contents: CResult_boolLightningErrorZPtr {
1516 result: Box::into_raw(Box::new(o)),
1522 pub extern "C" fn CResult_boolLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_boolLightningErrorZ {
1523 CResult_boolLightningErrorZ {
1524 contents: CResult_boolLightningErrorZPtr {
1525 err: Box::into_raw(Box::new(e)),
1531 pub extern "C" fn CResult_boolLightningErrorZ_free(_res: CResult_boolLightningErrorZ) { }
1532 impl Drop for CResult_boolLightningErrorZ {
1533 fn drop(&mut self) {
1535 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1536 let _ = unsafe { Box::from_raw(self.contents.result) };
1539 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1540 let _ = unsafe { Box::from_raw(self.contents.err) };
1545 impl From<crate::c_types::CResultTempl<bool, crate::ln::msgs::LightningError>> for CResult_boolLightningErrorZ {
1546 fn from(mut o: crate::c_types::CResultTempl<bool, crate::ln::msgs::LightningError>) -> Self {
1547 let contents = if o.result_ok {
1548 let result = unsafe { o.contents.result };
1549 unsafe { o.contents.result = std::ptr::null_mut() };
1550 CResult_boolLightningErrorZPtr { result }
1552 let err = unsafe { o.contents.err };
1553 unsafe { o.contents.err = std::ptr::null_mut(); }
1554 CResult_boolLightningErrorZPtr { err }
1558 result_ok: o.result_ok,
1562 impl Clone for CResult_boolLightningErrorZ {
1563 fn clone(&self) -> Self {
1565 Self { result_ok: true, contents: CResult_boolLightningErrorZPtr {
1566 result: Box::into_raw(Box::new(<bool>::clone(unsafe { &*self.contents.result })))
1569 Self { result_ok: false, contents: CResult_boolLightningErrorZPtr {
1570 err: Box::into_raw(Box::new(<crate::ln::msgs::LightningError>::clone(unsafe { &*self.contents.err })))
1576 pub extern "C" fn CResult_boolLightningErrorZ_clone(orig: &CResult_boolLightningErrorZ) -> CResult_boolLightningErrorZ { orig.clone() }
1578 pub struct C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1579 pub a: crate::ln::msgs::ChannelAnnouncement,
1580 pub b: crate::ln::msgs::ChannelUpdate,
1581 pub c: crate::ln::msgs::ChannelUpdate,
1583 impl From<(crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate)> for C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1584 fn from (tup: (crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate)) -> Self {
1592 impl C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1593 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate) {
1594 (self.a, self.b, self.c)
1597 impl Clone for C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1598 fn clone(&self) -> Self {
1607 pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig: &C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { orig.clone() }
1609 pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a: crate::ln::msgs::ChannelAnnouncement, b: crate::ln::msgs::ChannelUpdate, c: crate::ln::msgs::ChannelUpdate) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1610 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { a, b, c, }
1614 pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) { }
1616 pub struct CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1617 pub data: *mut crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ,
1620 impl CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1621 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ> {
1622 if self.datalen == 0 { return Vec::new(); }
1623 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
1624 self.data = std::ptr::null_mut();
1628 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ] {
1629 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
1632 impl From<Vec<crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ>> for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1633 fn from(v: Vec<crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ>) -> Self {
1634 let datalen = v.len();
1635 let data = Box::into_raw(v.into_boxed_slice());
1636 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
1640 pub extern "C" fn CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res: CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ) { }
1641 impl Drop for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1642 fn drop(&mut self) {
1643 if self.datalen == 0 { return; }
1644 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
1647 impl Clone for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1648 fn clone(&self) -> Self {
1649 let mut res = Vec::new();
1650 if self.datalen == 0 { return Self::from(res); }
1651 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
1656 pub struct CVec_NodeAnnouncementZ {
1657 pub data: *mut crate::ln::msgs::NodeAnnouncement,
1660 impl CVec_NodeAnnouncementZ {
1661 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::NodeAnnouncement> {
1662 if self.datalen == 0 { return Vec::new(); }
1663 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
1664 self.data = std::ptr::null_mut();
1668 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::NodeAnnouncement] {
1669 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
1672 impl From<Vec<crate::ln::msgs::NodeAnnouncement>> for CVec_NodeAnnouncementZ {
1673 fn from(v: Vec<crate::ln::msgs::NodeAnnouncement>) -> Self {
1674 let datalen = v.len();
1675 let data = Box::into_raw(v.into_boxed_slice());
1676 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
1680 pub extern "C" fn CVec_NodeAnnouncementZ_free(_res: CVec_NodeAnnouncementZ) { }
1681 impl Drop for CVec_NodeAnnouncementZ {
1682 fn drop(&mut self) {
1683 if self.datalen == 0 { return; }
1684 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
1687 impl Clone for CVec_NodeAnnouncementZ {
1688 fn clone(&self) -> Self {
1689 let mut res = Vec::new();
1690 if self.datalen == 0 { return Self::from(res); }
1691 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
1696 pub union CResult_NoneLightningErrorZPtr {
1697 /// Note that this value is always NULL, as there are no contents in the OK variant
1698 pub result: *mut std::ffi::c_void,
1699 pub err: *mut crate::ln::msgs::LightningError,
1702 pub struct CResult_NoneLightningErrorZ {
1703 pub contents: CResult_NoneLightningErrorZPtr,
1704 pub result_ok: bool,
1707 pub extern "C" fn CResult_NoneLightningErrorZ_ok() -> CResult_NoneLightningErrorZ {
1708 CResult_NoneLightningErrorZ {
1709 contents: CResult_NoneLightningErrorZPtr {
1710 result: std::ptr::null_mut(),
1716 pub extern "C" fn CResult_NoneLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_NoneLightningErrorZ {
1717 CResult_NoneLightningErrorZ {
1718 contents: CResult_NoneLightningErrorZPtr {
1719 err: Box::into_raw(Box::new(e)),
1725 pub extern "C" fn CResult_NoneLightningErrorZ_free(_res: CResult_NoneLightningErrorZ) { }
1726 impl Drop for CResult_NoneLightningErrorZ {
1727 fn drop(&mut self) {
1730 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1731 let _ = unsafe { Box::from_raw(self.contents.err) };
1736 impl From<crate::c_types::CResultTempl<u8, crate::ln::msgs::LightningError>> for CResult_NoneLightningErrorZ {
1737 fn from(mut o: crate::c_types::CResultTempl<u8, crate::ln::msgs::LightningError>) -> Self {
1738 let contents = if o.result_ok {
1739 let _ = unsafe { Box::from_raw(o.contents.result) };
1740 o.contents.result = std::ptr::null_mut();
1741 CResult_NoneLightningErrorZPtr { result: std::ptr::null_mut() }
1743 let err = unsafe { o.contents.err };
1744 unsafe { o.contents.err = std::ptr::null_mut(); }
1745 CResult_NoneLightningErrorZPtr { err }
1749 result_ok: o.result_ok,
1753 impl Clone for CResult_NoneLightningErrorZ {
1754 fn clone(&self) -> Self {
1756 Self { result_ok: true, contents: CResult_NoneLightningErrorZPtr {
1757 result: std::ptr::null_mut()
1760 Self { result_ok: false, contents: CResult_NoneLightningErrorZPtr {
1761 err: Box::into_raw(Box::new(<crate::ln::msgs::LightningError>::clone(unsafe { &*self.contents.err })))
1767 pub extern "C" fn CResult_NoneLightningErrorZ_clone(orig: &CResult_NoneLightningErrorZ) -> CResult_NoneLightningErrorZ { orig.clone() }
1769 pub struct CVec_MessageSendEventZ {
1770 pub data: *mut crate::util::events::MessageSendEvent,
1773 impl CVec_MessageSendEventZ {
1774 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::util::events::MessageSendEvent> {
1775 if self.datalen == 0 { return Vec::new(); }
1776 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
1777 self.data = std::ptr::null_mut();
1781 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::util::events::MessageSendEvent] {
1782 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
1785 impl From<Vec<crate::util::events::MessageSendEvent>> for CVec_MessageSendEventZ {
1786 fn from(v: Vec<crate::util::events::MessageSendEvent>) -> Self {
1787 let datalen = v.len();
1788 let data = Box::into_raw(v.into_boxed_slice());
1789 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
1793 pub extern "C" fn CVec_MessageSendEventZ_free(_res: CVec_MessageSendEventZ) { }
1794 impl Drop for CVec_MessageSendEventZ {
1795 fn drop(&mut self) {
1796 if self.datalen == 0 { return; }
1797 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
1800 impl Clone for CVec_MessageSendEventZ {
1801 fn clone(&self) -> Self {
1802 let mut res = Vec::new();
1803 if self.datalen == 0 { return Self::from(res); }
1804 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
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,
1944 pub union CResult_RoutingFeesDecodeErrorZPtr {
1945 pub result: *mut crate::routing::network_graph::RoutingFees,
1946 pub err: *mut crate::ln::msgs::DecodeError,
1949 pub struct CResult_RoutingFeesDecodeErrorZ {
1950 pub contents: CResult_RoutingFeesDecodeErrorZPtr,
1951 pub result_ok: bool,
1954 pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_ok(o: crate::routing::network_graph::RoutingFees) -> CResult_RoutingFeesDecodeErrorZ {
1955 CResult_RoutingFeesDecodeErrorZ {
1956 contents: CResult_RoutingFeesDecodeErrorZPtr {
1957 result: Box::into_raw(Box::new(o)),
1963 pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RoutingFeesDecodeErrorZ {
1964 CResult_RoutingFeesDecodeErrorZ {
1965 contents: CResult_RoutingFeesDecodeErrorZPtr {
1966 err: Box::into_raw(Box::new(e)),
1972 pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_free(_res: CResult_RoutingFeesDecodeErrorZ) { }
1973 impl Drop for CResult_RoutingFeesDecodeErrorZ {
1974 fn drop(&mut self) {
1976 if unsafe { !(self.contents.result as *mut ()).is_null() } {
1977 let _ = unsafe { Box::from_raw(self.contents.result) };
1980 if unsafe { !(self.contents.err as *mut ()).is_null() } {
1981 let _ = unsafe { Box::from_raw(self.contents.err) };
1986 impl From<crate::c_types::CResultTempl<crate::routing::network_graph::RoutingFees, crate::ln::msgs::DecodeError>> for CResult_RoutingFeesDecodeErrorZ {
1987 fn from(mut o: crate::c_types::CResultTempl<crate::routing::network_graph::RoutingFees, crate::ln::msgs::DecodeError>) -> Self {
1988 let contents = if o.result_ok {
1989 let result = unsafe { o.contents.result };
1990 unsafe { o.contents.result = std::ptr::null_mut() };
1991 CResult_RoutingFeesDecodeErrorZPtr { result }
1993 let err = unsafe { o.contents.err };
1994 unsafe { o.contents.err = std::ptr::null_mut(); }
1995 CResult_RoutingFeesDecodeErrorZPtr { err }
1999 result_ok: o.result_ok,
2003 impl Clone for CResult_RoutingFeesDecodeErrorZ {
2004 fn clone(&self) -> Self {
2006 Self { result_ok: true, contents: CResult_RoutingFeesDecodeErrorZPtr {
2007 result: Box::into_raw(Box::new(<crate::routing::network_graph::RoutingFees>::clone(unsafe { &*self.contents.result })))
2010 Self { result_ok: false, contents: CResult_RoutingFeesDecodeErrorZPtr {
2011 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2017 pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_clone(orig: &CResult_RoutingFeesDecodeErrorZ) -> CResult_RoutingFeesDecodeErrorZ { orig.clone() }
2019 pub struct CVec_NetAddressZ {
2020 pub data: *mut crate::ln::msgs::NetAddress,
2023 impl CVec_NetAddressZ {
2024 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::NetAddress> {
2025 if self.datalen == 0 { return Vec::new(); }
2026 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2027 self.data = std::ptr::null_mut();
2031 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::NetAddress] {
2032 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2035 impl From<Vec<crate::ln::msgs::NetAddress>> for CVec_NetAddressZ {
2036 fn from(v: Vec<crate::ln::msgs::NetAddress>) -> Self {
2037 let datalen = v.len();
2038 let data = Box::into_raw(v.into_boxed_slice());
2039 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2043 pub extern "C" fn CVec_NetAddressZ_free(_res: CVec_NetAddressZ) { }
2044 impl Drop for CVec_NetAddressZ {
2045 fn drop(&mut self) {
2046 if self.datalen == 0 { return; }
2047 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2050 impl Clone for CVec_NetAddressZ {
2051 fn clone(&self) -> Self {
2052 let mut res = Vec::new();
2053 if self.datalen == 0 { return Self::from(res); }
2054 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
2059 pub union CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2060 pub result: *mut crate::routing::network_graph::NodeAnnouncementInfo,
2061 pub err: *mut crate::ln::msgs::DecodeError,
2064 pub struct CResult_NodeAnnouncementInfoDecodeErrorZ {
2065 pub contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr,
2066 pub result_ok: bool,
2069 pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o: crate::routing::network_graph::NodeAnnouncementInfo) -> CResult_NodeAnnouncementInfoDecodeErrorZ {
2070 CResult_NodeAnnouncementInfoDecodeErrorZ {
2071 contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2072 result: Box::into_raw(Box::new(o)),
2078 pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeAnnouncementInfoDecodeErrorZ {
2079 CResult_NodeAnnouncementInfoDecodeErrorZ {
2080 contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2081 err: Box::into_raw(Box::new(e)),
2087 pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res: CResult_NodeAnnouncementInfoDecodeErrorZ) { }
2088 impl Drop for CResult_NodeAnnouncementInfoDecodeErrorZ {
2089 fn drop(&mut self) {
2091 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2092 let _ = unsafe { Box::from_raw(self.contents.result) };
2095 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2096 let _ = unsafe { Box::from_raw(self.contents.err) };
2101 impl From<crate::c_types::CResultTempl<crate::routing::network_graph::NodeAnnouncementInfo, crate::ln::msgs::DecodeError>> for CResult_NodeAnnouncementInfoDecodeErrorZ {
2102 fn from(mut o: crate::c_types::CResultTempl<crate::routing::network_graph::NodeAnnouncementInfo, crate::ln::msgs::DecodeError>) -> Self {
2103 let contents = if o.result_ok {
2104 let result = unsafe { o.contents.result };
2105 unsafe { o.contents.result = std::ptr::null_mut() };
2106 CResult_NodeAnnouncementInfoDecodeErrorZPtr { result }
2108 let err = unsafe { o.contents.err };
2109 unsafe { o.contents.err = std::ptr::null_mut(); }
2110 CResult_NodeAnnouncementInfoDecodeErrorZPtr { err }
2114 result_ok: o.result_ok,
2118 impl Clone for CResult_NodeAnnouncementInfoDecodeErrorZ {
2119 fn clone(&self) -> Self {
2121 Self { result_ok: true, contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2122 result: Box::into_raw(Box::new(<crate::routing::network_graph::NodeAnnouncementInfo>::clone(unsafe { &*self.contents.result })))
2125 Self { result_ok: false, contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2126 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2132 pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig: &CResult_NodeAnnouncementInfoDecodeErrorZ) -> CResult_NodeAnnouncementInfoDecodeErrorZ { orig.clone() }
2134 pub struct CVec_u64Z {
2139 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<u64> {
2140 if self.datalen == 0 { return Vec::new(); }
2141 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2142 self.data = std::ptr::null_mut();
2146 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[u64] {
2147 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2150 impl From<Vec<u64>> for CVec_u64Z {
2151 fn from(v: Vec<u64>) -> Self {
2152 let datalen = v.len();
2153 let data = Box::into_raw(v.into_boxed_slice());
2154 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2158 pub extern "C" fn CVec_u64Z_free(_res: CVec_u64Z) { }
2159 impl Drop for CVec_u64Z {
2160 fn drop(&mut self) {
2161 if self.datalen == 0 { return; }
2162 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2165 impl Clone for CVec_u64Z {
2166 fn clone(&self) -> Self {
2167 let mut res = Vec::new();
2168 if self.datalen == 0 { return Self::from(res); }
2169 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
2174 pub union CResult_NodeInfoDecodeErrorZPtr {
2175 pub result: *mut crate::routing::network_graph::NodeInfo,
2176 pub err: *mut crate::ln::msgs::DecodeError,
2179 pub struct CResult_NodeInfoDecodeErrorZ {
2180 pub contents: CResult_NodeInfoDecodeErrorZPtr,
2181 pub result_ok: bool,
2184 pub extern "C" fn CResult_NodeInfoDecodeErrorZ_ok(o: crate::routing::network_graph::NodeInfo) -> CResult_NodeInfoDecodeErrorZ {
2185 CResult_NodeInfoDecodeErrorZ {
2186 contents: CResult_NodeInfoDecodeErrorZPtr {
2187 result: Box::into_raw(Box::new(o)),
2193 pub extern "C" fn CResult_NodeInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeInfoDecodeErrorZ {
2194 CResult_NodeInfoDecodeErrorZ {
2195 contents: CResult_NodeInfoDecodeErrorZPtr {
2196 err: Box::into_raw(Box::new(e)),
2202 pub extern "C" fn CResult_NodeInfoDecodeErrorZ_free(_res: CResult_NodeInfoDecodeErrorZ) { }
2203 impl Drop for CResult_NodeInfoDecodeErrorZ {
2204 fn drop(&mut self) {
2206 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2207 let _ = unsafe { Box::from_raw(self.contents.result) };
2210 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2211 let _ = unsafe { Box::from_raw(self.contents.err) };
2216 impl From<crate::c_types::CResultTempl<crate::routing::network_graph::NodeInfo, crate::ln::msgs::DecodeError>> for CResult_NodeInfoDecodeErrorZ {
2217 fn from(mut o: crate::c_types::CResultTempl<crate::routing::network_graph::NodeInfo, crate::ln::msgs::DecodeError>) -> Self {
2218 let contents = if o.result_ok {
2219 let result = unsafe { o.contents.result };
2220 unsafe { o.contents.result = std::ptr::null_mut() };
2221 CResult_NodeInfoDecodeErrorZPtr { result }
2223 let err = unsafe { o.contents.err };
2224 unsafe { o.contents.err = std::ptr::null_mut(); }
2225 CResult_NodeInfoDecodeErrorZPtr { err }
2229 result_ok: o.result_ok,
2233 impl Clone for CResult_NodeInfoDecodeErrorZ {
2234 fn clone(&self) -> Self {
2236 Self { result_ok: true, contents: CResult_NodeInfoDecodeErrorZPtr {
2237 result: Box::into_raw(Box::new(<crate::routing::network_graph::NodeInfo>::clone(unsafe { &*self.contents.result })))
2240 Self { result_ok: false, contents: CResult_NodeInfoDecodeErrorZPtr {
2241 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2247 pub extern "C" fn CResult_NodeInfoDecodeErrorZ_clone(orig: &CResult_NodeInfoDecodeErrorZ) -> CResult_NodeInfoDecodeErrorZ { orig.clone() }
2249 pub union CResult_NetworkGraphDecodeErrorZPtr {
2250 pub result: *mut crate::routing::network_graph::NetworkGraph,
2251 pub err: *mut crate::ln::msgs::DecodeError,
2254 pub struct CResult_NetworkGraphDecodeErrorZ {
2255 pub contents: CResult_NetworkGraphDecodeErrorZPtr,
2256 pub result_ok: bool,
2259 pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_ok(o: crate::routing::network_graph::NetworkGraph) -> CResult_NetworkGraphDecodeErrorZ {
2260 CResult_NetworkGraphDecodeErrorZ {
2261 contents: CResult_NetworkGraphDecodeErrorZPtr {
2262 result: Box::into_raw(Box::new(o)),
2268 pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NetworkGraphDecodeErrorZ {
2269 CResult_NetworkGraphDecodeErrorZ {
2270 contents: CResult_NetworkGraphDecodeErrorZPtr {
2271 err: Box::into_raw(Box::new(e)),
2277 pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_free(_res: CResult_NetworkGraphDecodeErrorZ) { }
2278 impl Drop for CResult_NetworkGraphDecodeErrorZ {
2279 fn drop(&mut self) {
2281 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2282 let _ = unsafe { Box::from_raw(self.contents.result) };
2285 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2286 let _ = unsafe { Box::from_raw(self.contents.err) };
2291 impl From<crate::c_types::CResultTempl<crate::routing::network_graph::NetworkGraph, crate::ln::msgs::DecodeError>> for CResult_NetworkGraphDecodeErrorZ {
2292 fn from(mut o: crate::c_types::CResultTempl<crate::routing::network_graph::NetworkGraph, crate::ln::msgs::DecodeError>) -> Self {
2293 let contents = if o.result_ok {
2294 let result = unsafe { o.contents.result };
2295 unsafe { o.contents.result = std::ptr::null_mut() };
2296 CResult_NetworkGraphDecodeErrorZPtr { result }
2298 let err = unsafe { o.contents.err };
2299 unsafe { o.contents.err = std::ptr::null_mut(); }
2300 CResult_NetworkGraphDecodeErrorZPtr { err }
2304 result_ok: o.result_ok,
2309 pub struct C2Tuple_usizeTransactionZ {
2311 pub b: crate::c_types::Transaction,
2313 impl From<(usize, crate::c_types::Transaction)> for C2Tuple_usizeTransactionZ {
2314 fn from (tup: (usize, crate::c_types::Transaction)) -> Self {
2321 impl C2Tuple_usizeTransactionZ {
2322 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (usize, crate::c_types::Transaction) {
2327 pub extern "C" fn C2Tuple_usizeTransactionZ_new(a: usize, b: crate::c_types::Transaction) -> C2Tuple_usizeTransactionZ {
2328 C2Tuple_usizeTransactionZ { a, b, }
2332 pub extern "C" fn C2Tuple_usizeTransactionZ_free(_res: C2Tuple_usizeTransactionZ) { }
2334 pub struct CVec_C2Tuple_usizeTransactionZZ {
2335 pub data: *mut crate::c_types::derived::C2Tuple_usizeTransactionZ,
2338 impl CVec_C2Tuple_usizeTransactionZZ {
2339 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_usizeTransactionZ> {
2340 if self.datalen == 0 { return Vec::new(); }
2341 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2342 self.data = std::ptr::null_mut();
2346 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_usizeTransactionZ] {
2347 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2350 impl From<Vec<crate::c_types::derived::C2Tuple_usizeTransactionZ>> for CVec_C2Tuple_usizeTransactionZZ {
2351 fn from(v: Vec<crate::c_types::derived::C2Tuple_usizeTransactionZ>) -> Self {
2352 let datalen = v.len();
2353 let data = Box::into_raw(v.into_boxed_slice());
2354 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2358 pub extern "C" fn CVec_C2Tuple_usizeTransactionZZ_free(_res: CVec_C2Tuple_usizeTransactionZZ) { }
2359 impl Drop for CVec_C2Tuple_usizeTransactionZZ {
2360 fn drop(&mut self) {
2361 if self.datalen == 0 { return; }
2362 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2366 pub union CResult_NoneChannelMonitorUpdateErrZPtr {
2367 /// Note that this value is always NULL, as there are no contents in the OK variant
2368 pub result: *mut std::ffi::c_void,
2369 pub err: *mut crate::chain::channelmonitor::ChannelMonitorUpdateErr,
2372 pub struct CResult_NoneChannelMonitorUpdateErrZ {
2373 pub contents: CResult_NoneChannelMonitorUpdateErrZPtr,
2374 pub result_ok: bool,
2377 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_ok() -> CResult_NoneChannelMonitorUpdateErrZ {
2378 CResult_NoneChannelMonitorUpdateErrZ {
2379 contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2380 result: std::ptr::null_mut(),
2386 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_err(e: crate::chain::channelmonitor::ChannelMonitorUpdateErr) -> CResult_NoneChannelMonitorUpdateErrZ {
2387 CResult_NoneChannelMonitorUpdateErrZ {
2388 contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2389 err: Box::into_raw(Box::new(e)),
2395 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_free(_res: CResult_NoneChannelMonitorUpdateErrZ) { }
2396 impl Drop for CResult_NoneChannelMonitorUpdateErrZ {
2397 fn drop(&mut self) {
2400 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2401 let _ = unsafe { Box::from_raw(self.contents.err) };
2406 impl From<crate::c_types::CResultTempl<u8, crate::chain::channelmonitor::ChannelMonitorUpdateErr>> for CResult_NoneChannelMonitorUpdateErrZ {
2407 fn from(mut o: crate::c_types::CResultTempl<u8, crate::chain::channelmonitor::ChannelMonitorUpdateErr>) -> Self {
2408 let contents = if o.result_ok {
2409 let _ = unsafe { Box::from_raw(o.contents.result) };
2410 o.contents.result = std::ptr::null_mut();
2411 CResult_NoneChannelMonitorUpdateErrZPtr { result: std::ptr::null_mut() }
2413 let err = unsafe { o.contents.err };
2414 unsafe { o.contents.err = std::ptr::null_mut(); }
2415 CResult_NoneChannelMonitorUpdateErrZPtr { err }
2419 result_ok: o.result_ok,
2423 impl Clone for CResult_NoneChannelMonitorUpdateErrZ {
2424 fn clone(&self) -> Self {
2426 Self { result_ok: true, contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2427 result: std::ptr::null_mut()
2430 Self { result_ok: false, contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2431 err: Box::into_raw(Box::new(<crate::chain::channelmonitor::ChannelMonitorUpdateErr>::clone(unsafe { &*self.contents.err })))
2437 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_clone(orig: &CResult_NoneChannelMonitorUpdateErrZ) -> CResult_NoneChannelMonitorUpdateErrZ { orig.clone() }
2439 pub struct CVec_MonitorEventZ {
2440 pub data: *mut crate::chain::channelmonitor::MonitorEvent,
2443 impl CVec_MonitorEventZ {
2444 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::chain::channelmonitor::MonitorEvent> {
2445 if self.datalen == 0 { return Vec::new(); }
2446 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2447 self.data = std::ptr::null_mut();
2451 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::channelmonitor::MonitorEvent] {
2452 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2455 impl From<Vec<crate::chain::channelmonitor::MonitorEvent>> for CVec_MonitorEventZ {
2456 fn from(v: Vec<crate::chain::channelmonitor::MonitorEvent>) -> Self {
2457 let datalen = v.len();
2458 let data = Box::into_raw(v.into_boxed_slice());
2459 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2463 pub extern "C" fn CVec_MonitorEventZ_free(_res: CVec_MonitorEventZ) { }
2464 impl Drop for CVec_MonitorEventZ {
2465 fn drop(&mut self) {
2466 if self.datalen == 0 { return; }
2467 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2470 impl Clone for CVec_MonitorEventZ {
2471 fn clone(&self) -> Self {
2472 let mut res = Vec::new();
2473 if self.datalen == 0 { return Self::from(res); }
2474 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
2479 pub struct CVec_EventZ {
2480 pub data: *mut crate::util::events::Event,
2484 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::util::events::Event> {
2485 if self.datalen == 0 { return Vec::new(); }
2486 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2487 self.data = std::ptr::null_mut();
2491 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::util::events::Event] {
2492 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2495 impl From<Vec<crate::util::events::Event>> for CVec_EventZ {
2496 fn from(v: Vec<crate::util::events::Event>) -> Self {
2497 let datalen = v.len();
2498 let data = Box::into_raw(v.into_boxed_slice());
2499 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2503 pub extern "C" fn CVec_EventZ_free(_res: CVec_EventZ) { }
2504 impl Drop for CVec_EventZ {
2505 fn drop(&mut self) {
2506 if self.datalen == 0 { return; }
2507 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2510 impl Clone for CVec_EventZ {
2511 fn clone(&self) -> Self {
2512 let mut res = Vec::new();
2513 if self.datalen == 0 { return Self::from(res); }
2514 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
2519 pub union CResult_OutPointDecodeErrorZPtr {
2520 pub result: *mut crate::chain::transaction::OutPoint,
2521 pub err: *mut crate::ln::msgs::DecodeError,
2524 pub struct CResult_OutPointDecodeErrorZ {
2525 pub contents: CResult_OutPointDecodeErrorZPtr,
2526 pub result_ok: bool,
2529 pub extern "C" fn CResult_OutPointDecodeErrorZ_ok(o: crate::chain::transaction::OutPoint) -> CResult_OutPointDecodeErrorZ {
2530 CResult_OutPointDecodeErrorZ {
2531 contents: CResult_OutPointDecodeErrorZPtr {
2532 result: Box::into_raw(Box::new(o)),
2538 pub extern "C" fn CResult_OutPointDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_OutPointDecodeErrorZ {
2539 CResult_OutPointDecodeErrorZ {
2540 contents: CResult_OutPointDecodeErrorZPtr {
2541 err: Box::into_raw(Box::new(e)),
2547 pub extern "C" fn CResult_OutPointDecodeErrorZ_free(_res: CResult_OutPointDecodeErrorZ) { }
2548 impl Drop for CResult_OutPointDecodeErrorZ {
2549 fn drop(&mut self) {
2551 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2552 let _ = unsafe { Box::from_raw(self.contents.result) };
2555 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2556 let _ = unsafe { Box::from_raw(self.contents.err) };
2561 impl From<crate::c_types::CResultTempl<crate::chain::transaction::OutPoint, crate::ln::msgs::DecodeError>> for CResult_OutPointDecodeErrorZ {
2562 fn from(mut o: crate::c_types::CResultTempl<crate::chain::transaction::OutPoint, crate::ln::msgs::DecodeError>) -> Self {
2563 let contents = if o.result_ok {
2564 let result = unsafe { o.contents.result };
2565 unsafe { o.contents.result = std::ptr::null_mut() };
2566 CResult_OutPointDecodeErrorZPtr { result }
2568 let err = unsafe { o.contents.err };
2569 unsafe { o.contents.err = std::ptr::null_mut(); }
2570 CResult_OutPointDecodeErrorZPtr { err }
2574 result_ok: o.result_ok,
2578 impl Clone for CResult_OutPointDecodeErrorZ {
2579 fn clone(&self) -> Self {
2581 Self { result_ok: true, contents: CResult_OutPointDecodeErrorZPtr {
2582 result: Box::into_raw(Box::new(<crate::chain::transaction::OutPoint>::clone(unsafe { &*self.contents.result })))
2585 Self { result_ok: false, contents: CResult_OutPointDecodeErrorZPtr {
2586 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2592 pub extern "C" fn CResult_OutPointDecodeErrorZ_clone(orig: &CResult_OutPointDecodeErrorZ) -> CResult_OutPointDecodeErrorZ { orig.clone() }
2594 pub union CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2595 pub result: *mut crate::chain::channelmonitor::ChannelMonitorUpdate,
2596 pub err: *mut crate::ln::msgs::DecodeError,
2599 pub struct CResult_ChannelMonitorUpdateDecodeErrorZ {
2600 pub contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr,
2601 pub result_ok: bool,
2604 pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o: crate::chain::channelmonitor::ChannelMonitorUpdate) -> CResult_ChannelMonitorUpdateDecodeErrorZ {
2605 CResult_ChannelMonitorUpdateDecodeErrorZ {
2606 contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2607 result: Box::into_raw(Box::new(o)),
2613 pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelMonitorUpdateDecodeErrorZ {
2614 CResult_ChannelMonitorUpdateDecodeErrorZ {
2615 contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2616 err: Box::into_raw(Box::new(e)),
2622 pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res: CResult_ChannelMonitorUpdateDecodeErrorZ) { }
2623 impl Drop for CResult_ChannelMonitorUpdateDecodeErrorZ {
2624 fn drop(&mut self) {
2626 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2627 let _ = unsafe { Box::from_raw(self.contents.result) };
2630 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2631 let _ = unsafe { Box::from_raw(self.contents.err) };
2636 impl From<crate::c_types::CResultTempl<crate::chain::channelmonitor::ChannelMonitorUpdate, crate::ln::msgs::DecodeError>> for CResult_ChannelMonitorUpdateDecodeErrorZ {
2637 fn from(mut o: crate::c_types::CResultTempl<crate::chain::channelmonitor::ChannelMonitorUpdate, crate::ln::msgs::DecodeError>) -> Self {
2638 let contents = if o.result_ok {
2639 let result = unsafe { o.contents.result };
2640 unsafe { o.contents.result = std::ptr::null_mut() };
2641 CResult_ChannelMonitorUpdateDecodeErrorZPtr { result }
2643 let err = unsafe { o.contents.err };
2644 unsafe { o.contents.err = std::ptr::null_mut(); }
2645 CResult_ChannelMonitorUpdateDecodeErrorZPtr { err }
2649 result_ok: o.result_ok,
2653 impl Clone for CResult_ChannelMonitorUpdateDecodeErrorZ {
2654 fn clone(&self) -> Self {
2656 Self { result_ok: true, contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2657 result: Box::into_raw(Box::new(<crate::chain::channelmonitor::ChannelMonitorUpdate>::clone(unsafe { &*self.contents.result })))
2660 Self { result_ok: false, contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2661 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2667 pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig: &CResult_ChannelMonitorUpdateDecodeErrorZ) -> CResult_ChannelMonitorUpdateDecodeErrorZ { orig.clone() }
2669 pub union CResult_HTLCUpdateDecodeErrorZPtr {
2670 pub result: *mut crate::chain::channelmonitor::HTLCUpdate,
2671 pub err: *mut crate::ln::msgs::DecodeError,
2674 pub struct CResult_HTLCUpdateDecodeErrorZ {
2675 pub contents: CResult_HTLCUpdateDecodeErrorZPtr,
2676 pub result_ok: bool,
2679 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_ok(o: crate::chain::channelmonitor::HTLCUpdate) -> CResult_HTLCUpdateDecodeErrorZ {
2680 CResult_HTLCUpdateDecodeErrorZ {
2681 contents: CResult_HTLCUpdateDecodeErrorZPtr {
2682 result: Box::into_raw(Box::new(o)),
2688 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_HTLCUpdateDecodeErrorZ {
2689 CResult_HTLCUpdateDecodeErrorZ {
2690 contents: CResult_HTLCUpdateDecodeErrorZPtr {
2691 err: Box::into_raw(Box::new(e)),
2697 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_free(_res: CResult_HTLCUpdateDecodeErrorZ) { }
2698 impl Drop for CResult_HTLCUpdateDecodeErrorZ {
2699 fn drop(&mut self) {
2701 if unsafe { !(self.contents.result as *mut ()).is_null() } {
2702 let _ = unsafe { Box::from_raw(self.contents.result) };
2705 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2706 let _ = unsafe { Box::from_raw(self.contents.err) };
2711 impl From<crate::c_types::CResultTempl<crate::chain::channelmonitor::HTLCUpdate, crate::ln::msgs::DecodeError>> for CResult_HTLCUpdateDecodeErrorZ {
2712 fn from(mut o: crate::c_types::CResultTempl<crate::chain::channelmonitor::HTLCUpdate, crate::ln::msgs::DecodeError>) -> Self {
2713 let contents = if o.result_ok {
2714 let result = unsafe { o.contents.result };
2715 unsafe { o.contents.result = std::ptr::null_mut() };
2716 CResult_HTLCUpdateDecodeErrorZPtr { result }
2718 let err = unsafe { o.contents.err };
2719 unsafe { o.contents.err = std::ptr::null_mut(); }
2720 CResult_HTLCUpdateDecodeErrorZPtr { err }
2724 result_ok: o.result_ok,
2728 impl Clone for CResult_HTLCUpdateDecodeErrorZ {
2729 fn clone(&self) -> Self {
2731 Self { result_ok: true, contents: CResult_HTLCUpdateDecodeErrorZPtr {
2732 result: Box::into_raw(Box::new(<crate::chain::channelmonitor::HTLCUpdate>::clone(unsafe { &*self.contents.result })))
2735 Self { result_ok: false, contents: CResult_HTLCUpdateDecodeErrorZPtr {
2736 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2742 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_clone(orig: &CResult_HTLCUpdateDecodeErrorZ) -> CResult_HTLCUpdateDecodeErrorZ { orig.clone() }
2744 pub union CResult_NoneMonitorUpdateErrorZPtr {
2745 /// Note that this value is always NULL, as there are no contents in the OK variant
2746 pub result: *mut std::ffi::c_void,
2747 pub err: *mut crate::chain::channelmonitor::MonitorUpdateError,
2750 pub struct CResult_NoneMonitorUpdateErrorZ {
2751 pub contents: CResult_NoneMonitorUpdateErrorZPtr,
2752 pub result_ok: bool,
2755 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_ok() -> CResult_NoneMonitorUpdateErrorZ {
2756 CResult_NoneMonitorUpdateErrorZ {
2757 contents: CResult_NoneMonitorUpdateErrorZPtr {
2758 result: std::ptr::null_mut(),
2764 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_err(e: crate::chain::channelmonitor::MonitorUpdateError) -> CResult_NoneMonitorUpdateErrorZ {
2765 CResult_NoneMonitorUpdateErrorZ {
2766 contents: CResult_NoneMonitorUpdateErrorZPtr {
2767 err: Box::into_raw(Box::new(e)),
2773 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_free(_res: CResult_NoneMonitorUpdateErrorZ) { }
2774 impl Drop for CResult_NoneMonitorUpdateErrorZ {
2775 fn drop(&mut self) {
2778 if unsafe { !(self.contents.err as *mut ()).is_null() } {
2779 let _ = unsafe { Box::from_raw(self.contents.err) };
2784 impl From<crate::c_types::CResultTempl<u8, crate::chain::channelmonitor::MonitorUpdateError>> for CResult_NoneMonitorUpdateErrorZ {
2785 fn from(mut o: crate::c_types::CResultTempl<u8, crate::chain::channelmonitor::MonitorUpdateError>) -> Self {
2786 let contents = if o.result_ok {
2787 let _ = unsafe { Box::from_raw(o.contents.result) };
2788 o.contents.result = std::ptr::null_mut();
2789 CResult_NoneMonitorUpdateErrorZPtr { result: std::ptr::null_mut() }
2791 let err = unsafe { o.contents.err };
2792 unsafe { o.contents.err = std::ptr::null_mut(); }
2793 CResult_NoneMonitorUpdateErrorZPtr { err }
2797 result_ok: o.result_ok,
2801 impl Clone for CResult_NoneMonitorUpdateErrorZ {
2802 fn clone(&self) -> Self {
2804 Self { result_ok: true, contents: CResult_NoneMonitorUpdateErrorZPtr {
2805 result: std::ptr::null_mut()
2808 Self { result_ok: false, contents: CResult_NoneMonitorUpdateErrorZPtr {
2809 err: Box::into_raw(Box::new(<crate::chain::channelmonitor::MonitorUpdateError>::clone(unsafe { &*self.contents.err })))
2815 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_clone(orig: &CResult_NoneMonitorUpdateErrorZ) -> CResult_NoneMonitorUpdateErrorZ { orig.clone() }
2817 pub struct C2Tuple_OutPointScriptZ {
2818 pub a: crate::chain::transaction::OutPoint,
2819 pub b: crate::c_types::derived::CVec_u8Z,
2821 impl From<(crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z)> for C2Tuple_OutPointScriptZ {
2822 fn from (tup: (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z)) -> Self {
2829 impl C2Tuple_OutPointScriptZ {
2830 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z) {
2834 impl Clone for C2Tuple_OutPointScriptZ {
2835 fn clone(&self) -> Self {
2843 pub extern "C" fn C2Tuple_OutPointScriptZ_clone(orig: &C2Tuple_OutPointScriptZ) -> C2Tuple_OutPointScriptZ { orig.clone() }
2845 pub extern "C" fn C2Tuple_OutPointScriptZ_new(a: crate::chain::transaction::OutPoint, b: crate::c_types::derived::CVec_u8Z) -> C2Tuple_OutPointScriptZ {
2846 C2Tuple_OutPointScriptZ { a, b, }
2850 pub extern "C" fn C2Tuple_OutPointScriptZ_free(_res: C2Tuple_OutPointScriptZ) { }
2852 pub struct CVec_TransactionZ {
2853 pub data: *mut crate::c_types::Transaction,
2856 impl CVec_TransactionZ {
2857 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::Transaction> {
2858 if self.datalen == 0 { return Vec::new(); }
2859 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2860 self.data = std::ptr::null_mut();
2864 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::Transaction] {
2865 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2868 impl From<Vec<crate::c_types::Transaction>> for CVec_TransactionZ {
2869 fn from(v: Vec<crate::c_types::Transaction>) -> Self {
2870 let datalen = v.len();
2871 let data = Box::into_raw(v.into_boxed_slice());
2872 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2876 pub extern "C" fn CVec_TransactionZ_free(_res: CVec_TransactionZ) { }
2877 impl Drop for CVec_TransactionZ {
2878 fn drop(&mut self) {
2879 if self.datalen == 0 { return; }
2880 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2884 pub struct C2Tuple_u32TxOutZ {
2886 pub b: crate::c_types::TxOut,
2888 impl From<(u32, crate::c_types::TxOut)> for C2Tuple_u32TxOutZ {
2889 fn from (tup: (u32, crate::c_types::TxOut)) -> Self {
2896 impl C2Tuple_u32TxOutZ {
2897 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (u32, crate::c_types::TxOut) {
2901 impl Clone for C2Tuple_u32TxOutZ {
2902 fn clone(&self) -> Self {
2910 pub extern "C" fn C2Tuple_u32TxOutZ_clone(orig: &C2Tuple_u32TxOutZ) -> C2Tuple_u32TxOutZ { orig.clone() }
2912 pub extern "C" fn C2Tuple_u32TxOutZ_new(a: u32, b: crate::c_types::TxOut) -> C2Tuple_u32TxOutZ {
2913 C2Tuple_u32TxOutZ { a, b, }
2917 pub extern "C" fn C2Tuple_u32TxOutZ_free(_res: C2Tuple_u32TxOutZ) { }
2919 pub struct CVec_C2Tuple_u32TxOutZZ {
2920 pub data: *mut crate::c_types::derived::C2Tuple_u32TxOutZ,
2923 impl CVec_C2Tuple_u32TxOutZZ {
2924 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_u32TxOutZ> {
2925 if self.datalen == 0 { return Vec::new(); }
2926 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2927 self.data = std::ptr::null_mut();
2931 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_u32TxOutZ] {
2932 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2935 impl From<Vec<crate::c_types::derived::C2Tuple_u32TxOutZ>> for CVec_C2Tuple_u32TxOutZZ {
2936 fn from(v: Vec<crate::c_types::derived::C2Tuple_u32TxOutZ>) -> Self {
2937 let datalen = v.len();
2938 let data = Box::into_raw(v.into_boxed_slice());
2939 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
2943 pub extern "C" fn CVec_C2Tuple_u32TxOutZZ_free(_res: CVec_C2Tuple_u32TxOutZZ) { }
2944 impl Drop for CVec_C2Tuple_u32TxOutZZ {
2945 fn drop(&mut self) {
2946 if self.datalen == 0 { return; }
2947 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
2950 impl Clone for CVec_C2Tuple_u32TxOutZZ {
2951 fn clone(&self) -> Self {
2952 let mut res = Vec::new();
2953 if self.datalen == 0 { return Self::from(res); }
2954 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
2959 pub struct C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2960 pub a: crate::c_types::ThirtyTwoBytes,
2961 pub b: crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ,
2963 impl From<(crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ)> for C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2964 fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ)) -> Self {
2971 impl C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2972 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ) {
2977 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 {
2978 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { a, b, }
2982 pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) { }
2984 pub struct CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
2985 pub data: *mut crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ,
2988 impl CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
2989 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ> {
2990 if self.datalen == 0 { return Vec::new(); }
2991 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
2992 self.data = std::ptr::null_mut();
2996 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ] {
2997 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3000 impl From<Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ>> for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
3001 fn from(v: Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ>) -> Self {
3002 let datalen = v.len();
3003 let data = Box::into_raw(v.into_boxed_slice());
3004 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3008 pub extern "C" fn CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res: CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ) { }
3009 impl Drop for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
3010 fn drop(&mut self) {
3011 if self.datalen == 0 { return; }
3012 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3016 pub struct C2Tuple_BlockHashChannelMonitorZ {
3017 pub a: crate::c_types::ThirtyTwoBytes,
3018 pub b: crate::chain::channelmonitor::ChannelMonitor,
3020 impl From<(crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor)> for C2Tuple_BlockHashChannelMonitorZ {
3021 fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor)) -> Self {
3028 impl C2Tuple_BlockHashChannelMonitorZ {
3029 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor) {
3034 pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::chain::channelmonitor::ChannelMonitor) -> C2Tuple_BlockHashChannelMonitorZ {
3035 C2Tuple_BlockHashChannelMonitorZ { a, b, }
3039 pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_free(_res: C2Tuple_BlockHashChannelMonitorZ) { }
3041 pub union CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
3042 pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ,
3043 pub err: *mut crate::ln::msgs::DecodeError,
3046 pub struct CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3047 pub contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr,
3048 pub result_ok: bool,
3051 pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ) -> CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3052 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3053 contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
3054 result: Box::into_raw(Box::new(o)),
3060 pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3061 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3062 contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
3063 err: Box::into_raw(Box::new(e)),
3069 pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ) { }
3070 impl Drop for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3071 fn drop(&mut self) {
3073 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3074 let _ = unsafe { Box::from_raw(self.contents.result) };
3077 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3078 let _ = unsafe { Box::from_raw(self.contents.err) };
3083 impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ, crate::ln::msgs::DecodeError>> for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3084 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ, crate::ln::msgs::DecodeError>) -> Self {
3085 let contents = if o.result_ok {
3086 let result = unsafe { o.contents.result };
3087 unsafe { o.contents.result = std::ptr::null_mut() };
3088 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { result }
3090 let err = unsafe { o.contents.err };
3091 unsafe { o.contents.err = std::ptr::null_mut(); }
3092 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { err }
3096 result_ok: o.result_ok,
3101 pub struct CVec_SpendableOutputDescriptorZ {
3102 pub data: *mut crate::chain::keysinterface::SpendableOutputDescriptor,
3105 impl CVec_SpendableOutputDescriptorZ {
3106 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::chain::keysinterface::SpendableOutputDescriptor> {
3107 if self.datalen == 0 { return Vec::new(); }
3108 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3109 self.data = std::ptr::null_mut();
3113 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::keysinterface::SpendableOutputDescriptor] {
3114 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3117 impl From<Vec<crate::chain::keysinterface::SpendableOutputDescriptor>> for CVec_SpendableOutputDescriptorZ {
3118 fn from(v: Vec<crate::chain::keysinterface::SpendableOutputDescriptor>) -> Self {
3119 let datalen = v.len();
3120 let data = Box::into_raw(v.into_boxed_slice());
3121 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3125 pub extern "C" fn CVec_SpendableOutputDescriptorZ_free(_res: CVec_SpendableOutputDescriptorZ) { }
3126 impl Drop for CVec_SpendableOutputDescriptorZ {
3127 fn drop(&mut self) {
3128 if self.datalen == 0 { return; }
3129 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3132 impl Clone for CVec_SpendableOutputDescriptorZ {
3133 fn clone(&self) -> Self {
3134 let mut res = Vec::new();
3135 if self.datalen == 0 { return Self::from(res); }
3136 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
3141 pub union CResult_TxOutAccessErrorZPtr {
3142 pub result: *mut crate::c_types::TxOut,
3143 pub err: *mut crate::chain::AccessError,
3146 pub struct CResult_TxOutAccessErrorZ {
3147 pub contents: CResult_TxOutAccessErrorZPtr,
3148 pub result_ok: bool,
3151 pub extern "C" fn CResult_TxOutAccessErrorZ_ok(o: crate::c_types::TxOut) -> CResult_TxOutAccessErrorZ {
3152 CResult_TxOutAccessErrorZ {
3153 contents: CResult_TxOutAccessErrorZPtr {
3154 result: Box::into_raw(Box::new(o)),
3160 pub extern "C" fn CResult_TxOutAccessErrorZ_err(e: crate::chain::AccessError) -> CResult_TxOutAccessErrorZ {
3161 CResult_TxOutAccessErrorZ {
3162 contents: CResult_TxOutAccessErrorZPtr {
3163 err: Box::into_raw(Box::new(e)),
3169 pub extern "C" fn CResult_TxOutAccessErrorZ_free(_res: CResult_TxOutAccessErrorZ) { }
3170 impl Drop for CResult_TxOutAccessErrorZ {
3171 fn drop(&mut self) {
3173 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3174 let _ = unsafe { Box::from_raw(self.contents.result) };
3177 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3178 let _ = unsafe { Box::from_raw(self.contents.err) };
3183 impl From<crate::c_types::CResultTempl<crate::c_types::TxOut, crate::chain::AccessError>> for CResult_TxOutAccessErrorZ {
3184 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::TxOut, crate::chain::AccessError>) -> Self {
3185 let contents = if o.result_ok {
3186 let result = unsafe { o.contents.result };
3187 unsafe { o.contents.result = std::ptr::null_mut() };
3188 CResult_TxOutAccessErrorZPtr { result }
3190 let err = unsafe { o.contents.err };
3191 unsafe { o.contents.err = std::ptr::null_mut(); }
3192 CResult_TxOutAccessErrorZPtr { err }
3196 result_ok: o.result_ok,
3200 impl Clone for CResult_TxOutAccessErrorZ {
3201 fn clone(&self) -> Self {
3203 Self { result_ok: true, contents: CResult_TxOutAccessErrorZPtr {
3204 result: Box::into_raw(Box::new(<crate::c_types::TxOut>::clone(unsafe { &*self.contents.result })))
3207 Self { result_ok: false, contents: CResult_TxOutAccessErrorZPtr {
3208 err: Box::into_raw(Box::new(<crate::chain::AccessError>::clone(unsafe { &*self.contents.err })))
3214 pub extern "C" fn CResult_TxOutAccessErrorZ_clone(orig: &CResult_TxOutAccessErrorZ) -> CResult_TxOutAccessErrorZ { orig.clone() }
3216 pub union CResult_NoneAPIErrorZPtr {
3217 /// Note that this value is always NULL, as there are no contents in the OK variant
3218 pub result: *mut std::ffi::c_void,
3219 pub err: *mut crate::util::errors::APIError,
3222 pub struct CResult_NoneAPIErrorZ {
3223 pub contents: CResult_NoneAPIErrorZPtr,
3224 pub result_ok: bool,
3227 pub extern "C" fn CResult_NoneAPIErrorZ_ok() -> CResult_NoneAPIErrorZ {
3228 CResult_NoneAPIErrorZ {
3229 contents: CResult_NoneAPIErrorZPtr {
3230 result: std::ptr::null_mut(),
3236 pub extern "C" fn CResult_NoneAPIErrorZ_err(e: crate::util::errors::APIError) -> CResult_NoneAPIErrorZ {
3237 CResult_NoneAPIErrorZ {
3238 contents: CResult_NoneAPIErrorZPtr {
3239 err: Box::into_raw(Box::new(e)),
3245 pub extern "C" fn CResult_NoneAPIErrorZ_free(_res: CResult_NoneAPIErrorZ) { }
3246 impl Drop for CResult_NoneAPIErrorZ {
3247 fn drop(&mut self) {
3250 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3251 let _ = unsafe { Box::from_raw(self.contents.err) };
3256 impl From<crate::c_types::CResultTempl<u8, crate::util::errors::APIError>> for CResult_NoneAPIErrorZ {
3257 fn from(mut o: crate::c_types::CResultTempl<u8, crate::util::errors::APIError>) -> Self {
3258 let contents = if o.result_ok {
3259 let _ = unsafe { Box::from_raw(o.contents.result) };
3260 o.contents.result = std::ptr::null_mut();
3261 CResult_NoneAPIErrorZPtr { result: std::ptr::null_mut() }
3263 let err = unsafe { o.contents.err };
3264 unsafe { o.contents.err = std::ptr::null_mut(); }
3265 CResult_NoneAPIErrorZPtr { err }
3269 result_ok: o.result_ok,
3273 impl Clone for CResult_NoneAPIErrorZ {
3274 fn clone(&self) -> Self {
3276 Self { result_ok: true, contents: CResult_NoneAPIErrorZPtr {
3277 result: std::ptr::null_mut()
3280 Self { result_ok: false, contents: CResult_NoneAPIErrorZPtr {
3281 err: Box::into_raw(Box::new(<crate::util::errors::APIError>::clone(unsafe { &*self.contents.err })))
3287 pub extern "C" fn CResult_NoneAPIErrorZ_clone(orig: &CResult_NoneAPIErrorZ) -> CResult_NoneAPIErrorZ { orig.clone() }
3289 pub struct CVec_CResult_NoneAPIErrorZZ {
3290 pub data: *mut crate::c_types::derived::CResult_NoneAPIErrorZ,
3293 impl CVec_CResult_NoneAPIErrorZZ {
3294 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::CResult_NoneAPIErrorZ> {
3295 if self.datalen == 0 { return Vec::new(); }
3296 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3297 self.data = std::ptr::null_mut();
3301 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CResult_NoneAPIErrorZ] {
3302 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3305 impl From<Vec<crate::c_types::derived::CResult_NoneAPIErrorZ>> for CVec_CResult_NoneAPIErrorZZ {
3306 fn from(v: Vec<crate::c_types::derived::CResult_NoneAPIErrorZ>) -> Self {
3307 let datalen = v.len();
3308 let data = Box::into_raw(v.into_boxed_slice());
3309 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3313 pub extern "C" fn CVec_CResult_NoneAPIErrorZZ_free(_res: CVec_CResult_NoneAPIErrorZZ) { }
3314 impl Drop for CVec_CResult_NoneAPIErrorZZ {
3315 fn drop(&mut self) {
3316 if self.datalen == 0 { return; }
3317 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3320 impl Clone for CVec_CResult_NoneAPIErrorZZ {
3321 fn clone(&self) -> Self {
3322 let mut res = Vec::new();
3323 if self.datalen == 0 { return Self::from(res); }
3324 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
3329 pub struct CVec_APIErrorZ {
3330 pub data: *mut crate::util::errors::APIError,
3333 impl CVec_APIErrorZ {
3334 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::util::errors::APIError> {
3335 if self.datalen == 0 { return Vec::new(); }
3336 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3337 self.data = std::ptr::null_mut();
3341 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::util::errors::APIError] {
3342 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3345 impl From<Vec<crate::util::errors::APIError>> for CVec_APIErrorZ {
3346 fn from(v: Vec<crate::util::errors::APIError>) -> Self {
3347 let datalen = v.len();
3348 let data = Box::into_raw(v.into_boxed_slice());
3349 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3353 pub extern "C" fn CVec_APIErrorZ_free(_res: CVec_APIErrorZ) { }
3354 impl Drop for CVec_APIErrorZ {
3355 fn drop(&mut self) {
3356 if self.datalen == 0 { return; }
3357 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3360 impl Clone for CVec_APIErrorZ {
3361 fn clone(&self) -> Self {
3362 let mut res = Vec::new();
3363 if self.datalen == 0 { return Self::from(res); }
3364 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
3369 pub struct CVec_ChannelDetailsZ {
3370 pub data: *mut crate::ln::channelmanager::ChannelDetails,
3373 impl CVec_ChannelDetailsZ {
3374 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::channelmanager::ChannelDetails> {
3375 if self.datalen == 0 { return Vec::new(); }
3376 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3377 self.data = std::ptr::null_mut();
3381 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::channelmanager::ChannelDetails] {
3382 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3385 impl From<Vec<crate::ln::channelmanager::ChannelDetails>> for CVec_ChannelDetailsZ {
3386 fn from(v: Vec<crate::ln::channelmanager::ChannelDetails>) -> Self {
3387 let datalen = v.len();
3388 let data = Box::into_raw(v.into_boxed_slice());
3389 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3393 pub extern "C" fn CVec_ChannelDetailsZ_free(_res: CVec_ChannelDetailsZ) { }
3394 impl Drop for CVec_ChannelDetailsZ {
3395 fn drop(&mut self) {
3396 if self.datalen == 0 { return; }
3397 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3400 impl Clone for CVec_ChannelDetailsZ {
3401 fn clone(&self) -> Self {
3402 let mut res = Vec::new();
3403 if self.datalen == 0 { return Self::from(res); }
3404 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
3409 pub union CResult_NonePaymentSendFailureZPtr {
3410 /// Note that this value is always NULL, as there are no contents in the OK variant
3411 pub result: *mut std::ffi::c_void,
3412 pub err: *mut crate::ln::channelmanager::PaymentSendFailure,
3415 pub struct CResult_NonePaymentSendFailureZ {
3416 pub contents: CResult_NonePaymentSendFailureZPtr,
3417 pub result_ok: bool,
3420 pub extern "C" fn CResult_NonePaymentSendFailureZ_ok() -> CResult_NonePaymentSendFailureZ {
3421 CResult_NonePaymentSendFailureZ {
3422 contents: CResult_NonePaymentSendFailureZPtr {
3423 result: std::ptr::null_mut(),
3429 pub extern "C" fn CResult_NonePaymentSendFailureZ_err(e: crate::ln::channelmanager::PaymentSendFailure) -> CResult_NonePaymentSendFailureZ {
3430 CResult_NonePaymentSendFailureZ {
3431 contents: CResult_NonePaymentSendFailureZPtr {
3432 err: Box::into_raw(Box::new(e)),
3438 pub extern "C" fn CResult_NonePaymentSendFailureZ_free(_res: CResult_NonePaymentSendFailureZ) { }
3439 impl Drop for CResult_NonePaymentSendFailureZ {
3440 fn drop(&mut self) {
3443 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3444 let _ = unsafe { Box::from_raw(self.contents.err) };
3449 impl From<crate::c_types::CResultTempl<u8, crate::ln::channelmanager::PaymentSendFailure>> for CResult_NonePaymentSendFailureZ {
3450 fn from(mut o: crate::c_types::CResultTempl<u8, crate::ln::channelmanager::PaymentSendFailure>) -> Self {
3451 let contents = if o.result_ok {
3452 let _ = unsafe { Box::from_raw(o.contents.result) };
3453 o.contents.result = std::ptr::null_mut();
3454 CResult_NonePaymentSendFailureZPtr { result: std::ptr::null_mut() }
3456 let err = unsafe { o.contents.err };
3457 unsafe { o.contents.err = std::ptr::null_mut(); }
3458 CResult_NonePaymentSendFailureZPtr { err }
3462 result_ok: o.result_ok,
3466 impl Clone for CResult_NonePaymentSendFailureZ {
3467 fn clone(&self) -> Self {
3469 Self { result_ok: true, contents: CResult_NonePaymentSendFailureZPtr {
3470 result: std::ptr::null_mut()
3473 Self { result_ok: false, contents: CResult_NonePaymentSendFailureZPtr {
3474 err: Box::into_raw(Box::new(<crate::ln::channelmanager::PaymentSendFailure>::clone(unsafe { &*self.contents.err })))
3480 pub extern "C" fn CResult_NonePaymentSendFailureZ_clone(orig: &CResult_NonePaymentSendFailureZ) -> CResult_NonePaymentSendFailureZ { orig.clone() }
3482 pub struct CVec_ChannelMonitorZ {
3483 pub data: *mut crate::chain::channelmonitor::ChannelMonitor,
3486 impl CVec_ChannelMonitorZ {
3487 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::chain::channelmonitor::ChannelMonitor> {
3488 if self.datalen == 0 { return Vec::new(); }
3489 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3490 self.data = std::ptr::null_mut();
3494 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::channelmonitor::ChannelMonitor] {
3495 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3498 impl From<Vec<crate::chain::channelmonitor::ChannelMonitor>> for CVec_ChannelMonitorZ {
3499 fn from(v: Vec<crate::chain::channelmonitor::ChannelMonitor>) -> Self {
3500 let datalen = v.len();
3501 let data = Box::into_raw(v.into_boxed_slice());
3502 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3506 pub extern "C" fn CVec_ChannelMonitorZ_free(_res: CVec_ChannelMonitorZ) { }
3507 impl Drop for CVec_ChannelMonitorZ {
3508 fn drop(&mut self) {
3509 if self.datalen == 0 { return; }
3510 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3514 pub struct C2Tuple_BlockHashChannelManagerZ {
3515 pub a: crate::c_types::ThirtyTwoBytes,
3516 pub b: crate::ln::channelmanager::ChannelManager,
3518 impl From<(crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)> for C2Tuple_BlockHashChannelManagerZ {
3519 fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)) -> Self {
3526 impl C2Tuple_BlockHashChannelManagerZ {
3527 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager) {
3532 pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::ln::channelmanager::ChannelManager) -> C2Tuple_BlockHashChannelManagerZ {
3533 C2Tuple_BlockHashChannelManagerZ { a, b, }
3537 pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_free(_res: C2Tuple_BlockHashChannelManagerZ) { }
3539 pub union CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3540 pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ,
3541 pub err: *mut crate::ln::msgs::DecodeError,
3544 pub struct CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3545 pub contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr,
3546 pub result_ok: bool,
3549 pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3550 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3551 contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3552 result: Box::into_raw(Box::new(o)),
3558 pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3559 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3560 contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3561 err: Box::into_raw(Box::new(e)),
3567 pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ) { }
3568 impl Drop for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3569 fn drop(&mut self) {
3571 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3572 let _ = unsafe { Box::from_raw(self.contents.result) };
3575 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3576 let _ = unsafe { Box::from_raw(self.contents.err) };
3581 impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ, crate::ln::msgs::DecodeError>> for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3582 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ, crate::ln::msgs::DecodeError>) -> Self {
3583 let contents = if o.result_ok {
3584 let result = unsafe { o.contents.result };
3585 unsafe { o.contents.result = std::ptr::null_mut() };
3586 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { result }
3588 let err = unsafe { o.contents.err };
3589 unsafe { o.contents.err = std::ptr::null_mut(); }
3590 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { err }
3594 result_ok: o.result_ok,
3599 pub union CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3600 pub result: *mut crate::chain::keysinterface::SpendableOutputDescriptor,
3601 pub err: *mut crate::ln::msgs::DecodeError,
3604 pub struct CResult_SpendableOutputDescriptorDecodeErrorZ {
3605 pub contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr,
3606 pub result_ok: bool,
3609 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o: crate::chain::keysinterface::SpendableOutputDescriptor) -> CResult_SpendableOutputDescriptorDecodeErrorZ {
3610 CResult_SpendableOutputDescriptorDecodeErrorZ {
3611 contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3612 result: Box::into_raw(Box::new(o)),
3618 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_SpendableOutputDescriptorDecodeErrorZ {
3619 CResult_SpendableOutputDescriptorDecodeErrorZ {
3620 contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3621 err: Box::into_raw(Box::new(e)),
3627 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res: CResult_SpendableOutputDescriptorDecodeErrorZ) { }
3628 impl Drop for CResult_SpendableOutputDescriptorDecodeErrorZ {
3629 fn drop(&mut self) {
3631 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3632 let _ = unsafe { Box::from_raw(self.contents.result) };
3635 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3636 let _ = unsafe { Box::from_raw(self.contents.err) };
3641 impl From<crate::c_types::CResultTempl<crate::chain::keysinterface::SpendableOutputDescriptor, crate::ln::msgs::DecodeError>> for CResult_SpendableOutputDescriptorDecodeErrorZ {
3642 fn from(mut o: crate::c_types::CResultTempl<crate::chain::keysinterface::SpendableOutputDescriptor, crate::ln::msgs::DecodeError>) -> Self {
3643 let contents = if o.result_ok {
3644 let result = unsafe { o.contents.result };
3645 unsafe { o.contents.result = std::ptr::null_mut() };
3646 CResult_SpendableOutputDescriptorDecodeErrorZPtr { result }
3648 let err = unsafe { o.contents.err };
3649 unsafe { o.contents.err = std::ptr::null_mut(); }
3650 CResult_SpendableOutputDescriptorDecodeErrorZPtr { err }
3654 result_ok: o.result_ok,
3658 impl Clone for CResult_SpendableOutputDescriptorDecodeErrorZ {
3659 fn clone(&self) -> Self {
3661 Self { result_ok: true, contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3662 result: Box::into_raw(Box::new(<crate::chain::keysinterface::SpendableOutputDescriptor>::clone(unsafe { &*self.contents.result })))
3665 Self { result_ok: false, contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3666 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
3672 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig: &CResult_SpendableOutputDescriptorDecodeErrorZ) -> CResult_SpendableOutputDescriptorDecodeErrorZ { orig.clone() }
3674 pub struct C2Tuple_SignatureCVec_SignatureZZ {
3675 pub a: crate::c_types::Signature,
3676 pub b: crate::c_types::derived::CVec_SignatureZ,
3678 impl From<(crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ)> for C2Tuple_SignatureCVec_SignatureZZ {
3679 fn from (tup: (crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ)) -> Self {
3686 impl C2Tuple_SignatureCVec_SignatureZZ {
3687 #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ) {
3691 impl Clone for C2Tuple_SignatureCVec_SignatureZZ {
3692 fn clone(&self) -> Self {
3700 pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_clone(orig: &C2Tuple_SignatureCVec_SignatureZZ) -> C2Tuple_SignatureCVec_SignatureZZ { orig.clone() }
3702 pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_new(a: crate::c_types::Signature, b: crate::c_types::derived::CVec_SignatureZ) -> C2Tuple_SignatureCVec_SignatureZZ {
3703 C2Tuple_SignatureCVec_SignatureZZ { a, b, }
3707 pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_free(_res: C2Tuple_SignatureCVec_SignatureZZ) { }
3709 pub union CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3710 pub result: *mut crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ,
3711 /// Note that this value is always NULL, as there are no contents in the Err variant
3712 pub err: *mut std::ffi::c_void,
3715 pub struct CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3716 pub contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr,
3717 pub result_ok: bool,
3720 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o: crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ) -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3721 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3722 contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3723 result: Box::into_raw(Box::new(o)),
3729 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3730 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3731 contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3732 err: std::ptr::null_mut(),
3738 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ) { }
3739 impl Drop for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3740 fn drop(&mut self) {
3742 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3743 let _ = unsafe { Box::from_raw(self.contents.result) };
3749 impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ, u8>> for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3750 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ, u8>) -> Self {
3751 let contents = if o.result_ok {
3752 let result = unsafe { o.contents.result };
3753 unsafe { o.contents.result = std::ptr::null_mut() };
3754 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { result }
3756 let _ = unsafe { Box::from_raw(o.contents.err) };
3757 o.contents.err = std::ptr::null_mut();
3758 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { err: std::ptr::null_mut() }
3762 result_ok: o.result_ok,
3766 impl Clone for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3767 fn clone(&self) -> Self {
3769 Self { result_ok: true, contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3770 result: Box::into_raw(Box::new(<crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ>::clone(unsafe { &*self.contents.result })))
3773 Self { result_ok: false, contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3774 err: std::ptr::null_mut()
3780 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig: &CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ) -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { orig.clone() }
3782 pub union CResult_SignatureNoneZPtr {
3783 pub result: *mut crate::c_types::Signature,
3784 /// Note that this value is always NULL, as there are no contents in the Err variant
3785 pub err: *mut std::ffi::c_void,
3788 pub struct CResult_SignatureNoneZ {
3789 pub contents: CResult_SignatureNoneZPtr,
3790 pub result_ok: bool,
3793 pub extern "C" fn CResult_SignatureNoneZ_ok(o: crate::c_types::Signature) -> CResult_SignatureNoneZ {
3794 CResult_SignatureNoneZ {
3795 contents: CResult_SignatureNoneZPtr {
3796 result: Box::into_raw(Box::new(o)),
3802 pub extern "C" fn CResult_SignatureNoneZ_err() -> CResult_SignatureNoneZ {
3803 CResult_SignatureNoneZ {
3804 contents: CResult_SignatureNoneZPtr {
3805 err: std::ptr::null_mut(),
3811 pub extern "C" fn CResult_SignatureNoneZ_free(_res: CResult_SignatureNoneZ) { }
3812 impl Drop for CResult_SignatureNoneZ {
3813 fn drop(&mut self) {
3815 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3816 let _ = unsafe { Box::from_raw(self.contents.result) };
3822 impl From<crate::c_types::CResultTempl<crate::c_types::Signature, u8>> for CResult_SignatureNoneZ {
3823 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::Signature, u8>) -> Self {
3824 let contents = if o.result_ok {
3825 let result = unsafe { o.contents.result };
3826 unsafe { o.contents.result = std::ptr::null_mut() };
3827 CResult_SignatureNoneZPtr { result }
3829 let _ = unsafe { Box::from_raw(o.contents.err) };
3830 o.contents.err = std::ptr::null_mut();
3831 CResult_SignatureNoneZPtr { err: std::ptr::null_mut() }
3835 result_ok: o.result_ok,
3839 impl Clone for CResult_SignatureNoneZ {
3840 fn clone(&self) -> Self {
3842 Self { result_ok: true, contents: CResult_SignatureNoneZPtr {
3843 result: Box::into_raw(Box::new(<crate::c_types::Signature>::clone(unsafe { &*self.contents.result })))
3846 Self { result_ok: false, contents: CResult_SignatureNoneZPtr {
3847 err: std::ptr::null_mut()
3853 pub extern "C" fn CResult_SignatureNoneZ_clone(orig: &CResult_SignatureNoneZ) -> CResult_SignatureNoneZ { orig.clone() }
3855 pub union CResult_ChannelKeysDecodeErrorZPtr {
3856 pub result: *mut crate::chain::keysinterface::ChannelKeys,
3857 pub err: *mut crate::ln::msgs::DecodeError,
3860 pub struct CResult_ChannelKeysDecodeErrorZ {
3861 pub contents: CResult_ChannelKeysDecodeErrorZPtr,
3862 pub result_ok: bool,
3865 pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_ok(o: crate::chain::keysinterface::ChannelKeys) -> CResult_ChannelKeysDecodeErrorZ {
3866 CResult_ChannelKeysDecodeErrorZ {
3867 contents: CResult_ChannelKeysDecodeErrorZPtr {
3868 result: Box::into_raw(Box::new(o)),
3874 pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelKeysDecodeErrorZ {
3875 CResult_ChannelKeysDecodeErrorZ {
3876 contents: CResult_ChannelKeysDecodeErrorZPtr {
3877 err: Box::into_raw(Box::new(e)),
3883 pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_free(_res: CResult_ChannelKeysDecodeErrorZ) { }
3884 impl Drop for CResult_ChannelKeysDecodeErrorZ {
3885 fn drop(&mut self) {
3887 if unsafe { !(self.contents.result as *mut ()).is_null() } {
3888 let _ = unsafe { Box::from_raw(self.contents.result) };
3891 if unsafe { !(self.contents.err as *mut ()).is_null() } {
3892 let _ = unsafe { Box::from_raw(self.contents.err) };
3897 impl From<crate::c_types::CResultTempl<crate::chain::keysinterface::ChannelKeys, crate::ln::msgs::DecodeError>> for CResult_ChannelKeysDecodeErrorZ {
3898 fn from(mut o: crate::c_types::CResultTempl<crate::chain::keysinterface::ChannelKeys, crate::ln::msgs::DecodeError>) -> Self {
3899 let contents = if o.result_ok {
3900 let result = unsafe { o.contents.result };
3901 unsafe { o.contents.result = std::ptr::null_mut() };
3902 CResult_ChannelKeysDecodeErrorZPtr { result }
3904 let err = unsafe { o.contents.err };
3905 unsafe { o.contents.err = std::ptr::null_mut(); }
3906 CResult_ChannelKeysDecodeErrorZPtr { err }
3910 result_ok: o.result_ok,
3914 impl Clone for CResult_ChannelKeysDecodeErrorZ {
3915 fn clone(&self) -> Self {
3917 Self { result_ok: true, contents: CResult_ChannelKeysDecodeErrorZPtr {
3918 result: Box::into_raw(Box::new(<crate::chain::keysinterface::ChannelKeys>::clone(unsafe { &*self.contents.result })))
3921 Self { result_ok: false, contents: CResult_ChannelKeysDecodeErrorZPtr {
3922 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
3928 pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_clone(orig: &CResult_ChannelKeysDecodeErrorZ) -> CResult_ChannelKeysDecodeErrorZ { orig.clone() }
3930 pub struct CVec_CVec_u8ZZ {
3931 pub data: *mut crate::c_types::derived::CVec_u8Z,
3934 impl CVec_CVec_u8ZZ {
3935 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::CVec_u8Z> {
3936 if self.datalen == 0 { return Vec::new(); }
3937 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3938 self.data = std::ptr::null_mut();
3942 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CVec_u8Z] {
3943 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3946 impl From<Vec<crate::c_types::derived::CVec_u8Z>> for CVec_CVec_u8ZZ {
3947 fn from(v: Vec<crate::c_types::derived::CVec_u8Z>) -> Self {
3948 let datalen = v.len();
3949 let data = Box::into_raw(v.into_boxed_slice());
3950 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3954 pub extern "C" fn CVec_CVec_u8ZZ_free(_res: CVec_CVec_u8ZZ) { }
3955 impl Drop for CVec_CVec_u8ZZ {
3956 fn drop(&mut self) {
3957 if self.datalen == 0 { return; }
3958 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3961 impl Clone for CVec_CVec_u8ZZ {
3962 fn clone(&self) -> Self {
3963 let mut res = Vec::new();
3964 if self.datalen == 0 { return Self::from(res); }
3965 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
3970 pub union CResult_CVec_CVec_u8ZZNoneZPtr {
3971 pub result: *mut crate::c_types::derived::CVec_CVec_u8ZZ,
3972 /// Note that this value is always NULL, as there are no contents in the Err variant
3973 pub err: *mut std::ffi::c_void,
3976 pub struct CResult_CVec_CVec_u8ZZNoneZ {
3977 pub contents: CResult_CVec_CVec_u8ZZNoneZPtr,
3978 pub result_ok: bool,
3981 pub extern "C" fn CResult_CVec_CVec_u8ZZNoneZ_ok(o: crate::c_types::derived::CVec_CVec_u8ZZ) -> CResult_CVec_CVec_u8ZZNoneZ {
3982 CResult_CVec_CVec_u8ZZNoneZ {
3983 contents: CResult_CVec_CVec_u8ZZNoneZPtr {
3984 result: Box::into_raw(Box::new(o)),
3990 pub extern "C" fn CResult_CVec_CVec_u8ZZNoneZ_err() -> CResult_CVec_CVec_u8ZZNoneZ {
3991 CResult_CVec_CVec_u8ZZNoneZ {
3992 contents: CResult_CVec_CVec_u8ZZNoneZPtr {
3993 err: std::ptr::null_mut(),
3999 pub extern "C" fn CResult_CVec_CVec_u8ZZNoneZ_free(_res: CResult_CVec_CVec_u8ZZNoneZ) { }
4000 impl Drop for CResult_CVec_CVec_u8ZZNoneZ {
4001 fn drop(&mut self) {
4003 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4004 let _ = unsafe { Box::from_raw(self.contents.result) };
4010 impl From<crate::c_types::CResultTempl<crate::c_types::derived::CVec_CVec_u8ZZ, u8>> for CResult_CVec_CVec_u8ZZNoneZ {
4011 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CVec_CVec_u8ZZ, u8>) -> Self {
4012 let contents = if o.result_ok {
4013 let result = unsafe { o.contents.result };
4014 unsafe { o.contents.result = std::ptr::null_mut() };
4015 CResult_CVec_CVec_u8ZZNoneZPtr { result }
4017 let _ = unsafe { Box::from_raw(o.contents.err) };
4018 o.contents.err = std::ptr::null_mut();
4019 CResult_CVec_CVec_u8ZZNoneZPtr { err: std::ptr::null_mut() }
4023 result_ok: o.result_ok,
4027 impl Clone for CResult_CVec_CVec_u8ZZNoneZ {
4028 fn clone(&self) -> Self {
4030 Self { result_ok: true, contents: CResult_CVec_CVec_u8ZZNoneZPtr {
4031 result: Box::into_raw(Box::new(<crate::c_types::derived::CVec_CVec_u8ZZ>::clone(unsafe { &*self.contents.result })))
4034 Self { result_ok: false, contents: CResult_CVec_CVec_u8ZZNoneZPtr {
4035 err: std::ptr::null_mut()
4041 pub extern "C" fn CResult_CVec_CVec_u8ZZNoneZ_clone(orig: &CResult_CVec_CVec_u8ZZNoneZ) -> CResult_CVec_CVec_u8ZZNoneZ { orig.clone() }
4043 pub union CResult_InMemoryChannelKeysDecodeErrorZPtr {
4044 pub result: *mut crate::chain::keysinterface::InMemoryChannelKeys,
4045 pub err: *mut crate::ln::msgs::DecodeError,
4048 pub struct CResult_InMemoryChannelKeysDecodeErrorZ {
4049 pub contents: CResult_InMemoryChannelKeysDecodeErrorZPtr,
4050 pub result_ok: bool,
4053 pub extern "C" fn CResult_InMemoryChannelKeysDecodeErrorZ_ok(o: crate::chain::keysinterface::InMemoryChannelKeys) -> CResult_InMemoryChannelKeysDecodeErrorZ {
4054 CResult_InMemoryChannelKeysDecodeErrorZ {
4055 contents: CResult_InMemoryChannelKeysDecodeErrorZPtr {
4056 result: Box::into_raw(Box::new(o)),
4062 pub extern "C" fn CResult_InMemoryChannelKeysDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InMemoryChannelKeysDecodeErrorZ {
4063 CResult_InMemoryChannelKeysDecodeErrorZ {
4064 contents: CResult_InMemoryChannelKeysDecodeErrorZPtr {
4065 err: Box::into_raw(Box::new(e)),
4071 pub extern "C" fn CResult_InMemoryChannelKeysDecodeErrorZ_free(_res: CResult_InMemoryChannelKeysDecodeErrorZ) { }
4072 impl Drop for CResult_InMemoryChannelKeysDecodeErrorZ {
4073 fn drop(&mut self) {
4075 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4076 let _ = unsafe { Box::from_raw(self.contents.result) };
4079 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4080 let _ = unsafe { Box::from_raw(self.contents.err) };
4085 impl From<crate::c_types::CResultTempl<crate::chain::keysinterface::InMemoryChannelKeys, crate::ln::msgs::DecodeError>> for CResult_InMemoryChannelKeysDecodeErrorZ {
4086 fn from(mut o: crate::c_types::CResultTempl<crate::chain::keysinterface::InMemoryChannelKeys, crate::ln::msgs::DecodeError>) -> Self {
4087 let contents = if o.result_ok {
4088 let result = unsafe { o.contents.result };
4089 unsafe { o.contents.result = std::ptr::null_mut() };
4090 CResult_InMemoryChannelKeysDecodeErrorZPtr { result }
4092 let err = unsafe { o.contents.err };
4093 unsafe { o.contents.err = std::ptr::null_mut(); }
4094 CResult_InMemoryChannelKeysDecodeErrorZPtr { err }
4098 result_ok: o.result_ok,
4102 impl Clone for CResult_InMemoryChannelKeysDecodeErrorZ {
4103 fn clone(&self) -> Self {
4105 Self { result_ok: true, contents: CResult_InMemoryChannelKeysDecodeErrorZPtr {
4106 result: Box::into_raw(Box::new(<crate::chain::keysinterface::InMemoryChannelKeys>::clone(unsafe { &*self.contents.result })))
4109 Self { result_ok: false, contents: CResult_InMemoryChannelKeysDecodeErrorZPtr {
4110 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4116 pub extern "C" fn CResult_InMemoryChannelKeysDecodeErrorZ_clone(orig: &CResult_InMemoryChannelKeysDecodeErrorZ) -> CResult_InMemoryChannelKeysDecodeErrorZ { orig.clone() }
4118 pub struct CVec_TxOutZ {
4119 pub data: *mut crate::c_types::TxOut,
4123 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::TxOut> {
4124 if self.datalen == 0 { return Vec::new(); }
4125 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4126 self.data = std::ptr::null_mut();
4130 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::TxOut] {
4131 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4134 impl From<Vec<crate::c_types::TxOut>> for CVec_TxOutZ {
4135 fn from(v: Vec<crate::c_types::TxOut>) -> Self {
4136 let datalen = v.len();
4137 let data = Box::into_raw(v.into_boxed_slice());
4138 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4142 pub extern "C" fn CVec_TxOutZ_free(_res: CVec_TxOutZ) { }
4143 impl Drop for CVec_TxOutZ {
4144 fn drop(&mut self) {
4145 if self.datalen == 0 { return; }
4146 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4149 impl Clone for CVec_TxOutZ {
4150 fn clone(&self) -> Self {
4151 let mut res = Vec::new();
4152 if self.datalen == 0 { return Self::from(res); }
4153 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4158 pub union CResult_TransactionNoneZPtr {
4159 pub result: *mut crate::c_types::Transaction,
4160 /// Note that this value is always NULL, as there are no contents in the Err variant
4161 pub err: *mut std::ffi::c_void,
4164 pub struct CResult_TransactionNoneZ {
4165 pub contents: CResult_TransactionNoneZPtr,
4166 pub result_ok: bool,
4169 pub extern "C" fn CResult_TransactionNoneZ_ok(o: crate::c_types::Transaction) -> CResult_TransactionNoneZ {
4170 CResult_TransactionNoneZ {
4171 contents: CResult_TransactionNoneZPtr {
4172 result: Box::into_raw(Box::new(o)),
4178 pub extern "C" fn CResult_TransactionNoneZ_err() -> CResult_TransactionNoneZ {
4179 CResult_TransactionNoneZ {
4180 contents: CResult_TransactionNoneZPtr {
4181 err: std::ptr::null_mut(),
4187 pub extern "C" fn CResult_TransactionNoneZ_free(_res: CResult_TransactionNoneZ) { }
4188 impl Drop for CResult_TransactionNoneZ {
4189 fn drop(&mut self) {
4191 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4192 let _ = unsafe { Box::from_raw(self.contents.result) };
4198 impl From<crate::c_types::CResultTempl<crate::c_types::Transaction, u8>> for CResult_TransactionNoneZ {
4199 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::Transaction, u8>) -> Self {
4200 let contents = if o.result_ok {
4201 let result = unsafe { o.contents.result };
4202 unsafe { o.contents.result = std::ptr::null_mut() };
4203 CResult_TransactionNoneZPtr { result }
4205 let _ = unsafe { Box::from_raw(o.contents.err) };
4206 o.contents.err = std::ptr::null_mut();
4207 CResult_TransactionNoneZPtr { err: std::ptr::null_mut() }
4211 result_ok: o.result_ok,
4216 pub struct CVec_RouteHopZ {
4217 pub data: *mut crate::routing::router::RouteHop,
4220 impl CVec_RouteHopZ {
4221 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::routing::router::RouteHop> {
4222 if self.datalen == 0 { return Vec::new(); }
4223 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4224 self.data = std::ptr::null_mut();
4228 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::routing::router::RouteHop] {
4229 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4232 impl From<Vec<crate::routing::router::RouteHop>> for CVec_RouteHopZ {
4233 fn from(v: Vec<crate::routing::router::RouteHop>) -> Self {
4234 let datalen = v.len();
4235 let data = Box::into_raw(v.into_boxed_slice());
4236 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4240 pub extern "C" fn CVec_RouteHopZ_free(_res: CVec_RouteHopZ) { }
4241 impl Drop for CVec_RouteHopZ {
4242 fn drop(&mut self) {
4243 if self.datalen == 0 { return; }
4244 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4247 impl Clone for CVec_RouteHopZ {
4248 fn clone(&self) -> Self {
4249 let mut res = Vec::new();
4250 if self.datalen == 0 { return Self::from(res); }
4251 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4256 pub struct CVec_CVec_RouteHopZZ {
4257 pub data: *mut crate::c_types::derived::CVec_RouteHopZ,
4260 impl CVec_CVec_RouteHopZZ {
4261 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::CVec_RouteHopZ> {
4262 if self.datalen == 0 { return Vec::new(); }
4263 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4264 self.data = std::ptr::null_mut();
4268 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CVec_RouteHopZ] {
4269 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4272 impl From<Vec<crate::c_types::derived::CVec_RouteHopZ>> for CVec_CVec_RouteHopZZ {
4273 fn from(v: Vec<crate::c_types::derived::CVec_RouteHopZ>) -> Self {
4274 let datalen = v.len();
4275 let data = Box::into_raw(v.into_boxed_slice());
4276 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4280 pub extern "C" fn CVec_CVec_RouteHopZZ_free(_res: CVec_CVec_RouteHopZZ) { }
4281 impl Drop for CVec_CVec_RouteHopZZ {
4282 fn drop(&mut self) {
4283 if self.datalen == 0 { return; }
4284 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4287 impl Clone for CVec_CVec_RouteHopZZ {
4288 fn clone(&self) -> Self {
4289 let mut res = Vec::new();
4290 if self.datalen == 0 { return Self::from(res); }
4291 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4296 pub union CResult_RouteDecodeErrorZPtr {
4297 pub result: *mut crate::routing::router::Route,
4298 pub err: *mut crate::ln::msgs::DecodeError,
4301 pub struct CResult_RouteDecodeErrorZ {
4302 pub contents: CResult_RouteDecodeErrorZPtr,
4303 pub result_ok: bool,
4306 pub extern "C" fn CResult_RouteDecodeErrorZ_ok(o: crate::routing::router::Route) -> CResult_RouteDecodeErrorZ {
4307 CResult_RouteDecodeErrorZ {
4308 contents: CResult_RouteDecodeErrorZPtr {
4309 result: Box::into_raw(Box::new(o)),
4315 pub extern "C" fn CResult_RouteDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RouteDecodeErrorZ {
4316 CResult_RouteDecodeErrorZ {
4317 contents: CResult_RouteDecodeErrorZPtr {
4318 err: Box::into_raw(Box::new(e)),
4324 pub extern "C" fn CResult_RouteDecodeErrorZ_free(_res: CResult_RouteDecodeErrorZ) { }
4325 impl Drop for CResult_RouteDecodeErrorZ {
4326 fn drop(&mut self) {
4328 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4329 let _ = unsafe { Box::from_raw(self.contents.result) };
4332 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4333 let _ = unsafe { Box::from_raw(self.contents.err) };
4338 impl From<crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::DecodeError>> for CResult_RouteDecodeErrorZ {
4339 fn from(mut o: crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::DecodeError>) -> Self {
4340 let contents = if o.result_ok {
4341 let result = unsafe { o.contents.result };
4342 unsafe { o.contents.result = std::ptr::null_mut() };
4343 CResult_RouteDecodeErrorZPtr { result }
4345 let err = unsafe { o.contents.err };
4346 unsafe { o.contents.err = std::ptr::null_mut(); }
4347 CResult_RouteDecodeErrorZPtr { err }
4351 result_ok: o.result_ok,
4355 impl Clone for CResult_RouteDecodeErrorZ {
4356 fn clone(&self) -> Self {
4358 Self { result_ok: true, contents: CResult_RouteDecodeErrorZPtr {
4359 result: Box::into_raw(Box::new(<crate::routing::router::Route>::clone(unsafe { &*self.contents.result })))
4362 Self { result_ok: false, contents: CResult_RouteDecodeErrorZPtr {
4363 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4369 pub extern "C" fn CResult_RouteDecodeErrorZ_clone(orig: &CResult_RouteDecodeErrorZ) -> CResult_RouteDecodeErrorZ { orig.clone() }
4371 pub struct CVec_RouteHintZ {
4372 pub data: *mut crate::routing::router::RouteHint,
4375 impl CVec_RouteHintZ {
4376 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::routing::router::RouteHint> {
4377 if self.datalen == 0 { return Vec::new(); }
4378 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4379 self.data = std::ptr::null_mut();
4383 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::routing::router::RouteHint] {
4384 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4387 impl From<Vec<crate::routing::router::RouteHint>> for CVec_RouteHintZ {
4388 fn from(v: Vec<crate::routing::router::RouteHint>) -> Self {
4389 let datalen = v.len();
4390 let data = Box::into_raw(v.into_boxed_slice());
4391 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4395 pub extern "C" fn CVec_RouteHintZ_free(_res: CVec_RouteHintZ) { }
4396 impl Drop for CVec_RouteHintZ {
4397 fn drop(&mut self) {
4398 if self.datalen == 0 { return; }
4399 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4402 impl Clone for CVec_RouteHintZ {
4403 fn clone(&self) -> Self {
4404 let mut res = Vec::new();
4405 if self.datalen == 0 { return Self::from(res); }
4406 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4411 pub union CResult_RouteLightningErrorZPtr {
4412 pub result: *mut crate::routing::router::Route,
4413 pub err: *mut crate::ln::msgs::LightningError,
4416 pub struct CResult_RouteLightningErrorZ {
4417 pub contents: CResult_RouteLightningErrorZPtr,
4418 pub result_ok: bool,
4421 pub extern "C" fn CResult_RouteLightningErrorZ_ok(o: crate::routing::router::Route) -> CResult_RouteLightningErrorZ {
4422 CResult_RouteLightningErrorZ {
4423 contents: CResult_RouteLightningErrorZPtr {
4424 result: Box::into_raw(Box::new(o)),
4430 pub extern "C" fn CResult_RouteLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_RouteLightningErrorZ {
4431 CResult_RouteLightningErrorZ {
4432 contents: CResult_RouteLightningErrorZPtr {
4433 err: Box::into_raw(Box::new(e)),
4439 pub extern "C" fn CResult_RouteLightningErrorZ_free(_res: CResult_RouteLightningErrorZ) { }
4440 impl Drop for CResult_RouteLightningErrorZ {
4441 fn drop(&mut self) {
4443 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4444 let _ = unsafe { Box::from_raw(self.contents.result) };
4447 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4448 let _ = unsafe { Box::from_raw(self.contents.err) };
4453 impl From<crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::LightningError>> for CResult_RouteLightningErrorZ {
4454 fn from(mut o: crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::LightningError>) -> Self {
4455 let contents = if o.result_ok {
4456 let result = unsafe { o.contents.result };
4457 unsafe { o.contents.result = std::ptr::null_mut() };
4458 CResult_RouteLightningErrorZPtr { result }
4460 let err = unsafe { o.contents.err };
4461 unsafe { o.contents.err = std::ptr::null_mut(); }
4462 CResult_RouteLightningErrorZPtr { err }
4466 result_ok: o.result_ok,
4470 impl Clone for CResult_RouteLightningErrorZ {
4471 fn clone(&self) -> Self {
4473 Self { result_ok: true, contents: CResult_RouteLightningErrorZPtr {
4474 result: Box::into_raw(Box::new(<crate::routing::router::Route>::clone(unsafe { &*self.contents.result })))
4477 Self { result_ok: false, contents: CResult_RouteLightningErrorZPtr {
4478 err: Box::into_raw(Box::new(<crate::ln::msgs::LightningError>::clone(unsafe { &*self.contents.err })))
4484 pub extern "C" fn CResult_RouteLightningErrorZ_clone(orig: &CResult_RouteLightningErrorZ) -> CResult_RouteLightningErrorZ { orig.clone() }
4486 pub union CResult_NetAddressu8ZPtr {
4487 pub result: *mut crate::ln::msgs::NetAddress,
4491 pub struct CResult_NetAddressu8Z {
4492 pub contents: CResult_NetAddressu8ZPtr,
4493 pub result_ok: bool,
4496 pub extern "C" fn CResult_NetAddressu8Z_ok(o: crate::ln::msgs::NetAddress) -> CResult_NetAddressu8Z {
4497 CResult_NetAddressu8Z {
4498 contents: CResult_NetAddressu8ZPtr {
4499 result: Box::into_raw(Box::new(o)),
4505 pub extern "C" fn CResult_NetAddressu8Z_err(e: u8) -> CResult_NetAddressu8Z {
4506 CResult_NetAddressu8Z {
4507 contents: CResult_NetAddressu8ZPtr {
4508 err: Box::into_raw(Box::new(e)),
4514 pub extern "C" fn CResult_NetAddressu8Z_free(_res: CResult_NetAddressu8Z) { }
4515 impl Drop for CResult_NetAddressu8Z {
4516 fn drop(&mut self) {
4518 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4519 let _ = unsafe { Box::from_raw(self.contents.result) };
4522 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4523 let _ = unsafe { Box::from_raw(self.contents.err) };
4528 impl From<crate::c_types::CResultTempl<crate::ln::msgs::NetAddress, u8>> for CResult_NetAddressu8Z {
4529 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::NetAddress, u8>) -> Self {
4530 let contents = if o.result_ok {
4531 let result = unsafe { o.contents.result };
4532 unsafe { o.contents.result = std::ptr::null_mut() };
4533 CResult_NetAddressu8ZPtr { result }
4535 let err = unsafe { o.contents.err };
4536 unsafe { o.contents.err = std::ptr::null_mut(); }
4537 CResult_NetAddressu8ZPtr { err }
4541 result_ok: o.result_ok,
4545 impl Clone for CResult_NetAddressu8Z {
4546 fn clone(&self) -> Self {
4548 Self { result_ok: true, contents: CResult_NetAddressu8ZPtr {
4549 result: Box::into_raw(Box::new(<crate::ln::msgs::NetAddress>::clone(unsafe { &*self.contents.result })))
4552 Self { result_ok: false, contents: CResult_NetAddressu8ZPtr {
4553 err: Box::into_raw(Box::new(<u8>::clone(unsafe { &*self.contents.err })))
4559 pub extern "C" fn CResult_NetAddressu8Z_clone(orig: &CResult_NetAddressu8Z) -> CResult_NetAddressu8Z { orig.clone() }
4561 pub union CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4562 pub result: *mut crate::c_types::derived::CResult_NetAddressu8Z,
4563 pub err: *mut crate::ln::msgs::DecodeError,
4566 pub struct CResult_CResult_NetAddressu8ZDecodeErrorZ {
4567 pub contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr,
4568 pub result_ok: bool,
4571 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o: crate::c_types::derived::CResult_NetAddressu8Z) -> CResult_CResult_NetAddressu8ZDecodeErrorZ {
4572 CResult_CResult_NetAddressu8ZDecodeErrorZ {
4573 contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4574 result: Box::into_raw(Box::new(o)),
4580 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CResult_NetAddressu8ZDecodeErrorZ {
4581 CResult_CResult_NetAddressu8ZDecodeErrorZ {
4582 contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4583 err: Box::into_raw(Box::new(e)),
4589 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res: CResult_CResult_NetAddressu8ZDecodeErrorZ) { }
4590 impl Drop for CResult_CResult_NetAddressu8ZDecodeErrorZ {
4591 fn drop(&mut self) {
4593 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4594 let _ = unsafe { Box::from_raw(self.contents.result) };
4597 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4598 let _ = unsafe { Box::from_raw(self.contents.err) };
4603 impl From<crate::c_types::CResultTempl<crate::c_types::derived::CResult_NetAddressu8Z, crate::ln::msgs::DecodeError>> for CResult_CResult_NetAddressu8ZDecodeErrorZ {
4604 fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CResult_NetAddressu8Z, crate::ln::msgs::DecodeError>) -> Self {
4605 let contents = if o.result_ok {
4606 let result = unsafe { o.contents.result };
4607 unsafe { o.contents.result = std::ptr::null_mut() };
4608 CResult_CResult_NetAddressu8ZDecodeErrorZPtr { result }
4610 let err = unsafe { o.contents.err };
4611 unsafe { o.contents.err = std::ptr::null_mut(); }
4612 CResult_CResult_NetAddressu8ZDecodeErrorZPtr { err }
4616 result_ok: o.result_ok,
4620 impl Clone for CResult_CResult_NetAddressu8ZDecodeErrorZ {
4621 fn clone(&self) -> Self {
4623 Self { result_ok: true, contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4624 result: Box::into_raw(Box::new(<crate::c_types::derived::CResult_NetAddressu8Z>::clone(unsafe { &*self.contents.result })))
4627 Self { result_ok: false, contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4628 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4634 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig: &CResult_CResult_NetAddressu8ZDecodeErrorZ) -> CResult_CResult_NetAddressu8ZDecodeErrorZ { orig.clone() }
4636 pub struct CVec_UpdateAddHTLCZ {
4637 pub data: *mut crate::ln::msgs::UpdateAddHTLC,
4640 impl CVec_UpdateAddHTLCZ {
4641 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateAddHTLC> {
4642 if self.datalen == 0 { return Vec::new(); }
4643 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4644 self.data = std::ptr::null_mut();
4648 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateAddHTLC] {
4649 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4652 impl From<Vec<crate::ln::msgs::UpdateAddHTLC>> for CVec_UpdateAddHTLCZ {
4653 fn from(v: Vec<crate::ln::msgs::UpdateAddHTLC>) -> Self {
4654 let datalen = v.len();
4655 let data = Box::into_raw(v.into_boxed_slice());
4656 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4660 pub extern "C" fn CVec_UpdateAddHTLCZ_free(_res: CVec_UpdateAddHTLCZ) { }
4661 impl Drop for CVec_UpdateAddHTLCZ {
4662 fn drop(&mut self) {
4663 if self.datalen == 0 { return; }
4664 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4667 impl Clone for CVec_UpdateAddHTLCZ {
4668 fn clone(&self) -> Self {
4669 let mut res = Vec::new();
4670 if self.datalen == 0 { return Self::from(res); }
4671 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4676 pub struct CVec_UpdateFulfillHTLCZ {
4677 pub data: *mut crate::ln::msgs::UpdateFulfillHTLC,
4680 impl CVec_UpdateFulfillHTLCZ {
4681 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateFulfillHTLC> {
4682 if self.datalen == 0 { return Vec::new(); }
4683 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4684 self.data = std::ptr::null_mut();
4688 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateFulfillHTLC] {
4689 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4692 impl From<Vec<crate::ln::msgs::UpdateFulfillHTLC>> for CVec_UpdateFulfillHTLCZ {
4693 fn from(v: Vec<crate::ln::msgs::UpdateFulfillHTLC>) -> Self {
4694 let datalen = v.len();
4695 let data = Box::into_raw(v.into_boxed_slice());
4696 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4700 pub extern "C" fn CVec_UpdateFulfillHTLCZ_free(_res: CVec_UpdateFulfillHTLCZ) { }
4701 impl Drop for CVec_UpdateFulfillHTLCZ {
4702 fn drop(&mut self) {
4703 if self.datalen == 0 { return; }
4704 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4707 impl Clone for CVec_UpdateFulfillHTLCZ {
4708 fn clone(&self) -> Self {
4709 let mut res = Vec::new();
4710 if self.datalen == 0 { return Self::from(res); }
4711 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4716 pub struct CVec_UpdateFailHTLCZ {
4717 pub data: *mut crate::ln::msgs::UpdateFailHTLC,
4720 impl CVec_UpdateFailHTLCZ {
4721 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateFailHTLC> {
4722 if self.datalen == 0 { return Vec::new(); }
4723 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4724 self.data = std::ptr::null_mut();
4728 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateFailHTLC] {
4729 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4732 impl From<Vec<crate::ln::msgs::UpdateFailHTLC>> for CVec_UpdateFailHTLCZ {
4733 fn from(v: Vec<crate::ln::msgs::UpdateFailHTLC>) -> Self {
4734 let datalen = v.len();
4735 let data = Box::into_raw(v.into_boxed_slice());
4736 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4740 pub extern "C" fn CVec_UpdateFailHTLCZ_free(_res: CVec_UpdateFailHTLCZ) { }
4741 impl Drop for CVec_UpdateFailHTLCZ {
4742 fn drop(&mut self) {
4743 if self.datalen == 0 { return; }
4744 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4747 impl Clone for CVec_UpdateFailHTLCZ {
4748 fn clone(&self) -> Self {
4749 let mut res = Vec::new();
4750 if self.datalen == 0 { return Self::from(res); }
4751 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4756 pub struct CVec_UpdateFailMalformedHTLCZ {
4757 pub data: *mut crate::ln::msgs::UpdateFailMalformedHTLC,
4760 impl CVec_UpdateFailMalformedHTLCZ {
4761 #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateFailMalformedHTLC> {
4762 if self.datalen == 0 { return Vec::new(); }
4763 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4764 self.data = std::ptr::null_mut();
4768 #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateFailMalformedHTLC] {
4769 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4772 impl From<Vec<crate::ln::msgs::UpdateFailMalformedHTLC>> for CVec_UpdateFailMalformedHTLCZ {
4773 fn from(v: Vec<crate::ln::msgs::UpdateFailMalformedHTLC>) -> Self {
4774 let datalen = v.len();
4775 let data = Box::into_raw(v.into_boxed_slice());
4776 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4780 pub extern "C" fn CVec_UpdateFailMalformedHTLCZ_free(_res: CVec_UpdateFailMalformedHTLCZ) { }
4781 impl Drop for CVec_UpdateFailMalformedHTLCZ {
4782 fn drop(&mut self) {
4783 if self.datalen == 0 { return; }
4784 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4787 impl Clone for CVec_UpdateFailMalformedHTLCZ {
4788 fn clone(&self) -> Self {
4789 let mut res = Vec::new();
4790 if self.datalen == 0 { return Self::from(res); }
4791 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4796 pub union CResult_AcceptChannelDecodeErrorZPtr {
4797 pub result: *mut crate::ln::msgs::AcceptChannel,
4798 pub err: *mut crate::ln::msgs::DecodeError,
4801 pub struct CResult_AcceptChannelDecodeErrorZ {
4802 pub contents: CResult_AcceptChannelDecodeErrorZPtr,
4803 pub result_ok: bool,
4806 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_ok(o: crate::ln::msgs::AcceptChannel) -> CResult_AcceptChannelDecodeErrorZ {
4807 CResult_AcceptChannelDecodeErrorZ {
4808 contents: CResult_AcceptChannelDecodeErrorZPtr {
4809 result: Box::into_raw(Box::new(o)),
4815 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_AcceptChannelDecodeErrorZ {
4816 CResult_AcceptChannelDecodeErrorZ {
4817 contents: CResult_AcceptChannelDecodeErrorZPtr {
4818 err: Box::into_raw(Box::new(e)),
4824 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_free(_res: CResult_AcceptChannelDecodeErrorZ) { }
4825 impl Drop for CResult_AcceptChannelDecodeErrorZ {
4826 fn drop(&mut self) {
4828 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4829 let _ = unsafe { Box::from_raw(self.contents.result) };
4832 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4833 let _ = unsafe { Box::from_raw(self.contents.err) };
4838 impl From<crate::c_types::CResultTempl<crate::ln::msgs::AcceptChannel, crate::ln::msgs::DecodeError>> for CResult_AcceptChannelDecodeErrorZ {
4839 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::AcceptChannel, crate::ln::msgs::DecodeError>) -> Self {
4840 let contents = if o.result_ok {
4841 let result = unsafe { o.contents.result };
4842 unsafe { o.contents.result = std::ptr::null_mut() };
4843 CResult_AcceptChannelDecodeErrorZPtr { result }
4845 let err = unsafe { o.contents.err };
4846 unsafe { o.contents.err = std::ptr::null_mut(); }
4847 CResult_AcceptChannelDecodeErrorZPtr { err }
4851 result_ok: o.result_ok,
4855 impl Clone for CResult_AcceptChannelDecodeErrorZ {
4856 fn clone(&self) -> Self {
4858 Self { result_ok: true, contents: CResult_AcceptChannelDecodeErrorZPtr {
4859 result: Box::into_raw(Box::new(<crate::ln::msgs::AcceptChannel>::clone(unsafe { &*self.contents.result })))
4862 Self { result_ok: false, contents: CResult_AcceptChannelDecodeErrorZPtr {
4863 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4869 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_clone(orig: &CResult_AcceptChannelDecodeErrorZ) -> CResult_AcceptChannelDecodeErrorZ { orig.clone() }
4871 pub union CResult_AnnouncementSignaturesDecodeErrorZPtr {
4872 pub result: *mut crate::ln::msgs::AnnouncementSignatures,
4873 pub err: *mut crate::ln::msgs::DecodeError,
4876 pub struct CResult_AnnouncementSignaturesDecodeErrorZ {
4877 pub contents: CResult_AnnouncementSignaturesDecodeErrorZPtr,
4878 pub result_ok: bool,
4881 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_ok(o: crate::ln::msgs::AnnouncementSignatures) -> CResult_AnnouncementSignaturesDecodeErrorZ {
4882 CResult_AnnouncementSignaturesDecodeErrorZ {
4883 contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4884 result: Box::into_raw(Box::new(o)),
4890 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_AnnouncementSignaturesDecodeErrorZ {
4891 CResult_AnnouncementSignaturesDecodeErrorZ {
4892 contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4893 err: Box::into_raw(Box::new(e)),
4899 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_free(_res: CResult_AnnouncementSignaturesDecodeErrorZ) { }
4900 impl Drop for CResult_AnnouncementSignaturesDecodeErrorZ {
4901 fn drop(&mut self) {
4903 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4904 let _ = unsafe { Box::from_raw(self.contents.result) };
4907 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4908 let _ = unsafe { Box::from_raw(self.contents.err) };
4913 impl From<crate::c_types::CResultTempl<crate::ln::msgs::AnnouncementSignatures, crate::ln::msgs::DecodeError>> for CResult_AnnouncementSignaturesDecodeErrorZ {
4914 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::AnnouncementSignatures, crate::ln::msgs::DecodeError>) -> Self {
4915 let contents = if o.result_ok {
4916 let result = unsafe { o.contents.result };
4917 unsafe { o.contents.result = std::ptr::null_mut() };
4918 CResult_AnnouncementSignaturesDecodeErrorZPtr { result }
4920 let err = unsafe { o.contents.err };
4921 unsafe { o.contents.err = std::ptr::null_mut(); }
4922 CResult_AnnouncementSignaturesDecodeErrorZPtr { err }
4926 result_ok: o.result_ok,
4930 impl Clone for CResult_AnnouncementSignaturesDecodeErrorZ {
4931 fn clone(&self) -> Self {
4933 Self { result_ok: true, contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4934 result: Box::into_raw(Box::new(<crate::ln::msgs::AnnouncementSignatures>::clone(unsafe { &*self.contents.result })))
4937 Self { result_ok: false, contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4938 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4944 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig: &CResult_AnnouncementSignaturesDecodeErrorZ) -> CResult_AnnouncementSignaturesDecodeErrorZ { orig.clone() }
4946 pub union CResult_ChannelReestablishDecodeErrorZPtr {
4947 pub result: *mut crate::ln::msgs::ChannelReestablish,
4948 pub err: *mut crate::ln::msgs::DecodeError,
4951 pub struct CResult_ChannelReestablishDecodeErrorZ {
4952 pub contents: CResult_ChannelReestablishDecodeErrorZPtr,
4953 pub result_ok: bool,
4956 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_ok(o: crate::ln::msgs::ChannelReestablish) -> CResult_ChannelReestablishDecodeErrorZ {
4957 CResult_ChannelReestablishDecodeErrorZ {
4958 contents: CResult_ChannelReestablishDecodeErrorZPtr {
4959 result: Box::into_raw(Box::new(o)),
4965 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelReestablishDecodeErrorZ {
4966 CResult_ChannelReestablishDecodeErrorZ {
4967 contents: CResult_ChannelReestablishDecodeErrorZPtr {
4968 err: Box::into_raw(Box::new(e)),
4974 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_free(_res: CResult_ChannelReestablishDecodeErrorZ) { }
4975 impl Drop for CResult_ChannelReestablishDecodeErrorZ {
4976 fn drop(&mut self) {
4978 if unsafe { !(self.contents.result as *mut ()).is_null() } {
4979 let _ = unsafe { Box::from_raw(self.contents.result) };
4982 if unsafe { !(self.contents.err as *mut ()).is_null() } {
4983 let _ = unsafe { Box::from_raw(self.contents.err) };
4988 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ChannelReestablish, crate::ln::msgs::DecodeError>> for CResult_ChannelReestablishDecodeErrorZ {
4989 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ChannelReestablish, crate::ln::msgs::DecodeError>) -> Self {
4990 let contents = if o.result_ok {
4991 let result = unsafe { o.contents.result };
4992 unsafe { o.contents.result = std::ptr::null_mut() };
4993 CResult_ChannelReestablishDecodeErrorZPtr { result }
4995 let err = unsafe { o.contents.err };
4996 unsafe { o.contents.err = std::ptr::null_mut(); }
4997 CResult_ChannelReestablishDecodeErrorZPtr { err }
5001 result_ok: o.result_ok,
5005 impl Clone for CResult_ChannelReestablishDecodeErrorZ {
5006 fn clone(&self) -> Self {
5008 Self { result_ok: true, contents: CResult_ChannelReestablishDecodeErrorZPtr {
5009 result: Box::into_raw(Box::new(<crate::ln::msgs::ChannelReestablish>::clone(unsafe { &*self.contents.result })))
5012 Self { result_ok: false, contents: CResult_ChannelReestablishDecodeErrorZPtr {
5013 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5019 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_clone(orig: &CResult_ChannelReestablishDecodeErrorZ) -> CResult_ChannelReestablishDecodeErrorZ { orig.clone() }
5021 pub union CResult_ClosingSignedDecodeErrorZPtr {
5022 pub result: *mut crate::ln::msgs::ClosingSigned,
5023 pub err: *mut crate::ln::msgs::DecodeError,
5026 pub struct CResult_ClosingSignedDecodeErrorZ {
5027 pub contents: CResult_ClosingSignedDecodeErrorZPtr,
5028 pub result_ok: bool,
5031 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_ok(o: crate::ln::msgs::ClosingSigned) -> CResult_ClosingSignedDecodeErrorZ {
5032 CResult_ClosingSignedDecodeErrorZ {
5033 contents: CResult_ClosingSignedDecodeErrorZPtr {
5034 result: Box::into_raw(Box::new(o)),
5040 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ClosingSignedDecodeErrorZ {
5041 CResult_ClosingSignedDecodeErrorZ {
5042 contents: CResult_ClosingSignedDecodeErrorZPtr {
5043 err: Box::into_raw(Box::new(e)),
5049 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_free(_res: CResult_ClosingSignedDecodeErrorZ) { }
5050 impl Drop for CResult_ClosingSignedDecodeErrorZ {
5051 fn drop(&mut self) {
5053 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5054 let _ = unsafe { Box::from_raw(self.contents.result) };
5057 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5058 let _ = unsafe { Box::from_raw(self.contents.err) };
5063 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ClosingSigned, crate::ln::msgs::DecodeError>> for CResult_ClosingSignedDecodeErrorZ {
5064 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ClosingSigned, crate::ln::msgs::DecodeError>) -> Self {
5065 let contents = if o.result_ok {
5066 let result = unsafe { o.contents.result };
5067 unsafe { o.contents.result = std::ptr::null_mut() };
5068 CResult_ClosingSignedDecodeErrorZPtr { result }
5070 let err = unsafe { o.contents.err };
5071 unsafe { o.contents.err = std::ptr::null_mut(); }
5072 CResult_ClosingSignedDecodeErrorZPtr { err }
5076 result_ok: o.result_ok,
5080 impl Clone for CResult_ClosingSignedDecodeErrorZ {
5081 fn clone(&self) -> Self {
5083 Self { result_ok: true, contents: CResult_ClosingSignedDecodeErrorZPtr {
5084 result: Box::into_raw(Box::new(<crate::ln::msgs::ClosingSigned>::clone(unsafe { &*self.contents.result })))
5087 Self { result_ok: false, contents: CResult_ClosingSignedDecodeErrorZPtr {
5088 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5094 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_clone(orig: &CResult_ClosingSignedDecodeErrorZ) -> CResult_ClosingSignedDecodeErrorZ { orig.clone() }
5096 pub union CResult_CommitmentSignedDecodeErrorZPtr {
5097 pub result: *mut crate::ln::msgs::CommitmentSigned,
5098 pub err: *mut crate::ln::msgs::DecodeError,
5101 pub struct CResult_CommitmentSignedDecodeErrorZ {
5102 pub contents: CResult_CommitmentSignedDecodeErrorZPtr,
5103 pub result_ok: bool,
5106 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_ok(o: crate::ln::msgs::CommitmentSigned) -> CResult_CommitmentSignedDecodeErrorZ {
5107 CResult_CommitmentSignedDecodeErrorZ {
5108 contents: CResult_CommitmentSignedDecodeErrorZPtr {
5109 result: Box::into_raw(Box::new(o)),
5115 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CommitmentSignedDecodeErrorZ {
5116 CResult_CommitmentSignedDecodeErrorZ {
5117 contents: CResult_CommitmentSignedDecodeErrorZPtr {
5118 err: Box::into_raw(Box::new(e)),
5124 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_free(_res: CResult_CommitmentSignedDecodeErrorZ) { }
5125 impl Drop for CResult_CommitmentSignedDecodeErrorZ {
5126 fn drop(&mut self) {
5128 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5129 let _ = unsafe { Box::from_raw(self.contents.result) };
5132 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5133 let _ = unsafe { Box::from_raw(self.contents.err) };
5138 impl From<crate::c_types::CResultTempl<crate::ln::msgs::CommitmentSigned, crate::ln::msgs::DecodeError>> for CResult_CommitmentSignedDecodeErrorZ {
5139 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::CommitmentSigned, crate::ln::msgs::DecodeError>) -> Self {
5140 let contents = if o.result_ok {
5141 let result = unsafe { o.contents.result };
5142 unsafe { o.contents.result = std::ptr::null_mut() };
5143 CResult_CommitmentSignedDecodeErrorZPtr { result }
5145 let err = unsafe { o.contents.err };
5146 unsafe { o.contents.err = std::ptr::null_mut(); }
5147 CResult_CommitmentSignedDecodeErrorZPtr { err }
5151 result_ok: o.result_ok,
5155 impl Clone for CResult_CommitmentSignedDecodeErrorZ {
5156 fn clone(&self) -> Self {
5158 Self { result_ok: true, contents: CResult_CommitmentSignedDecodeErrorZPtr {
5159 result: Box::into_raw(Box::new(<crate::ln::msgs::CommitmentSigned>::clone(unsafe { &*self.contents.result })))
5162 Self { result_ok: false, contents: CResult_CommitmentSignedDecodeErrorZPtr {
5163 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5169 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_clone(orig: &CResult_CommitmentSignedDecodeErrorZ) -> CResult_CommitmentSignedDecodeErrorZ { orig.clone() }
5171 pub union CResult_FundingCreatedDecodeErrorZPtr {
5172 pub result: *mut crate::ln::msgs::FundingCreated,
5173 pub err: *mut crate::ln::msgs::DecodeError,
5176 pub struct CResult_FundingCreatedDecodeErrorZ {
5177 pub contents: CResult_FundingCreatedDecodeErrorZPtr,
5178 pub result_ok: bool,
5181 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_ok(o: crate::ln::msgs::FundingCreated) -> CResult_FundingCreatedDecodeErrorZ {
5182 CResult_FundingCreatedDecodeErrorZ {
5183 contents: CResult_FundingCreatedDecodeErrorZPtr {
5184 result: Box::into_raw(Box::new(o)),
5190 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingCreatedDecodeErrorZ {
5191 CResult_FundingCreatedDecodeErrorZ {
5192 contents: CResult_FundingCreatedDecodeErrorZPtr {
5193 err: Box::into_raw(Box::new(e)),
5199 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_free(_res: CResult_FundingCreatedDecodeErrorZ) { }
5200 impl Drop for CResult_FundingCreatedDecodeErrorZ {
5201 fn drop(&mut self) {
5203 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5204 let _ = unsafe { Box::from_raw(self.contents.result) };
5207 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5208 let _ = unsafe { Box::from_raw(self.contents.err) };
5213 impl From<crate::c_types::CResultTempl<crate::ln::msgs::FundingCreated, crate::ln::msgs::DecodeError>> for CResult_FundingCreatedDecodeErrorZ {
5214 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::FundingCreated, crate::ln::msgs::DecodeError>) -> Self {
5215 let contents = if o.result_ok {
5216 let result = unsafe { o.contents.result };
5217 unsafe { o.contents.result = std::ptr::null_mut() };
5218 CResult_FundingCreatedDecodeErrorZPtr { result }
5220 let err = unsafe { o.contents.err };
5221 unsafe { o.contents.err = std::ptr::null_mut(); }
5222 CResult_FundingCreatedDecodeErrorZPtr { err }
5226 result_ok: o.result_ok,
5230 impl Clone for CResult_FundingCreatedDecodeErrorZ {
5231 fn clone(&self) -> Self {
5233 Self { result_ok: true, contents: CResult_FundingCreatedDecodeErrorZPtr {
5234 result: Box::into_raw(Box::new(<crate::ln::msgs::FundingCreated>::clone(unsafe { &*self.contents.result })))
5237 Self { result_ok: false, contents: CResult_FundingCreatedDecodeErrorZPtr {
5238 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5244 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_clone(orig: &CResult_FundingCreatedDecodeErrorZ) -> CResult_FundingCreatedDecodeErrorZ { orig.clone() }
5246 pub union CResult_FundingSignedDecodeErrorZPtr {
5247 pub result: *mut crate::ln::msgs::FundingSigned,
5248 pub err: *mut crate::ln::msgs::DecodeError,
5251 pub struct CResult_FundingSignedDecodeErrorZ {
5252 pub contents: CResult_FundingSignedDecodeErrorZPtr,
5253 pub result_ok: bool,
5256 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_ok(o: crate::ln::msgs::FundingSigned) -> CResult_FundingSignedDecodeErrorZ {
5257 CResult_FundingSignedDecodeErrorZ {
5258 contents: CResult_FundingSignedDecodeErrorZPtr {
5259 result: Box::into_raw(Box::new(o)),
5265 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingSignedDecodeErrorZ {
5266 CResult_FundingSignedDecodeErrorZ {
5267 contents: CResult_FundingSignedDecodeErrorZPtr {
5268 err: Box::into_raw(Box::new(e)),
5274 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_free(_res: CResult_FundingSignedDecodeErrorZ) { }
5275 impl Drop for CResult_FundingSignedDecodeErrorZ {
5276 fn drop(&mut self) {
5278 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5279 let _ = unsafe { Box::from_raw(self.contents.result) };
5282 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5283 let _ = unsafe { Box::from_raw(self.contents.err) };
5288 impl From<crate::c_types::CResultTempl<crate::ln::msgs::FundingSigned, crate::ln::msgs::DecodeError>> for CResult_FundingSignedDecodeErrorZ {
5289 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::FundingSigned, crate::ln::msgs::DecodeError>) -> Self {
5290 let contents = if o.result_ok {
5291 let result = unsafe { o.contents.result };
5292 unsafe { o.contents.result = std::ptr::null_mut() };
5293 CResult_FundingSignedDecodeErrorZPtr { result }
5295 let err = unsafe { o.contents.err };
5296 unsafe { o.contents.err = std::ptr::null_mut(); }
5297 CResult_FundingSignedDecodeErrorZPtr { err }
5301 result_ok: o.result_ok,
5305 impl Clone for CResult_FundingSignedDecodeErrorZ {
5306 fn clone(&self) -> Self {
5308 Self { result_ok: true, contents: CResult_FundingSignedDecodeErrorZPtr {
5309 result: Box::into_raw(Box::new(<crate::ln::msgs::FundingSigned>::clone(unsafe { &*self.contents.result })))
5312 Self { result_ok: false, contents: CResult_FundingSignedDecodeErrorZPtr {
5313 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5319 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_clone(orig: &CResult_FundingSignedDecodeErrorZ) -> CResult_FundingSignedDecodeErrorZ { orig.clone() }
5321 pub union CResult_FundingLockedDecodeErrorZPtr {
5322 pub result: *mut crate::ln::msgs::FundingLocked,
5323 pub err: *mut crate::ln::msgs::DecodeError,
5326 pub struct CResult_FundingLockedDecodeErrorZ {
5327 pub contents: CResult_FundingLockedDecodeErrorZPtr,
5328 pub result_ok: bool,
5331 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_ok(o: crate::ln::msgs::FundingLocked) -> CResult_FundingLockedDecodeErrorZ {
5332 CResult_FundingLockedDecodeErrorZ {
5333 contents: CResult_FundingLockedDecodeErrorZPtr {
5334 result: Box::into_raw(Box::new(o)),
5340 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingLockedDecodeErrorZ {
5341 CResult_FundingLockedDecodeErrorZ {
5342 contents: CResult_FundingLockedDecodeErrorZPtr {
5343 err: Box::into_raw(Box::new(e)),
5349 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_free(_res: CResult_FundingLockedDecodeErrorZ) { }
5350 impl Drop for CResult_FundingLockedDecodeErrorZ {
5351 fn drop(&mut self) {
5353 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5354 let _ = unsafe { Box::from_raw(self.contents.result) };
5357 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5358 let _ = unsafe { Box::from_raw(self.contents.err) };
5363 impl From<crate::c_types::CResultTempl<crate::ln::msgs::FundingLocked, crate::ln::msgs::DecodeError>> for CResult_FundingLockedDecodeErrorZ {
5364 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::FundingLocked, crate::ln::msgs::DecodeError>) -> Self {
5365 let contents = if o.result_ok {
5366 let result = unsafe { o.contents.result };
5367 unsafe { o.contents.result = std::ptr::null_mut() };
5368 CResult_FundingLockedDecodeErrorZPtr { result }
5370 let err = unsafe { o.contents.err };
5371 unsafe { o.contents.err = std::ptr::null_mut(); }
5372 CResult_FundingLockedDecodeErrorZPtr { err }
5376 result_ok: o.result_ok,
5380 impl Clone for CResult_FundingLockedDecodeErrorZ {
5381 fn clone(&self) -> Self {
5383 Self { result_ok: true, contents: CResult_FundingLockedDecodeErrorZPtr {
5384 result: Box::into_raw(Box::new(<crate::ln::msgs::FundingLocked>::clone(unsafe { &*self.contents.result })))
5387 Self { result_ok: false, contents: CResult_FundingLockedDecodeErrorZPtr {
5388 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5394 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_clone(orig: &CResult_FundingLockedDecodeErrorZ) -> CResult_FundingLockedDecodeErrorZ { orig.clone() }
5396 pub union CResult_InitDecodeErrorZPtr {
5397 pub result: *mut crate::ln::msgs::Init,
5398 pub err: *mut crate::ln::msgs::DecodeError,
5401 pub struct CResult_InitDecodeErrorZ {
5402 pub contents: CResult_InitDecodeErrorZPtr,
5403 pub result_ok: bool,
5406 pub extern "C" fn CResult_InitDecodeErrorZ_ok(o: crate::ln::msgs::Init) -> CResult_InitDecodeErrorZ {
5407 CResult_InitDecodeErrorZ {
5408 contents: CResult_InitDecodeErrorZPtr {
5409 result: Box::into_raw(Box::new(o)),
5415 pub extern "C" fn CResult_InitDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InitDecodeErrorZ {
5416 CResult_InitDecodeErrorZ {
5417 contents: CResult_InitDecodeErrorZPtr {
5418 err: Box::into_raw(Box::new(e)),
5424 pub extern "C" fn CResult_InitDecodeErrorZ_free(_res: CResult_InitDecodeErrorZ) { }
5425 impl Drop for CResult_InitDecodeErrorZ {
5426 fn drop(&mut self) {
5428 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5429 let _ = unsafe { Box::from_raw(self.contents.result) };
5432 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5433 let _ = unsafe { Box::from_raw(self.contents.err) };
5438 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Init, crate::ln::msgs::DecodeError>> for CResult_InitDecodeErrorZ {
5439 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Init, crate::ln::msgs::DecodeError>) -> Self {
5440 let contents = if o.result_ok {
5441 let result = unsafe { o.contents.result };
5442 unsafe { o.contents.result = std::ptr::null_mut() };
5443 CResult_InitDecodeErrorZPtr { result }
5445 let err = unsafe { o.contents.err };
5446 unsafe { o.contents.err = std::ptr::null_mut(); }
5447 CResult_InitDecodeErrorZPtr { err }
5451 result_ok: o.result_ok,
5455 impl Clone for CResult_InitDecodeErrorZ {
5456 fn clone(&self) -> Self {
5458 Self { result_ok: true, contents: CResult_InitDecodeErrorZPtr {
5459 result: Box::into_raw(Box::new(<crate::ln::msgs::Init>::clone(unsafe { &*self.contents.result })))
5462 Self { result_ok: false, contents: CResult_InitDecodeErrorZPtr {
5463 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5469 pub extern "C" fn CResult_InitDecodeErrorZ_clone(orig: &CResult_InitDecodeErrorZ) -> CResult_InitDecodeErrorZ { orig.clone() }
5471 pub union CResult_OpenChannelDecodeErrorZPtr {
5472 pub result: *mut crate::ln::msgs::OpenChannel,
5473 pub err: *mut crate::ln::msgs::DecodeError,
5476 pub struct CResult_OpenChannelDecodeErrorZ {
5477 pub contents: CResult_OpenChannelDecodeErrorZPtr,
5478 pub result_ok: bool,
5481 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_ok(o: crate::ln::msgs::OpenChannel) -> CResult_OpenChannelDecodeErrorZ {
5482 CResult_OpenChannelDecodeErrorZ {
5483 contents: CResult_OpenChannelDecodeErrorZPtr {
5484 result: Box::into_raw(Box::new(o)),
5490 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_OpenChannelDecodeErrorZ {
5491 CResult_OpenChannelDecodeErrorZ {
5492 contents: CResult_OpenChannelDecodeErrorZPtr {
5493 err: Box::into_raw(Box::new(e)),
5499 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_free(_res: CResult_OpenChannelDecodeErrorZ) { }
5500 impl Drop for CResult_OpenChannelDecodeErrorZ {
5501 fn drop(&mut self) {
5503 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5504 let _ = unsafe { Box::from_raw(self.contents.result) };
5507 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5508 let _ = unsafe { Box::from_raw(self.contents.err) };
5513 impl From<crate::c_types::CResultTempl<crate::ln::msgs::OpenChannel, crate::ln::msgs::DecodeError>> for CResult_OpenChannelDecodeErrorZ {
5514 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::OpenChannel, crate::ln::msgs::DecodeError>) -> Self {
5515 let contents = if o.result_ok {
5516 let result = unsafe { o.contents.result };
5517 unsafe { o.contents.result = std::ptr::null_mut() };
5518 CResult_OpenChannelDecodeErrorZPtr { result }
5520 let err = unsafe { o.contents.err };
5521 unsafe { o.contents.err = std::ptr::null_mut(); }
5522 CResult_OpenChannelDecodeErrorZPtr { err }
5526 result_ok: o.result_ok,
5530 impl Clone for CResult_OpenChannelDecodeErrorZ {
5531 fn clone(&self) -> Self {
5533 Self { result_ok: true, contents: CResult_OpenChannelDecodeErrorZPtr {
5534 result: Box::into_raw(Box::new(<crate::ln::msgs::OpenChannel>::clone(unsafe { &*self.contents.result })))
5537 Self { result_ok: false, contents: CResult_OpenChannelDecodeErrorZPtr {
5538 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5544 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_clone(orig: &CResult_OpenChannelDecodeErrorZ) -> CResult_OpenChannelDecodeErrorZ { orig.clone() }
5546 pub union CResult_RevokeAndACKDecodeErrorZPtr {
5547 pub result: *mut crate::ln::msgs::RevokeAndACK,
5548 pub err: *mut crate::ln::msgs::DecodeError,
5551 pub struct CResult_RevokeAndACKDecodeErrorZ {
5552 pub contents: CResult_RevokeAndACKDecodeErrorZPtr,
5553 pub result_ok: bool,
5556 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_ok(o: crate::ln::msgs::RevokeAndACK) -> CResult_RevokeAndACKDecodeErrorZ {
5557 CResult_RevokeAndACKDecodeErrorZ {
5558 contents: CResult_RevokeAndACKDecodeErrorZPtr {
5559 result: Box::into_raw(Box::new(o)),
5565 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RevokeAndACKDecodeErrorZ {
5566 CResult_RevokeAndACKDecodeErrorZ {
5567 contents: CResult_RevokeAndACKDecodeErrorZPtr {
5568 err: Box::into_raw(Box::new(e)),
5574 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_free(_res: CResult_RevokeAndACKDecodeErrorZ) { }
5575 impl Drop for CResult_RevokeAndACKDecodeErrorZ {
5576 fn drop(&mut self) {
5578 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5579 let _ = unsafe { Box::from_raw(self.contents.result) };
5582 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5583 let _ = unsafe { Box::from_raw(self.contents.err) };
5588 impl From<crate::c_types::CResultTempl<crate::ln::msgs::RevokeAndACK, crate::ln::msgs::DecodeError>> for CResult_RevokeAndACKDecodeErrorZ {
5589 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::RevokeAndACK, crate::ln::msgs::DecodeError>) -> Self {
5590 let contents = if o.result_ok {
5591 let result = unsafe { o.contents.result };
5592 unsafe { o.contents.result = std::ptr::null_mut() };
5593 CResult_RevokeAndACKDecodeErrorZPtr { result }
5595 let err = unsafe { o.contents.err };
5596 unsafe { o.contents.err = std::ptr::null_mut(); }
5597 CResult_RevokeAndACKDecodeErrorZPtr { err }
5601 result_ok: o.result_ok,
5605 impl Clone for CResult_RevokeAndACKDecodeErrorZ {
5606 fn clone(&self) -> Self {
5608 Self { result_ok: true, contents: CResult_RevokeAndACKDecodeErrorZPtr {
5609 result: Box::into_raw(Box::new(<crate::ln::msgs::RevokeAndACK>::clone(unsafe { &*self.contents.result })))
5612 Self { result_ok: false, contents: CResult_RevokeAndACKDecodeErrorZPtr {
5613 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5619 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_clone(orig: &CResult_RevokeAndACKDecodeErrorZ) -> CResult_RevokeAndACKDecodeErrorZ { orig.clone() }
5621 pub union CResult_ShutdownDecodeErrorZPtr {
5622 pub result: *mut crate::ln::msgs::Shutdown,
5623 pub err: *mut crate::ln::msgs::DecodeError,
5626 pub struct CResult_ShutdownDecodeErrorZ {
5627 pub contents: CResult_ShutdownDecodeErrorZPtr,
5628 pub result_ok: bool,
5631 pub extern "C" fn CResult_ShutdownDecodeErrorZ_ok(o: crate::ln::msgs::Shutdown) -> CResult_ShutdownDecodeErrorZ {
5632 CResult_ShutdownDecodeErrorZ {
5633 contents: CResult_ShutdownDecodeErrorZPtr {
5634 result: Box::into_raw(Box::new(o)),
5640 pub extern "C" fn CResult_ShutdownDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ShutdownDecodeErrorZ {
5641 CResult_ShutdownDecodeErrorZ {
5642 contents: CResult_ShutdownDecodeErrorZPtr {
5643 err: Box::into_raw(Box::new(e)),
5649 pub extern "C" fn CResult_ShutdownDecodeErrorZ_free(_res: CResult_ShutdownDecodeErrorZ) { }
5650 impl Drop for CResult_ShutdownDecodeErrorZ {
5651 fn drop(&mut self) {
5653 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5654 let _ = unsafe { Box::from_raw(self.contents.result) };
5657 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5658 let _ = unsafe { Box::from_raw(self.contents.err) };
5663 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Shutdown, crate::ln::msgs::DecodeError>> for CResult_ShutdownDecodeErrorZ {
5664 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Shutdown, crate::ln::msgs::DecodeError>) -> Self {
5665 let contents = if o.result_ok {
5666 let result = unsafe { o.contents.result };
5667 unsafe { o.contents.result = std::ptr::null_mut() };
5668 CResult_ShutdownDecodeErrorZPtr { result }
5670 let err = unsafe { o.contents.err };
5671 unsafe { o.contents.err = std::ptr::null_mut(); }
5672 CResult_ShutdownDecodeErrorZPtr { err }
5676 result_ok: o.result_ok,
5680 impl Clone for CResult_ShutdownDecodeErrorZ {
5681 fn clone(&self) -> Self {
5683 Self { result_ok: true, contents: CResult_ShutdownDecodeErrorZPtr {
5684 result: Box::into_raw(Box::new(<crate::ln::msgs::Shutdown>::clone(unsafe { &*self.contents.result })))
5687 Self { result_ok: false, contents: CResult_ShutdownDecodeErrorZPtr {
5688 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5694 pub extern "C" fn CResult_ShutdownDecodeErrorZ_clone(orig: &CResult_ShutdownDecodeErrorZ) -> CResult_ShutdownDecodeErrorZ { orig.clone() }
5696 pub union CResult_UpdateFailHTLCDecodeErrorZPtr {
5697 pub result: *mut crate::ln::msgs::UpdateFailHTLC,
5698 pub err: *mut crate::ln::msgs::DecodeError,
5701 pub struct CResult_UpdateFailHTLCDecodeErrorZ {
5702 pub contents: CResult_UpdateFailHTLCDecodeErrorZPtr,
5703 pub result_ok: bool,
5706 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFailHTLC) -> CResult_UpdateFailHTLCDecodeErrorZ {
5707 CResult_UpdateFailHTLCDecodeErrorZ {
5708 contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5709 result: Box::into_raw(Box::new(o)),
5715 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFailHTLCDecodeErrorZ {
5716 CResult_UpdateFailHTLCDecodeErrorZ {
5717 contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5718 err: Box::into_raw(Box::new(e)),
5724 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_free(_res: CResult_UpdateFailHTLCDecodeErrorZ) { }
5725 impl Drop for CResult_UpdateFailHTLCDecodeErrorZ {
5726 fn drop(&mut self) {
5728 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5729 let _ = unsafe { Box::from_raw(self.contents.result) };
5732 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5733 let _ = unsafe { Box::from_raw(self.contents.err) };
5738 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateFailHTLCDecodeErrorZ {
5739 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailHTLC, crate::ln::msgs::DecodeError>) -> Self {
5740 let contents = if o.result_ok {
5741 let result = unsafe { o.contents.result };
5742 unsafe { o.contents.result = std::ptr::null_mut() };
5743 CResult_UpdateFailHTLCDecodeErrorZPtr { result }
5745 let err = unsafe { o.contents.err };
5746 unsafe { o.contents.err = std::ptr::null_mut(); }
5747 CResult_UpdateFailHTLCDecodeErrorZPtr { err }
5751 result_ok: o.result_ok,
5755 impl Clone for CResult_UpdateFailHTLCDecodeErrorZ {
5756 fn clone(&self) -> Self {
5758 Self { result_ok: true, contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5759 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFailHTLC>::clone(unsafe { &*self.contents.result })))
5762 Self { result_ok: false, contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5763 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5769 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFailHTLCDecodeErrorZ) -> CResult_UpdateFailHTLCDecodeErrorZ { orig.clone() }
5771 pub union CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5772 pub result: *mut crate::ln::msgs::UpdateFailMalformedHTLC,
5773 pub err: *mut crate::ln::msgs::DecodeError,
5776 pub struct CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5777 pub contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr,
5778 pub result_ok: bool,
5781 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFailMalformedHTLC) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5782 CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5783 contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5784 result: Box::into_raw(Box::new(o)),
5790 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5791 CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5792 contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5793 err: Box::into_raw(Box::new(e)),
5799 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res: CResult_UpdateFailMalformedHTLCDecodeErrorZ) { }
5800 impl Drop for CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5801 fn drop(&mut self) {
5803 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5804 let _ = unsafe { Box::from_raw(self.contents.result) };
5807 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5808 let _ = unsafe { Box::from_raw(self.contents.err) };
5813 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailMalformedHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5814 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailMalformedHTLC, crate::ln::msgs::DecodeError>) -> Self {
5815 let contents = if o.result_ok {
5816 let result = unsafe { o.contents.result };
5817 unsafe { o.contents.result = std::ptr::null_mut() };
5818 CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { result }
5820 let err = unsafe { o.contents.err };
5821 unsafe { o.contents.err = std::ptr::null_mut(); }
5822 CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { err }
5826 result_ok: o.result_ok,
5830 impl Clone for CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5831 fn clone(&self) -> Self {
5833 Self { result_ok: true, contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5834 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFailMalformedHTLC>::clone(unsafe { &*self.contents.result })))
5837 Self { result_ok: false, contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5838 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5844 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFailMalformedHTLCDecodeErrorZ) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ { orig.clone() }
5846 pub union CResult_UpdateFeeDecodeErrorZPtr {
5847 pub result: *mut crate::ln::msgs::UpdateFee,
5848 pub err: *mut crate::ln::msgs::DecodeError,
5851 pub struct CResult_UpdateFeeDecodeErrorZ {
5852 pub contents: CResult_UpdateFeeDecodeErrorZPtr,
5853 pub result_ok: bool,
5856 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFee) -> CResult_UpdateFeeDecodeErrorZ {
5857 CResult_UpdateFeeDecodeErrorZ {
5858 contents: CResult_UpdateFeeDecodeErrorZPtr {
5859 result: Box::into_raw(Box::new(o)),
5865 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFeeDecodeErrorZ {
5866 CResult_UpdateFeeDecodeErrorZ {
5867 contents: CResult_UpdateFeeDecodeErrorZPtr {
5868 err: Box::into_raw(Box::new(e)),
5874 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_free(_res: CResult_UpdateFeeDecodeErrorZ) { }
5875 impl Drop for CResult_UpdateFeeDecodeErrorZ {
5876 fn drop(&mut self) {
5878 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5879 let _ = unsafe { Box::from_raw(self.contents.result) };
5882 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5883 let _ = unsafe { Box::from_raw(self.contents.err) };
5888 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFee, crate::ln::msgs::DecodeError>> for CResult_UpdateFeeDecodeErrorZ {
5889 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFee, crate::ln::msgs::DecodeError>) -> Self {
5890 let contents = if o.result_ok {
5891 let result = unsafe { o.contents.result };
5892 unsafe { o.contents.result = std::ptr::null_mut() };
5893 CResult_UpdateFeeDecodeErrorZPtr { result }
5895 let err = unsafe { o.contents.err };
5896 unsafe { o.contents.err = std::ptr::null_mut(); }
5897 CResult_UpdateFeeDecodeErrorZPtr { err }
5901 result_ok: o.result_ok,
5905 impl Clone for CResult_UpdateFeeDecodeErrorZ {
5906 fn clone(&self) -> Self {
5908 Self { result_ok: true, contents: CResult_UpdateFeeDecodeErrorZPtr {
5909 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFee>::clone(unsafe { &*self.contents.result })))
5912 Self { result_ok: false, contents: CResult_UpdateFeeDecodeErrorZPtr {
5913 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5919 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_clone(orig: &CResult_UpdateFeeDecodeErrorZ) -> CResult_UpdateFeeDecodeErrorZ { orig.clone() }
5921 pub union CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5922 pub result: *mut crate::ln::msgs::UpdateFulfillHTLC,
5923 pub err: *mut crate::ln::msgs::DecodeError,
5926 pub struct CResult_UpdateFulfillHTLCDecodeErrorZ {
5927 pub contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr,
5928 pub result_ok: bool,
5931 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFulfillHTLC) -> CResult_UpdateFulfillHTLCDecodeErrorZ {
5932 CResult_UpdateFulfillHTLCDecodeErrorZ {
5933 contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5934 result: Box::into_raw(Box::new(o)),
5940 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFulfillHTLCDecodeErrorZ {
5941 CResult_UpdateFulfillHTLCDecodeErrorZ {
5942 contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5943 err: Box::into_raw(Box::new(e)),
5949 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res: CResult_UpdateFulfillHTLCDecodeErrorZ) { }
5950 impl Drop for CResult_UpdateFulfillHTLCDecodeErrorZ {
5951 fn drop(&mut self) {
5953 if unsafe { !(self.contents.result as *mut ()).is_null() } {
5954 let _ = unsafe { Box::from_raw(self.contents.result) };
5957 if unsafe { !(self.contents.err as *mut ()).is_null() } {
5958 let _ = unsafe { Box::from_raw(self.contents.err) };
5963 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFulfillHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateFulfillHTLCDecodeErrorZ {
5964 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFulfillHTLC, crate::ln::msgs::DecodeError>) -> Self {
5965 let contents = if o.result_ok {
5966 let result = unsafe { o.contents.result };
5967 unsafe { o.contents.result = std::ptr::null_mut() };
5968 CResult_UpdateFulfillHTLCDecodeErrorZPtr { result }
5970 let err = unsafe { o.contents.err };
5971 unsafe { o.contents.err = std::ptr::null_mut(); }
5972 CResult_UpdateFulfillHTLCDecodeErrorZPtr { err }
5976 result_ok: o.result_ok,
5980 impl Clone for CResult_UpdateFulfillHTLCDecodeErrorZ {
5981 fn clone(&self) -> Self {
5983 Self { result_ok: true, contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5984 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFulfillHTLC>::clone(unsafe { &*self.contents.result })))
5987 Self { result_ok: false, contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5988 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5994 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFulfillHTLCDecodeErrorZ) -> CResult_UpdateFulfillHTLCDecodeErrorZ { orig.clone() }
5996 pub union CResult_UpdateAddHTLCDecodeErrorZPtr {
5997 pub result: *mut crate::ln::msgs::UpdateAddHTLC,
5998 pub err: *mut crate::ln::msgs::DecodeError,
6001 pub struct CResult_UpdateAddHTLCDecodeErrorZ {
6002 pub contents: CResult_UpdateAddHTLCDecodeErrorZPtr,
6003 pub result_ok: bool,
6006 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateAddHTLC) -> CResult_UpdateAddHTLCDecodeErrorZ {
6007 CResult_UpdateAddHTLCDecodeErrorZ {
6008 contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
6009 result: Box::into_raw(Box::new(o)),
6015 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateAddHTLCDecodeErrorZ {
6016 CResult_UpdateAddHTLCDecodeErrorZ {
6017 contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
6018 err: Box::into_raw(Box::new(e)),
6024 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_free(_res: CResult_UpdateAddHTLCDecodeErrorZ) { }
6025 impl Drop for CResult_UpdateAddHTLCDecodeErrorZ {
6026 fn drop(&mut self) {
6028 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6029 let _ = unsafe { Box::from_raw(self.contents.result) };
6032 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6033 let _ = unsafe { Box::from_raw(self.contents.err) };
6038 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateAddHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateAddHTLCDecodeErrorZ {
6039 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateAddHTLC, crate::ln::msgs::DecodeError>) -> Self {
6040 let contents = if o.result_ok {
6041 let result = unsafe { o.contents.result };
6042 unsafe { o.contents.result = std::ptr::null_mut() };
6043 CResult_UpdateAddHTLCDecodeErrorZPtr { result }
6045 let err = unsafe { o.contents.err };
6046 unsafe { o.contents.err = std::ptr::null_mut(); }
6047 CResult_UpdateAddHTLCDecodeErrorZPtr { err }
6051 result_ok: o.result_ok,
6055 impl Clone for CResult_UpdateAddHTLCDecodeErrorZ {
6056 fn clone(&self) -> Self {
6058 Self { result_ok: true, contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
6059 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateAddHTLC>::clone(unsafe { &*self.contents.result })))
6062 Self { result_ok: false, contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
6063 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6069 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_clone(orig: &CResult_UpdateAddHTLCDecodeErrorZ) -> CResult_UpdateAddHTLCDecodeErrorZ { orig.clone() }
6071 pub union CResult_PingDecodeErrorZPtr {
6072 pub result: *mut crate::ln::msgs::Ping,
6073 pub err: *mut crate::ln::msgs::DecodeError,
6076 pub struct CResult_PingDecodeErrorZ {
6077 pub contents: CResult_PingDecodeErrorZPtr,
6078 pub result_ok: bool,
6081 pub extern "C" fn CResult_PingDecodeErrorZ_ok(o: crate::ln::msgs::Ping) -> CResult_PingDecodeErrorZ {
6082 CResult_PingDecodeErrorZ {
6083 contents: CResult_PingDecodeErrorZPtr {
6084 result: Box::into_raw(Box::new(o)),
6090 pub extern "C" fn CResult_PingDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_PingDecodeErrorZ {
6091 CResult_PingDecodeErrorZ {
6092 contents: CResult_PingDecodeErrorZPtr {
6093 err: Box::into_raw(Box::new(e)),
6099 pub extern "C" fn CResult_PingDecodeErrorZ_free(_res: CResult_PingDecodeErrorZ) { }
6100 impl Drop for CResult_PingDecodeErrorZ {
6101 fn drop(&mut self) {
6103 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6104 let _ = unsafe { Box::from_raw(self.contents.result) };
6107 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6108 let _ = unsafe { Box::from_raw(self.contents.err) };
6113 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Ping, crate::ln::msgs::DecodeError>> for CResult_PingDecodeErrorZ {
6114 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Ping, crate::ln::msgs::DecodeError>) -> Self {
6115 let contents = if o.result_ok {
6116 let result = unsafe { o.contents.result };
6117 unsafe { o.contents.result = std::ptr::null_mut() };
6118 CResult_PingDecodeErrorZPtr { result }
6120 let err = unsafe { o.contents.err };
6121 unsafe { o.contents.err = std::ptr::null_mut(); }
6122 CResult_PingDecodeErrorZPtr { err }
6126 result_ok: o.result_ok,
6130 impl Clone for CResult_PingDecodeErrorZ {
6131 fn clone(&self) -> Self {
6133 Self { result_ok: true, contents: CResult_PingDecodeErrorZPtr {
6134 result: Box::into_raw(Box::new(<crate::ln::msgs::Ping>::clone(unsafe { &*self.contents.result })))
6137 Self { result_ok: false, contents: CResult_PingDecodeErrorZPtr {
6138 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6144 pub extern "C" fn CResult_PingDecodeErrorZ_clone(orig: &CResult_PingDecodeErrorZ) -> CResult_PingDecodeErrorZ { orig.clone() }
6146 pub union CResult_PongDecodeErrorZPtr {
6147 pub result: *mut crate::ln::msgs::Pong,
6148 pub err: *mut crate::ln::msgs::DecodeError,
6151 pub struct CResult_PongDecodeErrorZ {
6152 pub contents: CResult_PongDecodeErrorZPtr,
6153 pub result_ok: bool,
6156 pub extern "C" fn CResult_PongDecodeErrorZ_ok(o: crate::ln::msgs::Pong) -> CResult_PongDecodeErrorZ {
6157 CResult_PongDecodeErrorZ {
6158 contents: CResult_PongDecodeErrorZPtr {
6159 result: Box::into_raw(Box::new(o)),
6165 pub extern "C" fn CResult_PongDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_PongDecodeErrorZ {
6166 CResult_PongDecodeErrorZ {
6167 contents: CResult_PongDecodeErrorZPtr {
6168 err: Box::into_raw(Box::new(e)),
6174 pub extern "C" fn CResult_PongDecodeErrorZ_free(_res: CResult_PongDecodeErrorZ) { }
6175 impl Drop for CResult_PongDecodeErrorZ {
6176 fn drop(&mut self) {
6178 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6179 let _ = unsafe { Box::from_raw(self.contents.result) };
6182 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6183 let _ = unsafe { Box::from_raw(self.contents.err) };
6188 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Pong, crate::ln::msgs::DecodeError>> for CResult_PongDecodeErrorZ {
6189 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Pong, crate::ln::msgs::DecodeError>) -> Self {
6190 let contents = if o.result_ok {
6191 let result = unsafe { o.contents.result };
6192 unsafe { o.contents.result = std::ptr::null_mut() };
6193 CResult_PongDecodeErrorZPtr { result }
6195 let err = unsafe { o.contents.err };
6196 unsafe { o.contents.err = std::ptr::null_mut(); }
6197 CResult_PongDecodeErrorZPtr { err }
6201 result_ok: o.result_ok,
6205 impl Clone for CResult_PongDecodeErrorZ {
6206 fn clone(&self) -> Self {
6208 Self { result_ok: true, contents: CResult_PongDecodeErrorZPtr {
6209 result: Box::into_raw(Box::new(<crate::ln::msgs::Pong>::clone(unsafe { &*self.contents.result })))
6212 Self { result_ok: false, contents: CResult_PongDecodeErrorZPtr {
6213 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6219 pub extern "C" fn CResult_PongDecodeErrorZ_clone(orig: &CResult_PongDecodeErrorZ) -> CResult_PongDecodeErrorZ { orig.clone() }
6221 pub union CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6222 pub result: *mut crate::ln::msgs::UnsignedChannelAnnouncement,
6223 pub err: *mut crate::ln::msgs::DecodeError,
6226 pub struct CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6227 pub contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr,
6228 pub result_ok: bool,
6231 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedChannelAnnouncement) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6232 CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6233 contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6234 result: Box::into_raw(Box::new(o)),
6240 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6241 CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6242 contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6243 err: Box::into_raw(Box::new(e)),
6249 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res: CResult_UnsignedChannelAnnouncementDecodeErrorZ) { }
6250 impl Drop for CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6251 fn drop(&mut self) {
6253 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6254 let _ = unsafe { Box::from_raw(self.contents.result) };
6257 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6258 let _ = unsafe { Box::from_raw(self.contents.err) };
6263 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelAnnouncement, crate::ln::msgs::DecodeError>> for CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6264 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6265 let contents = if o.result_ok {
6266 let result = unsafe { o.contents.result };
6267 unsafe { o.contents.result = std::ptr::null_mut() };
6268 CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { result }
6270 let err = unsafe { o.contents.err };
6271 unsafe { o.contents.err = std::ptr::null_mut(); }
6272 CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { err }
6276 result_ok: o.result_ok,
6280 impl Clone for CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6281 fn clone(&self) -> Self {
6283 Self { result_ok: true, contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6284 result: Box::into_raw(Box::new(<crate::ln::msgs::UnsignedChannelAnnouncement>::clone(unsafe { &*self.contents.result })))
6287 Self { result_ok: false, contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6288 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6294 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig: &CResult_UnsignedChannelAnnouncementDecodeErrorZ) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ { orig.clone() }
6296 pub union CResult_ChannelAnnouncementDecodeErrorZPtr {
6297 pub result: *mut crate::ln::msgs::ChannelAnnouncement,
6298 pub err: *mut crate::ln::msgs::DecodeError,
6301 pub struct CResult_ChannelAnnouncementDecodeErrorZ {
6302 pub contents: CResult_ChannelAnnouncementDecodeErrorZPtr,
6303 pub result_ok: bool,
6306 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::ChannelAnnouncement) -> CResult_ChannelAnnouncementDecodeErrorZ {
6307 CResult_ChannelAnnouncementDecodeErrorZ {
6308 contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6309 result: Box::into_raw(Box::new(o)),
6315 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelAnnouncementDecodeErrorZ {
6316 CResult_ChannelAnnouncementDecodeErrorZ {
6317 contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6318 err: Box::into_raw(Box::new(e)),
6324 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_free(_res: CResult_ChannelAnnouncementDecodeErrorZ) { }
6325 impl Drop for CResult_ChannelAnnouncementDecodeErrorZ {
6326 fn drop(&mut self) {
6328 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6329 let _ = unsafe { Box::from_raw(self.contents.result) };
6332 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6333 let _ = unsafe { Box::from_raw(self.contents.err) };
6338 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::DecodeError>> for CResult_ChannelAnnouncementDecodeErrorZ {
6339 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6340 let contents = if o.result_ok {
6341 let result = unsafe { o.contents.result };
6342 unsafe { o.contents.result = std::ptr::null_mut() };
6343 CResult_ChannelAnnouncementDecodeErrorZPtr { result }
6345 let err = unsafe { o.contents.err };
6346 unsafe { o.contents.err = std::ptr::null_mut(); }
6347 CResult_ChannelAnnouncementDecodeErrorZPtr { err }
6351 result_ok: o.result_ok,
6355 impl Clone for CResult_ChannelAnnouncementDecodeErrorZ {
6356 fn clone(&self) -> Self {
6358 Self { result_ok: true, contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6359 result: Box::into_raw(Box::new(<crate::ln::msgs::ChannelAnnouncement>::clone(unsafe { &*self.contents.result })))
6362 Self { result_ok: false, contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6363 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6369 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_clone(orig: &CResult_ChannelAnnouncementDecodeErrorZ) -> CResult_ChannelAnnouncementDecodeErrorZ { orig.clone() }
6371 pub union CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6372 pub result: *mut crate::ln::msgs::UnsignedChannelUpdate,
6373 pub err: *mut crate::ln::msgs::DecodeError,
6376 pub struct CResult_UnsignedChannelUpdateDecodeErrorZ {
6377 pub contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr,
6378 pub result_ok: bool,
6381 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedChannelUpdate) -> CResult_UnsignedChannelUpdateDecodeErrorZ {
6382 CResult_UnsignedChannelUpdateDecodeErrorZ {
6383 contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6384 result: Box::into_raw(Box::new(o)),
6390 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedChannelUpdateDecodeErrorZ {
6391 CResult_UnsignedChannelUpdateDecodeErrorZ {
6392 contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6393 err: Box::into_raw(Box::new(e)),
6399 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res: CResult_UnsignedChannelUpdateDecodeErrorZ) { }
6400 impl Drop for CResult_UnsignedChannelUpdateDecodeErrorZ {
6401 fn drop(&mut self) {
6403 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6404 let _ = unsafe { Box::from_raw(self.contents.result) };
6407 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6408 let _ = unsafe { Box::from_raw(self.contents.err) };
6413 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelUpdate, crate::ln::msgs::DecodeError>> for CResult_UnsignedChannelUpdateDecodeErrorZ {
6414 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelUpdate, crate::ln::msgs::DecodeError>) -> Self {
6415 let contents = if o.result_ok {
6416 let result = unsafe { o.contents.result };
6417 unsafe { o.contents.result = std::ptr::null_mut() };
6418 CResult_UnsignedChannelUpdateDecodeErrorZPtr { result }
6420 let err = unsafe { o.contents.err };
6421 unsafe { o.contents.err = std::ptr::null_mut(); }
6422 CResult_UnsignedChannelUpdateDecodeErrorZPtr { err }
6426 result_ok: o.result_ok,
6430 impl Clone for CResult_UnsignedChannelUpdateDecodeErrorZ {
6431 fn clone(&self) -> Self {
6433 Self { result_ok: true, contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6434 result: Box::into_raw(Box::new(<crate::ln::msgs::UnsignedChannelUpdate>::clone(unsafe { &*self.contents.result })))
6437 Self { result_ok: false, contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6438 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6444 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig: &CResult_UnsignedChannelUpdateDecodeErrorZ) -> CResult_UnsignedChannelUpdateDecodeErrorZ { orig.clone() }
6446 pub union CResult_ChannelUpdateDecodeErrorZPtr {
6447 pub result: *mut crate::ln::msgs::ChannelUpdate,
6448 pub err: *mut crate::ln::msgs::DecodeError,
6451 pub struct CResult_ChannelUpdateDecodeErrorZ {
6452 pub contents: CResult_ChannelUpdateDecodeErrorZPtr,
6453 pub result_ok: bool,
6456 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_ok(o: crate::ln::msgs::ChannelUpdate) -> CResult_ChannelUpdateDecodeErrorZ {
6457 CResult_ChannelUpdateDecodeErrorZ {
6458 contents: CResult_ChannelUpdateDecodeErrorZPtr {
6459 result: Box::into_raw(Box::new(o)),
6465 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelUpdateDecodeErrorZ {
6466 CResult_ChannelUpdateDecodeErrorZ {
6467 contents: CResult_ChannelUpdateDecodeErrorZPtr {
6468 err: Box::into_raw(Box::new(e)),
6474 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_free(_res: CResult_ChannelUpdateDecodeErrorZ) { }
6475 impl Drop for CResult_ChannelUpdateDecodeErrorZ {
6476 fn drop(&mut self) {
6478 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6479 let _ = unsafe { Box::from_raw(self.contents.result) };
6482 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6483 let _ = unsafe { Box::from_raw(self.contents.err) };
6488 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ChannelUpdate, crate::ln::msgs::DecodeError>> for CResult_ChannelUpdateDecodeErrorZ {
6489 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ChannelUpdate, crate::ln::msgs::DecodeError>) -> Self {
6490 let contents = if o.result_ok {
6491 let result = unsafe { o.contents.result };
6492 unsafe { o.contents.result = std::ptr::null_mut() };
6493 CResult_ChannelUpdateDecodeErrorZPtr { result }
6495 let err = unsafe { o.contents.err };
6496 unsafe { o.contents.err = std::ptr::null_mut(); }
6497 CResult_ChannelUpdateDecodeErrorZPtr { err }
6501 result_ok: o.result_ok,
6505 impl Clone for CResult_ChannelUpdateDecodeErrorZ {
6506 fn clone(&self) -> Self {
6508 Self { result_ok: true, contents: CResult_ChannelUpdateDecodeErrorZPtr {
6509 result: Box::into_raw(Box::new(<crate::ln::msgs::ChannelUpdate>::clone(unsafe { &*self.contents.result })))
6512 Self { result_ok: false, contents: CResult_ChannelUpdateDecodeErrorZPtr {
6513 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6519 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_clone(orig: &CResult_ChannelUpdateDecodeErrorZ) -> CResult_ChannelUpdateDecodeErrorZ { orig.clone() }
6521 pub union CResult_ErrorMessageDecodeErrorZPtr {
6522 pub result: *mut crate::ln::msgs::ErrorMessage,
6523 pub err: *mut crate::ln::msgs::DecodeError,
6526 pub struct CResult_ErrorMessageDecodeErrorZ {
6527 pub contents: CResult_ErrorMessageDecodeErrorZPtr,
6528 pub result_ok: bool,
6531 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_ok(o: crate::ln::msgs::ErrorMessage) -> CResult_ErrorMessageDecodeErrorZ {
6532 CResult_ErrorMessageDecodeErrorZ {
6533 contents: CResult_ErrorMessageDecodeErrorZPtr {
6534 result: Box::into_raw(Box::new(o)),
6540 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ErrorMessageDecodeErrorZ {
6541 CResult_ErrorMessageDecodeErrorZ {
6542 contents: CResult_ErrorMessageDecodeErrorZPtr {
6543 err: Box::into_raw(Box::new(e)),
6549 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_free(_res: CResult_ErrorMessageDecodeErrorZ) { }
6550 impl Drop for CResult_ErrorMessageDecodeErrorZ {
6551 fn drop(&mut self) {
6553 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6554 let _ = unsafe { Box::from_raw(self.contents.result) };
6557 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6558 let _ = unsafe { Box::from_raw(self.contents.err) };
6563 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ErrorMessage, crate::ln::msgs::DecodeError>> for CResult_ErrorMessageDecodeErrorZ {
6564 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ErrorMessage, crate::ln::msgs::DecodeError>) -> Self {
6565 let contents = if o.result_ok {
6566 let result = unsafe { o.contents.result };
6567 unsafe { o.contents.result = std::ptr::null_mut() };
6568 CResult_ErrorMessageDecodeErrorZPtr { result }
6570 let err = unsafe { o.contents.err };
6571 unsafe { o.contents.err = std::ptr::null_mut(); }
6572 CResult_ErrorMessageDecodeErrorZPtr { err }
6576 result_ok: o.result_ok,
6580 impl Clone for CResult_ErrorMessageDecodeErrorZ {
6581 fn clone(&self) -> Self {
6583 Self { result_ok: true, contents: CResult_ErrorMessageDecodeErrorZPtr {
6584 result: Box::into_raw(Box::new(<crate::ln::msgs::ErrorMessage>::clone(unsafe { &*self.contents.result })))
6587 Self { result_ok: false, contents: CResult_ErrorMessageDecodeErrorZPtr {
6588 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6594 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_clone(orig: &CResult_ErrorMessageDecodeErrorZ) -> CResult_ErrorMessageDecodeErrorZ { orig.clone() }
6596 pub union CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6597 pub result: *mut crate::ln::msgs::UnsignedNodeAnnouncement,
6598 pub err: *mut crate::ln::msgs::DecodeError,
6601 pub struct CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6602 pub contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr,
6603 pub result_ok: bool,
6606 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedNodeAnnouncement) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6607 CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6608 contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6609 result: Box::into_raw(Box::new(o)),
6615 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6616 CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6617 contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6618 err: Box::into_raw(Box::new(e)),
6624 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res: CResult_UnsignedNodeAnnouncementDecodeErrorZ) { }
6625 impl Drop for CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6626 fn drop(&mut self) {
6628 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6629 let _ = unsafe { Box::from_raw(self.contents.result) };
6632 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6633 let _ = unsafe { Box::from_raw(self.contents.err) };
6638 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UnsignedNodeAnnouncement, crate::ln::msgs::DecodeError>> for CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6639 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UnsignedNodeAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6640 let contents = if o.result_ok {
6641 let result = unsafe { o.contents.result };
6642 unsafe { o.contents.result = std::ptr::null_mut() };
6643 CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { result }
6645 let err = unsafe { o.contents.err };
6646 unsafe { o.contents.err = std::ptr::null_mut(); }
6647 CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { err }
6651 result_ok: o.result_ok,
6655 impl Clone for CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6656 fn clone(&self) -> Self {
6658 Self { result_ok: true, contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6659 result: Box::into_raw(Box::new(<crate::ln::msgs::UnsignedNodeAnnouncement>::clone(unsafe { &*self.contents.result })))
6662 Self { result_ok: false, contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6663 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6669 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig: &CResult_UnsignedNodeAnnouncementDecodeErrorZ) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ { orig.clone() }
6671 pub union CResult_NodeAnnouncementDecodeErrorZPtr {
6672 pub result: *mut crate::ln::msgs::NodeAnnouncement,
6673 pub err: *mut crate::ln::msgs::DecodeError,
6676 pub struct CResult_NodeAnnouncementDecodeErrorZ {
6677 pub contents: CResult_NodeAnnouncementDecodeErrorZPtr,
6678 pub result_ok: bool,
6681 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::NodeAnnouncement) -> CResult_NodeAnnouncementDecodeErrorZ {
6682 CResult_NodeAnnouncementDecodeErrorZ {
6683 contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6684 result: Box::into_raw(Box::new(o)),
6690 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeAnnouncementDecodeErrorZ {
6691 CResult_NodeAnnouncementDecodeErrorZ {
6692 contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6693 err: Box::into_raw(Box::new(e)),
6699 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_free(_res: CResult_NodeAnnouncementDecodeErrorZ) { }
6700 impl Drop for CResult_NodeAnnouncementDecodeErrorZ {
6701 fn drop(&mut self) {
6703 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6704 let _ = unsafe { Box::from_raw(self.contents.result) };
6707 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6708 let _ = unsafe { Box::from_raw(self.contents.err) };
6713 impl From<crate::c_types::CResultTempl<crate::ln::msgs::NodeAnnouncement, crate::ln::msgs::DecodeError>> for CResult_NodeAnnouncementDecodeErrorZ {
6714 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::NodeAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6715 let contents = if o.result_ok {
6716 let result = unsafe { o.contents.result };
6717 unsafe { o.contents.result = std::ptr::null_mut() };
6718 CResult_NodeAnnouncementDecodeErrorZPtr { result }
6720 let err = unsafe { o.contents.err };
6721 unsafe { o.contents.err = std::ptr::null_mut(); }
6722 CResult_NodeAnnouncementDecodeErrorZPtr { err }
6726 result_ok: o.result_ok,
6730 impl Clone for CResult_NodeAnnouncementDecodeErrorZ {
6731 fn clone(&self) -> Self {
6733 Self { result_ok: true, contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6734 result: Box::into_raw(Box::new(<crate::ln::msgs::NodeAnnouncement>::clone(unsafe { &*self.contents.result })))
6737 Self { result_ok: false, contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6738 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6744 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_clone(orig: &CResult_NodeAnnouncementDecodeErrorZ) -> CResult_NodeAnnouncementDecodeErrorZ { orig.clone() }
6746 pub union CResult_QueryShortChannelIdsDecodeErrorZPtr {
6747 pub result: *mut crate::ln::msgs::QueryShortChannelIds,
6748 pub err: *mut crate::ln::msgs::DecodeError,
6751 pub struct CResult_QueryShortChannelIdsDecodeErrorZ {
6752 pub contents: CResult_QueryShortChannelIdsDecodeErrorZPtr,
6753 pub result_ok: bool,
6756 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_ok(o: crate::ln::msgs::QueryShortChannelIds) -> CResult_QueryShortChannelIdsDecodeErrorZ {
6757 CResult_QueryShortChannelIdsDecodeErrorZ {
6758 contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6759 result: Box::into_raw(Box::new(o)),
6765 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_QueryShortChannelIdsDecodeErrorZ {
6766 CResult_QueryShortChannelIdsDecodeErrorZ {
6767 contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6768 err: Box::into_raw(Box::new(e)),
6774 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_free(_res: CResult_QueryShortChannelIdsDecodeErrorZ) { }
6775 impl Drop for CResult_QueryShortChannelIdsDecodeErrorZ {
6776 fn drop(&mut self) {
6778 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6779 let _ = unsafe { Box::from_raw(self.contents.result) };
6782 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6783 let _ = unsafe { Box::from_raw(self.contents.err) };
6788 impl From<crate::c_types::CResultTempl<crate::ln::msgs::QueryShortChannelIds, crate::ln::msgs::DecodeError>> for CResult_QueryShortChannelIdsDecodeErrorZ {
6789 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::QueryShortChannelIds, crate::ln::msgs::DecodeError>) -> Self {
6790 let contents = if o.result_ok {
6791 let result = unsafe { o.contents.result };
6792 unsafe { o.contents.result = std::ptr::null_mut() };
6793 CResult_QueryShortChannelIdsDecodeErrorZPtr { result }
6795 let err = unsafe { o.contents.err };
6796 unsafe { o.contents.err = std::ptr::null_mut(); }
6797 CResult_QueryShortChannelIdsDecodeErrorZPtr { err }
6801 result_ok: o.result_ok,
6805 impl Clone for CResult_QueryShortChannelIdsDecodeErrorZ {
6806 fn clone(&self) -> Self {
6808 Self { result_ok: true, contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6809 result: Box::into_raw(Box::new(<crate::ln::msgs::QueryShortChannelIds>::clone(unsafe { &*self.contents.result })))
6812 Self { result_ok: false, contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6813 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6819 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig: &CResult_QueryShortChannelIdsDecodeErrorZ) -> CResult_QueryShortChannelIdsDecodeErrorZ { orig.clone() }
6821 pub union CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6822 pub result: *mut crate::ln::msgs::ReplyShortChannelIdsEnd,
6823 pub err: *mut crate::ln::msgs::DecodeError,
6826 pub struct CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6827 pub contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr,
6828 pub result_ok: bool,
6831 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o: crate::ln::msgs::ReplyShortChannelIdsEnd) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6832 CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6833 contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6834 result: Box::into_raw(Box::new(o)),
6840 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6841 CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6842 contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6843 err: Box::into_raw(Box::new(e)),
6849 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res: CResult_ReplyShortChannelIdsEndDecodeErrorZ) { }
6850 impl Drop for CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6851 fn drop(&mut self) {
6853 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6854 let _ = unsafe { Box::from_raw(self.contents.result) };
6857 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6858 let _ = unsafe { Box::from_raw(self.contents.err) };
6863 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ReplyShortChannelIdsEnd, crate::ln::msgs::DecodeError>> for CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6864 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ReplyShortChannelIdsEnd, crate::ln::msgs::DecodeError>) -> Self {
6865 let contents = if o.result_ok {
6866 let result = unsafe { o.contents.result };
6867 unsafe { o.contents.result = std::ptr::null_mut() };
6868 CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { result }
6870 let err = unsafe { o.contents.err };
6871 unsafe { o.contents.err = std::ptr::null_mut(); }
6872 CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { err }
6876 result_ok: o.result_ok,
6880 impl Clone for CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6881 fn clone(&self) -> Self {
6883 Self { result_ok: true, contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6884 result: Box::into_raw(Box::new(<crate::ln::msgs::ReplyShortChannelIdsEnd>::clone(unsafe { &*self.contents.result })))
6887 Self { result_ok: false, contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6888 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6894 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig: &CResult_ReplyShortChannelIdsEndDecodeErrorZ) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ { orig.clone() }
6896 pub union CResult_QueryChannelRangeDecodeErrorZPtr {
6897 pub result: *mut crate::ln::msgs::QueryChannelRange,
6898 pub err: *mut crate::ln::msgs::DecodeError,
6901 pub struct CResult_QueryChannelRangeDecodeErrorZ {
6902 pub contents: CResult_QueryChannelRangeDecodeErrorZPtr,
6903 pub result_ok: bool,
6906 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_ok(o: crate::ln::msgs::QueryChannelRange) -> CResult_QueryChannelRangeDecodeErrorZ {
6907 CResult_QueryChannelRangeDecodeErrorZ {
6908 contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6909 result: Box::into_raw(Box::new(o)),
6915 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_QueryChannelRangeDecodeErrorZ {
6916 CResult_QueryChannelRangeDecodeErrorZ {
6917 contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6918 err: Box::into_raw(Box::new(e)),
6924 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_free(_res: CResult_QueryChannelRangeDecodeErrorZ) { }
6925 impl Drop for CResult_QueryChannelRangeDecodeErrorZ {
6926 fn drop(&mut self) {
6928 if unsafe { !(self.contents.result as *mut ()).is_null() } {
6929 let _ = unsafe { Box::from_raw(self.contents.result) };
6932 if unsafe { !(self.contents.err as *mut ()).is_null() } {
6933 let _ = unsafe { Box::from_raw(self.contents.err) };
6938 impl From<crate::c_types::CResultTempl<crate::ln::msgs::QueryChannelRange, crate::ln::msgs::DecodeError>> for CResult_QueryChannelRangeDecodeErrorZ {
6939 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::QueryChannelRange, crate::ln::msgs::DecodeError>) -> Self {
6940 let contents = if o.result_ok {
6941 let result = unsafe { o.contents.result };
6942 unsafe { o.contents.result = std::ptr::null_mut() };
6943 CResult_QueryChannelRangeDecodeErrorZPtr { result }
6945 let err = unsafe { o.contents.err };
6946 unsafe { o.contents.err = std::ptr::null_mut(); }
6947 CResult_QueryChannelRangeDecodeErrorZPtr { err }
6951 result_ok: o.result_ok,
6955 impl Clone for CResult_QueryChannelRangeDecodeErrorZ {
6956 fn clone(&self) -> Self {
6958 Self { result_ok: true, contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6959 result: Box::into_raw(Box::new(<crate::ln::msgs::QueryChannelRange>::clone(unsafe { &*self.contents.result })))
6962 Self { result_ok: false, contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6963 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6969 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_clone(orig: &CResult_QueryChannelRangeDecodeErrorZ) -> CResult_QueryChannelRangeDecodeErrorZ { orig.clone() }
6971 pub union CResult_ReplyChannelRangeDecodeErrorZPtr {
6972 pub result: *mut crate::ln::msgs::ReplyChannelRange,
6973 pub err: *mut crate::ln::msgs::DecodeError,
6976 pub struct CResult_ReplyChannelRangeDecodeErrorZ {
6977 pub contents: CResult_ReplyChannelRangeDecodeErrorZPtr,
6978 pub result_ok: bool,
6981 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_ok(o: crate::ln::msgs::ReplyChannelRange) -> CResult_ReplyChannelRangeDecodeErrorZ {
6982 CResult_ReplyChannelRangeDecodeErrorZ {
6983 contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
6984 result: Box::into_raw(Box::new(o)),
6990 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ReplyChannelRangeDecodeErrorZ {
6991 CResult_ReplyChannelRangeDecodeErrorZ {
6992 contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
6993 err: Box::into_raw(Box::new(e)),
6999 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_free(_res: CResult_ReplyChannelRangeDecodeErrorZ) { }
7000 impl Drop for CResult_ReplyChannelRangeDecodeErrorZ {
7001 fn drop(&mut self) {
7003 if unsafe { !(self.contents.result as *mut ()).is_null() } {
7004 let _ = unsafe { Box::from_raw(self.contents.result) };
7007 if unsafe { !(self.contents.err as *mut ()).is_null() } {
7008 let _ = unsafe { Box::from_raw(self.contents.err) };
7013 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ReplyChannelRange, crate::ln::msgs::DecodeError>> for CResult_ReplyChannelRangeDecodeErrorZ {
7014 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ReplyChannelRange, crate::ln::msgs::DecodeError>) -> Self {
7015 let contents = if o.result_ok {
7016 let result = unsafe { o.contents.result };
7017 unsafe { o.contents.result = std::ptr::null_mut() };
7018 CResult_ReplyChannelRangeDecodeErrorZPtr { result }
7020 let err = unsafe { o.contents.err };
7021 unsafe { o.contents.err = std::ptr::null_mut(); }
7022 CResult_ReplyChannelRangeDecodeErrorZPtr { err }
7026 result_ok: o.result_ok,
7030 impl Clone for CResult_ReplyChannelRangeDecodeErrorZ {
7031 fn clone(&self) -> Self {
7033 Self { result_ok: true, contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
7034 result: Box::into_raw(Box::new(<crate::ln::msgs::ReplyChannelRange>::clone(unsafe { &*self.contents.result })))
7037 Self { result_ok: false, contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
7038 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
7044 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_clone(orig: &CResult_ReplyChannelRangeDecodeErrorZ) -> CResult_ReplyChannelRangeDecodeErrorZ { orig.clone() }
7046 pub union CResult_GossipTimestampFilterDecodeErrorZPtr {
7047 pub result: *mut crate::ln::msgs::GossipTimestampFilter,
7048 pub err: *mut crate::ln::msgs::DecodeError,
7051 pub struct CResult_GossipTimestampFilterDecodeErrorZ {
7052 pub contents: CResult_GossipTimestampFilterDecodeErrorZPtr,
7053 pub result_ok: bool,
7056 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_ok(o: crate::ln::msgs::GossipTimestampFilter) -> CResult_GossipTimestampFilterDecodeErrorZ {
7057 CResult_GossipTimestampFilterDecodeErrorZ {
7058 contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
7059 result: Box::into_raw(Box::new(o)),
7065 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_GossipTimestampFilterDecodeErrorZ {
7066 CResult_GossipTimestampFilterDecodeErrorZ {
7067 contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
7068 err: Box::into_raw(Box::new(e)),
7074 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_free(_res: CResult_GossipTimestampFilterDecodeErrorZ) { }
7075 impl Drop for CResult_GossipTimestampFilterDecodeErrorZ {
7076 fn drop(&mut self) {
7078 if unsafe { !(self.contents.result as *mut ()).is_null() } {
7079 let _ = unsafe { Box::from_raw(self.contents.result) };
7082 if unsafe { !(self.contents.err as *mut ()).is_null() } {
7083 let _ = unsafe { Box::from_raw(self.contents.err) };
7088 impl From<crate::c_types::CResultTempl<crate::ln::msgs::GossipTimestampFilter, crate::ln::msgs::DecodeError>> for CResult_GossipTimestampFilterDecodeErrorZ {
7089 fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::GossipTimestampFilter, crate::ln::msgs::DecodeError>) -> Self {
7090 let contents = if o.result_ok {
7091 let result = unsafe { o.contents.result };
7092 unsafe { o.contents.result = std::ptr::null_mut() };
7093 CResult_GossipTimestampFilterDecodeErrorZPtr { result }
7095 let err = unsafe { o.contents.err };
7096 unsafe { o.contents.err = std::ptr::null_mut(); }
7097 CResult_GossipTimestampFilterDecodeErrorZPtr { err }
7101 result_ok: o.result_ok,
7105 impl Clone for CResult_GossipTimestampFilterDecodeErrorZ {
7106 fn clone(&self) -> Self {
7108 Self { result_ok: true, contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
7109 result: Box::into_raw(Box::new(<crate::ln::msgs::GossipTimestampFilter>::clone(unsafe { &*self.contents.result })))
7112 Self { result_ok: false, contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
7113 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
7119 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_clone(orig: &CResult_GossipTimestampFilterDecodeErrorZ) -> CResult_GossipTimestampFilterDecodeErrorZ { orig.clone() }