- bindings updates
[rust-lightning] / lightning-c-bindings / src / c_types / derived.rs
1 #[repr(C)]
2 pub union CResult_SecretKeyErrorZPtr {
3         pub result: *mut crate::c_types::SecretKey,
4         pub err: *mut crate::c_types::Secp256k1Error,
5 }
6 #[repr(C)]
7 pub struct CResult_SecretKeyErrorZ {
8         pub contents: CResult_SecretKeyErrorZPtr,
9         pub result_ok: bool,
10 }
11 #[no_mangle]
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)),
16                 },
17                 result_ok: true,
18         }
19 }
20 #[no_mangle]
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)),
25                 },
26                 result_ok: false,
27         }
28 }
29 #[no_mangle]
30 pub extern "C" fn CResult_SecretKeyErrorZ_free(_res: CResult_SecretKeyErrorZ) { }
31 impl Drop for CResult_SecretKeyErrorZ {
32         fn drop(&mut self) {
33                 if self.result_ok {
34                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
35                                 let _ = unsafe { Box::from_raw(self.contents.result) };
36                         }
37                 } else {
38                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
39                                 let _ = unsafe { Box::from_raw(self.contents.err) };
40                         }
41                 }
42         }
43 }
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 }
50                 } else {
51                         let err = unsafe { o.contents.err };
52                         unsafe { o.contents.err = std::ptr::null_mut(); }
53                         CResult_SecretKeyErrorZPtr { err }
54                 };
55                 Self {
56                         contents,
57                         result_ok: o.result_ok,
58                 }
59         }
60 }
61 #[repr(C)]
62 pub union CResult_PublicKeyErrorZPtr {
63         pub result: *mut crate::c_types::PublicKey,
64         pub err: *mut crate::c_types::Secp256k1Error,
65 }
66 #[repr(C)]
67 pub struct CResult_PublicKeyErrorZ {
68         pub contents: CResult_PublicKeyErrorZPtr,
69         pub result_ok: bool,
70 }
71 #[no_mangle]
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)),
76                 },
77                 result_ok: true,
78         }
79 }
80 #[no_mangle]
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)),
85                 },
86                 result_ok: false,
87         }
88 }
89 #[no_mangle]
90 pub extern "C" fn CResult_PublicKeyErrorZ_free(_res: CResult_PublicKeyErrorZ) { }
91 impl Drop for CResult_PublicKeyErrorZ {
92         fn drop(&mut self) {
93                 if self.result_ok {
94                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
95                                 let _ = unsafe { Box::from_raw(self.contents.result) };
96                         }
97                 } else {
98                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
99                                 let _ = unsafe { Box::from_raw(self.contents.err) };
100                         }
101                 }
102         }
103 }
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 }
110                 } else {
111                         let err = unsafe { o.contents.err };
112                         unsafe { o.contents.err = std::ptr::null_mut(); }
113                         CResult_PublicKeyErrorZPtr { err }
114                 };
115                 Self {
116                         contents,
117                         result_ok: o.result_ok,
118                 }
119         }
120 }
121 #[repr(C)]
122 pub union CResult_TxCreationKeysDecodeErrorZPtr {
123         pub result: *mut crate::ln::chan_utils::TxCreationKeys,
124         pub err: *mut crate::ln::msgs::DecodeError,
125 }
126 #[repr(C)]
127 pub struct CResult_TxCreationKeysDecodeErrorZ {
128         pub contents: CResult_TxCreationKeysDecodeErrorZPtr,
129         pub result_ok: bool,
130 }
131 #[no_mangle]
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)),
136                 },
137                 result_ok: true,
138         }
139 }
140 #[no_mangle]
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)),
145                 },
146                 result_ok: false,
147         }
148 }
149 #[no_mangle]
150 pub extern "C" fn CResult_TxCreationKeysDecodeErrorZ_free(_res: CResult_TxCreationKeysDecodeErrorZ) { }
151 impl Drop for CResult_TxCreationKeysDecodeErrorZ {
152         fn drop(&mut self) {
153                 if self.result_ok {
154                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
155                                 let _ = unsafe { Box::from_raw(self.contents.result) };
156                         }
157                 } else {
158                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
159                                 let _ = unsafe { Box::from_raw(self.contents.err) };
160                         }
161                 }
162         }
163 }
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 }
170                 } else {
171                         let err = unsafe { o.contents.err };
172                         unsafe { o.contents.err = std::ptr::null_mut(); }
173                         CResult_TxCreationKeysDecodeErrorZPtr { err }
174                 };
175                 Self {
176                         contents,
177                         result_ok: o.result_ok,
178                 }
179         }
180 }
181 impl Clone for CResult_TxCreationKeysDecodeErrorZ {
182         fn clone(&self) -> Self {
183                 if self.result_ok {
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 })))
186                         } }
187                 } else {
188                         Self { result_ok: false, contents: CResult_TxCreationKeysDecodeErrorZPtr {
189                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
190                         } }
191                 }
192         }
193 }
194 #[no_mangle]
195 pub extern "C" fn CResult_TxCreationKeysDecodeErrorZ_clone(orig: &CResult_TxCreationKeysDecodeErrorZ) -> CResult_TxCreationKeysDecodeErrorZ { orig.clone() }
196 #[repr(C)]
197 pub union CResult_ChannelPublicKeysDecodeErrorZPtr {
198         pub result: *mut crate::ln::chan_utils::ChannelPublicKeys,
199         pub err: *mut crate::ln::msgs::DecodeError,
200 }
201 #[repr(C)]
202 pub struct CResult_ChannelPublicKeysDecodeErrorZ {
203         pub contents: CResult_ChannelPublicKeysDecodeErrorZPtr,
204         pub result_ok: bool,
205 }
206 #[no_mangle]
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)),
211                 },
212                 result_ok: true,
213         }
214 }
215 #[no_mangle]
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)),
220                 },
221                 result_ok: false,
222         }
223 }
224 #[no_mangle]
225 pub extern "C" fn CResult_ChannelPublicKeysDecodeErrorZ_free(_res: CResult_ChannelPublicKeysDecodeErrorZ) { }
226 impl Drop for CResult_ChannelPublicKeysDecodeErrorZ {
227         fn drop(&mut self) {
228                 if self.result_ok {
229                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
230                                 let _ = unsafe { Box::from_raw(self.contents.result) };
231                         }
232                 } else {
233                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
234                                 let _ = unsafe { Box::from_raw(self.contents.err) };
235                         }
236                 }
237         }
238 }
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 }
245                 } else {
246                         let err = unsafe { o.contents.err };
247                         unsafe { o.contents.err = std::ptr::null_mut(); }
248                         CResult_ChannelPublicKeysDecodeErrorZPtr { err }
249                 };
250                 Self {
251                         contents,
252                         result_ok: o.result_ok,
253                 }
254         }
255 }
256 impl Clone for CResult_ChannelPublicKeysDecodeErrorZ {
257         fn clone(&self) -> Self {
258                 if self.result_ok {
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 })))
261                         } }
262                 } else {
263                         Self { result_ok: false, contents: CResult_ChannelPublicKeysDecodeErrorZPtr {
264                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
265                         } }
266                 }
267         }
268 }
269 #[no_mangle]
270 pub extern "C" fn CResult_ChannelPublicKeysDecodeErrorZ_clone(orig: &CResult_ChannelPublicKeysDecodeErrorZ) -> CResult_ChannelPublicKeysDecodeErrorZ { orig.clone() }
271 #[repr(C)]
272 pub union CResult_TxCreationKeysErrorZPtr {
273         pub result: *mut crate::ln::chan_utils::TxCreationKeys,
274         pub err: *mut crate::c_types::Secp256k1Error,
275 }
276 #[repr(C)]
277 pub struct CResult_TxCreationKeysErrorZ {
278         pub contents: CResult_TxCreationKeysErrorZPtr,
279         pub result_ok: bool,
280 }
281 #[no_mangle]
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)),
286                 },
287                 result_ok: true,
288         }
289 }
290 #[no_mangle]
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)),
295                 },
296                 result_ok: false,
297         }
298 }
299 #[no_mangle]
300 pub extern "C" fn CResult_TxCreationKeysErrorZ_free(_res: CResult_TxCreationKeysErrorZ) { }
301 impl Drop for CResult_TxCreationKeysErrorZ {
302         fn drop(&mut self) {
303                 if self.result_ok {
304                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
305                                 let _ = unsafe { Box::from_raw(self.contents.result) };
306                         }
307                 } else {
308                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
309                                 let _ = unsafe { Box::from_raw(self.contents.err) };
310                         }
311                 }
312         }
313 }
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 }
320                 } else {
321                         let err = unsafe { o.contents.err };
322                         unsafe { o.contents.err = std::ptr::null_mut(); }
323                         CResult_TxCreationKeysErrorZPtr { err }
324                 };
325                 Self {
326                         contents,
327                         result_ok: o.result_ok,
328                 }
329         }
330 }
331 #[repr(C)]
332 pub union CResult_HTLCOutputInCommitmentDecodeErrorZPtr {
333         pub result: *mut crate::ln::chan_utils::HTLCOutputInCommitment,
334         pub err: *mut crate::ln::msgs::DecodeError,
335 }
336 #[repr(C)]
337 pub struct CResult_HTLCOutputInCommitmentDecodeErrorZ {
338         pub contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr,
339         pub result_ok: bool,
340 }
341 #[no_mangle]
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)),
346                 },
347                 result_ok: true,
348         }
349 }
350 #[no_mangle]
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)),
355                 },
356                 result_ok: false,
357         }
358 }
359 #[no_mangle]
360 pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res: CResult_HTLCOutputInCommitmentDecodeErrorZ) { }
361 impl Drop for CResult_HTLCOutputInCommitmentDecodeErrorZ {
362         fn drop(&mut self) {
363                 if self.result_ok {
364                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
365                                 let _ = unsafe { Box::from_raw(self.contents.result) };
366                         }
367                 } else {
368                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
369                                 let _ = unsafe { Box::from_raw(self.contents.err) };
370                         }
371                 }
372         }
373 }
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 }
380                 } else {
381                         let err = unsafe { o.contents.err };
382                         unsafe { o.contents.err = std::ptr::null_mut(); }
383                         CResult_HTLCOutputInCommitmentDecodeErrorZPtr { err }
384                 };
385                 Self {
386                         contents,
387                         result_ok: o.result_ok,
388                 }
389         }
390 }
391 impl Clone for CResult_HTLCOutputInCommitmentDecodeErrorZ {
392         fn clone(&self) -> Self {
393                 if self.result_ok {
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 })))
396                         } }
397                 } else {
398                         Self { result_ok: false, contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr {
399                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
400                         } }
401                 }
402         }
403 }
404 #[no_mangle]
405 pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig: &CResult_HTLCOutputInCommitmentDecodeErrorZ) -> CResult_HTLCOutputInCommitmentDecodeErrorZ { orig.clone() }
406 #[repr(C)]
407 pub union CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
408         pub result: *mut crate::ln::chan_utils::CounterpartyChannelTransactionParameters,
409         pub err: *mut crate::ln::msgs::DecodeError,
410 }
411 #[repr(C)]
412 pub struct CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
413         pub contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr,
414         pub result_ok: bool,
415 }
416 #[no_mangle]
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)),
421                 },
422                 result_ok: true,
423         }
424 }
425 #[no_mangle]
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)),
430                 },
431                 result_ok: false,
432         }
433 }
434 #[no_mangle]
435 pub extern "C" fn CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res: CResult_CounterpartyChannelTransactionParametersDecodeErrorZ) { }
436 impl Drop for CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
437         fn drop(&mut self) {
438                 if self.result_ok {
439                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
440                                 let _ = unsafe { Box::from_raw(self.contents.result) };
441                         }
442                 } else {
443                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
444                                 let _ = unsafe { Box::from_raw(self.contents.err) };
445                         }
446                 }
447         }
448 }
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 }
455                 } else {
456                         let err = unsafe { o.contents.err };
457                         unsafe { o.contents.err = std::ptr::null_mut(); }
458                         CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { err }
459                 };
460                 Self {
461                         contents,
462                         result_ok: o.result_ok,
463                 }
464         }
465 }
466 impl Clone for CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
467         fn clone(&self) -> Self {
468                 if self.result_ok {
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 })))
471                         } }
472                 } else {
473                         Self { result_ok: false, contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
474                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
475                         } }
476                 }
477         }
478 }
479 #[no_mangle]
480 pub extern "C" fn CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig: &CResult_CounterpartyChannelTransactionParametersDecodeErrorZ) -> CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { orig.clone() }
481 #[repr(C)]
482 pub union CResult_ChannelTransactionParametersDecodeErrorZPtr {
483         pub result: *mut crate::ln::chan_utils::ChannelTransactionParameters,
484         pub err: *mut crate::ln::msgs::DecodeError,
485 }
486 #[repr(C)]
487 pub struct CResult_ChannelTransactionParametersDecodeErrorZ {
488         pub contents: CResult_ChannelTransactionParametersDecodeErrorZPtr,
489         pub result_ok: bool,
490 }
491 #[no_mangle]
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)),
496                 },
497                 result_ok: true,
498         }
499 }
500 #[no_mangle]
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)),
505                 },
506                 result_ok: false,
507         }
508 }
509 #[no_mangle]
510 pub extern "C" fn CResult_ChannelTransactionParametersDecodeErrorZ_free(_res: CResult_ChannelTransactionParametersDecodeErrorZ) { }
511 impl Drop for CResult_ChannelTransactionParametersDecodeErrorZ {
512         fn drop(&mut self) {
513                 if self.result_ok {
514                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
515                                 let _ = unsafe { Box::from_raw(self.contents.result) };
516                         }
517                 } else {
518                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
519                                 let _ = unsafe { Box::from_raw(self.contents.err) };
520                         }
521                 }
522         }
523 }
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 }
530                 } else {
531                         let err = unsafe { o.contents.err };
532                         unsafe { o.contents.err = std::ptr::null_mut(); }
533                         CResult_ChannelTransactionParametersDecodeErrorZPtr { err }
534                 };
535                 Self {
536                         contents,
537                         result_ok: o.result_ok,
538                 }
539         }
540 }
541 impl Clone for CResult_ChannelTransactionParametersDecodeErrorZ {
542         fn clone(&self) -> Self {
543                 if self.result_ok {
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 })))
546                         } }
547                 } else {
548                         Self { result_ok: false, contents: CResult_ChannelTransactionParametersDecodeErrorZPtr {
549                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
550                         } }
551                 }
552         }
553 }
554 #[no_mangle]
555 pub extern "C" fn CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig: &CResult_ChannelTransactionParametersDecodeErrorZ) -> CResult_ChannelTransactionParametersDecodeErrorZ { orig.clone() }
556 #[repr(C)]
557 pub struct CVec_SignatureZ {
558         pub data: *mut crate::c_types::Signature,
559         pub datalen: usize
560 }
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();
566                 self.datalen = 0;
567                 ret
568         }
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) }
571         }
572 }
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() } }
578         }
579 }
580 #[no_mangle]
581 pub extern "C" fn CVec_SignatureZ_free(_res: CVec_SignatureZ) { }
582 impl Drop for CVec_SignatureZ {
583         fn drop(&mut self) {
584                 if self.datalen == 0 { return; }
585                 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
586         }
587 }
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) });
593                 Self::from(res)
594         }
595 }
596 #[repr(C)]
597 pub union CResult_HolderCommitmentTransactionDecodeErrorZPtr {
598         pub result: *mut crate::ln::chan_utils::HolderCommitmentTransaction,
599         pub err: *mut crate::ln::msgs::DecodeError,
600 }
601 #[repr(C)]
602 pub struct CResult_HolderCommitmentTransactionDecodeErrorZ {
603         pub contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr,
604         pub result_ok: bool,
605 }
606 #[no_mangle]
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)),
611                 },
612                 result_ok: true,
613         }
614 }
615 #[no_mangle]
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)),
620                 },
621                 result_ok: false,
622         }
623 }
624 #[no_mangle]
625 pub extern "C" fn CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res: CResult_HolderCommitmentTransactionDecodeErrorZ) { }
626 impl Drop for CResult_HolderCommitmentTransactionDecodeErrorZ {
627         fn drop(&mut self) {
628                 if self.result_ok {
629                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
630                                 let _ = unsafe { Box::from_raw(self.contents.result) };
631                         }
632                 } else {
633                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
634                                 let _ = unsafe { Box::from_raw(self.contents.err) };
635                         }
636                 }
637         }
638 }
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 }
645                 } else {
646                         let err = unsafe { o.contents.err };
647                         unsafe { o.contents.err = std::ptr::null_mut(); }
648                         CResult_HolderCommitmentTransactionDecodeErrorZPtr { err }
649                 };
650                 Self {
651                         contents,
652                         result_ok: o.result_ok,
653                 }
654         }
655 }
656 impl Clone for CResult_HolderCommitmentTransactionDecodeErrorZ {
657         fn clone(&self) -> Self {
658                 if self.result_ok {
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 })))
661                         } }
662                 } else {
663                         Self { result_ok: false, contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr {
664                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
665                         } }
666                 }
667         }
668 }
669 #[no_mangle]
670 pub extern "C" fn CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig: &CResult_HolderCommitmentTransactionDecodeErrorZ) -> CResult_HolderCommitmentTransactionDecodeErrorZ { orig.clone() }
671 #[repr(C)]
672 pub union CResult_BuiltCommitmentTransactionDecodeErrorZPtr {
673         pub result: *mut crate::ln::chan_utils::BuiltCommitmentTransaction,
674         pub err: *mut crate::ln::msgs::DecodeError,
675 }
676 #[repr(C)]
677 pub struct CResult_BuiltCommitmentTransactionDecodeErrorZ {
678         pub contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr,
679         pub result_ok: bool,
680 }
681 #[no_mangle]
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)),
686                 },
687                 result_ok: true,
688         }
689 }
690 #[no_mangle]
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)),
695                 },
696                 result_ok: false,
697         }
698 }
699 #[no_mangle]
700 pub extern "C" fn CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res: CResult_BuiltCommitmentTransactionDecodeErrorZ) { }
701 impl Drop for CResult_BuiltCommitmentTransactionDecodeErrorZ {
702         fn drop(&mut self) {
703                 if self.result_ok {
704                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
705                                 let _ = unsafe { Box::from_raw(self.contents.result) };
706                         }
707                 } else {
708                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
709                                 let _ = unsafe { Box::from_raw(self.contents.err) };
710                         }
711                 }
712         }
713 }
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 }
720                 } else {
721                         let err = unsafe { o.contents.err };
722                         unsafe { o.contents.err = std::ptr::null_mut(); }
723                         CResult_BuiltCommitmentTransactionDecodeErrorZPtr { err }
724                 };
725                 Self {
726                         contents,
727                         result_ok: o.result_ok,
728                 }
729         }
730 }
731 impl Clone for CResult_BuiltCommitmentTransactionDecodeErrorZ {
732         fn clone(&self) -> Self {
733                 if self.result_ok {
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 })))
736                         } }
737                 } else {
738                         Self { result_ok: false, contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr {
739                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
740                         } }
741                 }
742         }
743 }
744 #[no_mangle]
745 pub extern "C" fn CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig: &CResult_BuiltCommitmentTransactionDecodeErrorZ) -> CResult_BuiltCommitmentTransactionDecodeErrorZ { orig.clone() }
746 #[repr(C)]
747 pub union CResult_CommitmentTransactionDecodeErrorZPtr {
748         pub result: *mut crate::ln::chan_utils::CommitmentTransaction,
749         pub err: *mut crate::ln::msgs::DecodeError,
750 }
751 #[repr(C)]
752 pub struct CResult_CommitmentTransactionDecodeErrorZ {
753         pub contents: CResult_CommitmentTransactionDecodeErrorZPtr,
754         pub result_ok: bool,
755 }
756 #[no_mangle]
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)),
761                 },
762                 result_ok: true,
763         }
764 }
765 #[no_mangle]
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)),
770                 },
771                 result_ok: false,
772         }
773 }
774 #[no_mangle]
775 pub extern "C" fn CResult_CommitmentTransactionDecodeErrorZ_free(_res: CResult_CommitmentTransactionDecodeErrorZ) { }
776 impl Drop for CResult_CommitmentTransactionDecodeErrorZ {
777         fn drop(&mut self) {
778                 if self.result_ok {
779                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
780                                 let _ = unsafe { Box::from_raw(self.contents.result) };
781                         }
782                 } else {
783                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
784                                 let _ = unsafe { Box::from_raw(self.contents.err) };
785                         }
786                 }
787         }
788 }
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 }
795                 } else {
796                         let err = unsafe { o.contents.err };
797                         unsafe { o.contents.err = std::ptr::null_mut(); }
798                         CResult_CommitmentTransactionDecodeErrorZPtr { err }
799                 };
800                 Self {
801                         contents,
802                         result_ok: o.result_ok,
803                 }
804         }
805 }
806 impl Clone for CResult_CommitmentTransactionDecodeErrorZ {
807         fn clone(&self) -> Self {
808                 if self.result_ok {
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 })))
811                         } }
812                 } else {
813                         Self { result_ok: false, contents: CResult_CommitmentTransactionDecodeErrorZPtr {
814                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
815                         } }
816                 }
817         }
818 }
819 #[no_mangle]
820 pub extern "C" fn CResult_CommitmentTransactionDecodeErrorZ_clone(orig: &CResult_CommitmentTransactionDecodeErrorZ) -> CResult_CommitmentTransactionDecodeErrorZ { orig.clone() }
821 #[repr(C)]
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,
826 }
827 #[repr(C)]
828 pub struct CResult_TrustedCommitmentTransactionNoneZ {
829         pub contents: CResult_TrustedCommitmentTransactionNoneZPtr,
830         pub result_ok: bool,
831 }
832 #[no_mangle]
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)),
837                 },
838                 result_ok: true,
839         }
840 }
841 #[no_mangle]
842 pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_err() -> CResult_TrustedCommitmentTransactionNoneZ {
843         CResult_TrustedCommitmentTransactionNoneZ {
844                 contents: CResult_TrustedCommitmentTransactionNoneZPtr {
845                         err: std::ptr::null_mut(),
846                 },
847                 result_ok: false,
848         }
849 }
850 #[no_mangle]
851 pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_free(_res: CResult_TrustedCommitmentTransactionNoneZ) { }
852 impl Drop for CResult_TrustedCommitmentTransactionNoneZ {
853         fn drop(&mut self) {
854                 if self.result_ok {
855                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
856                                 let _ = unsafe { Box::from_raw(self.contents.result) };
857                         }
858                 } else {
859                 }
860         }
861 }
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 }
868                 } else {
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() }
872                 };
873                 Self {
874                         contents,
875                         result_ok: o.result_ok,
876                 }
877         }
878 }
879 #[repr(C)]
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,
884 }
885 #[repr(C)]
886 pub struct CResult_CVec_SignatureZNoneZ {
887         pub contents: CResult_CVec_SignatureZNoneZPtr,
888         pub result_ok: bool,
889 }
890 #[no_mangle]
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)),
895                 },
896                 result_ok: true,
897         }
898 }
899 #[no_mangle]
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(),
904                 },
905                 result_ok: false,
906         }
907 }
908 #[no_mangle]
909 pub extern "C" fn CResult_CVec_SignatureZNoneZ_free(_res: CResult_CVec_SignatureZNoneZ) { }
910 impl Drop for CResult_CVec_SignatureZNoneZ {
911         fn drop(&mut self) {
912                 if self.result_ok {
913                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
914                                 let _ = unsafe { Box::from_raw(self.contents.result) };
915                         }
916                 } else {
917                 }
918         }
919 }
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 }
926                 } else {
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() }
930                 };
931                 Self {
932                         contents,
933                         result_ok: o.result_ok,
934                 }
935         }
936 }
937 impl Clone for CResult_CVec_SignatureZNoneZ {
938         fn clone(&self) -> Self {
939                 if self.result_ok {
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 })))
942                         } }
943                 } else {
944                         Self { result_ok: false, contents: CResult_CVec_SignatureZNoneZPtr {
945                                 err: std::ptr::null_mut()
946                         } }
947                 }
948         }
949 }
950 #[no_mangle]
951 pub extern "C" fn CResult_CVec_SignatureZNoneZ_clone(orig: &CResult_CVec_SignatureZNoneZ) -> CResult_CVec_SignatureZNoneZ { orig.clone() }
952 #[repr(C)]
953 pub struct CVec_PublicKeyZ {
954         pub data: *mut crate::c_types::PublicKey,
955         pub datalen: usize
956 }
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();
962                 self.datalen = 0;
963                 ret
964         }
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) }
967         }
968 }
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() } }
974         }
975 }
976 #[no_mangle]
977 pub extern "C" fn CVec_PublicKeyZ_free(_res: CVec_PublicKeyZ) { }
978 impl Drop for CVec_PublicKeyZ {
979         fn drop(&mut self) {
980                 if self.datalen == 0 { return; }
981                 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
982         }
983 }
984 #[repr(C)]
985 pub struct CVec_u8Z {
986         pub data: *mut u8,
987         pub datalen: usize
988 }
989 impl 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();
994                 self.datalen = 0;
995                 ret
996         }
997         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[u8] {
998                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
999         }
1000 }
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() } }
1006         }
1007 }
1008 #[no_mangle]
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)) };
1014         }
1015 }
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) });
1021                 Self::from(res)
1022         }
1023 }
1024 #[repr(C)]
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,
1028 }
1029 #[repr(C)]
1030 pub struct CResult_CVec_u8ZPeerHandleErrorZ {
1031         pub contents: CResult_CVec_u8ZPeerHandleErrorZPtr,
1032         pub result_ok: bool,
1033 }
1034 #[no_mangle]
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)),
1039                 },
1040                 result_ok: true,
1041         }
1042 }
1043 #[no_mangle]
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)),
1048                 },
1049                 result_ok: false,
1050         }
1051 }
1052 #[no_mangle]
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) {
1056                 if self.result_ok {
1057                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
1058                                 let _ = unsafe { Box::from_raw(self.contents.result) };
1059                         }
1060                 } else {
1061                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1062                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1063                         }
1064                 }
1065         }
1066 }
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 }
1073                 } else {
1074                         let err = unsafe { o.contents.err };
1075                         unsafe { o.contents.err = std::ptr::null_mut(); }
1076                         CResult_CVec_u8ZPeerHandleErrorZPtr { err }
1077                 };
1078                 Self {
1079                         contents,
1080                         result_ok: o.result_ok,
1081                 }
1082         }
1083 }
1084 impl Clone for CResult_CVec_u8ZPeerHandleErrorZ {
1085         fn clone(&self) -> Self {
1086                 if self.result_ok {
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 })))
1089                         } }
1090                 } else {
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 })))
1093                         } }
1094                 }
1095         }
1096 }
1097 #[no_mangle]
1098 pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_clone(orig: &CResult_CVec_u8ZPeerHandleErrorZ) -> CResult_CVec_u8ZPeerHandleErrorZ { orig.clone() }
1099 #[repr(C)]
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,
1104 }
1105 #[repr(C)]
1106 pub struct CResult_NonePeerHandleErrorZ {
1107         pub contents: CResult_NonePeerHandleErrorZPtr,
1108         pub result_ok: bool,
1109 }
1110 #[no_mangle]
1111 pub extern "C" fn CResult_NonePeerHandleErrorZ_ok() -> CResult_NonePeerHandleErrorZ {
1112         CResult_NonePeerHandleErrorZ {
1113                 contents: CResult_NonePeerHandleErrorZPtr {
1114                         result: std::ptr::null_mut(),
1115                 },
1116                 result_ok: true,
1117         }
1118 }
1119 #[no_mangle]
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)),
1124                 },
1125                 result_ok: false,
1126         }
1127 }
1128 #[no_mangle]
1129 pub extern "C" fn CResult_NonePeerHandleErrorZ_free(_res: CResult_NonePeerHandleErrorZ) { }
1130 impl Drop for CResult_NonePeerHandleErrorZ {
1131         fn drop(&mut self) {
1132                 if self.result_ok {
1133                 } else {
1134                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1135                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1136                         }
1137                 }
1138         }
1139 }
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() }
1146                 } else {
1147                         let err = unsafe { o.contents.err };
1148                         unsafe { o.contents.err = std::ptr::null_mut(); }
1149                         CResult_NonePeerHandleErrorZPtr { err }
1150                 };
1151                 Self {
1152                         contents,
1153                         result_ok: o.result_ok,
1154                 }
1155         }
1156 }
1157 impl Clone for CResult_NonePeerHandleErrorZ {
1158         fn clone(&self) -> Self {
1159                 if self.result_ok {
1160                         Self { result_ok: true, contents: CResult_NonePeerHandleErrorZPtr {
1161                                 result: std::ptr::null_mut()
1162                         } }
1163                 } else {
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 })))
1166                         } }
1167                 }
1168         }
1169 }
1170 #[no_mangle]
1171 pub extern "C" fn CResult_NonePeerHandleErrorZ_clone(orig: &CResult_NonePeerHandleErrorZ) -> CResult_NonePeerHandleErrorZ { orig.clone() }
1172 #[repr(C)]
1173 pub union CResult_boolPeerHandleErrorZPtr {
1174         pub result: *mut bool,
1175         pub err: *mut crate::ln::peer_handler::PeerHandleError,
1176 }
1177 #[repr(C)]
1178 pub struct CResult_boolPeerHandleErrorZ {
1179         pub contents: CResult_boolPeerHandleErrorZPtr,
1180         pub result_ok: bool,
1181 }
1182 #[no_mangle]
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)),
1187                 },
1188                 result_ok: true,
1189         }
1190 }
1191 #[no_mangle]
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)),
1196                 },
1197                 result_ok: false,
1198         }
1199 }
1200 #[no_mangle]
1201 pub extern "C" fn CResult_boolPeerHandleErrorZ_free(_res: CResult_boolPeerHandleErrorZ) { }
1202 impl Drop for CResult_boolPeerHandleErrorZ {
1203         fn drop(&mut self) {
1204                 if self.result_ok {
1205                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
1206                                 let _ = unsafe { Box::from_raw(self.contents.result) };
1207                         }
1208                 } else {
1209                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1210                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1211                         }
1212                 }
1213         }
1214 }
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 }
1221                 } else {
1222                         let err = unsafe { o.contents.err };
1223                         unsafe { o.contents.err = std::ptr::null_mut(); }
1224                         CResult_boolPeerHandleErrorZPtr { err }
1225                 };
1226                 Self {
1227                         contents,
1228                         result_ok: o.result_ok,
1229                 }
1230         }
1231 }
1232 impl Clone for CResult_boolPeerHandleErrorZ {
1233         fn clone(&self) -> Self {
1234                 if self.result_ok {
1235                         Self { result_ok: true, contents: CResult_boolPeerHandleErrorZPtr {
1236                                 result: Box::into_raw(Box::new(<bool>::clone(unsafe { &*self.contents.result })))
1237                         } }
1238                 } else {
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 })))
1241                         } }
1242                 }
1243         }
1244 }
1245 #[no_mangle]
1246 pub extern "C" fn CResult_boolPeerHandleErrorZ_clone(orig: &CResult_boolPeerHandleErrorZ) -> CResult_boolPeerHandleErrorZ { orig.clone() }
1247 #[repr(C)]
1248 pub union CResult_InitFeaturesDecodeErrorZPtr {
1249         pub result: *mut crate::ln::features::InitFeatures,
1250         pub err: *mut crate::ln::msgs::DecodeError,
1251 }
1252 #[repr(C)]
1253 pub struct CResult_InitFeaturesDecodeErrorZ {
1254         pub contents: CResult_InitFeaturesDecodeErrorZPtr,
1255         pub result_ok: bool,
1256 }
1257 #[no_mangle]
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)),
1262                 },
1263                 result_ok: true,
1264         }
1265 }
1266 #[no_mangle]
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)),
1271                 },
1272                 result_ok: false,
1273         }
1274 }
1275 #[no_mangle]
1276 pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_free(_res: CResult_InitFeaturesDecodeErrorZ) { }
1277 impl Drop for CResult_InitFeaturesDecodeErrorZ {
1278         fn drop(&mut self) {
1279                 if self.result_ok {
1280                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
1281                                 let _ = unsafe { Box::from_raw(self.contents.result) };
1282                         }
1283                 } else {
1284                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1285                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1286                         }
1287                 }
1288         }
1289 }
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 }
1296                 } else {
1297                         let err = unsafe { o.contents.err };
1298                         unsafe { o.contents.err = std::ptr::null_mut(); }
1299                         CResult_InitFeaturesDecodeErrorZPtr { err }
1300                 };
1301                 Self {
1302                         contents,
1303                         result_ok: o.result_ok,
1304                 }
1305         }
1306 }
1307 #[repr(C)]
1308 pub union CResult_NodeFeaturesDecodeErrorZPtr {
1309         pub result: *mut crate::ln::features::NodeFeatures,
1310         pub err: *mut crate::ln::msgs::DecodeError,
1311 }
1312 #[repr(C)]
1313 pub struct CResult_NodeFeaturesDecodeErrorZ {
1314         pub contents: CResult_NodeFeaturesDecodeErrorZPtr,
1315         pub result_ok: bool,
1316 }
1317 #[no_mangle]
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)),
1322                 },
1323                 result_ok: true,
1324         }
1325 }
1326 #[no_mangle]
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)),
1331                 },
1332                 result_ok: false,
1333         }
1334 }
1335 #[no_mangle]
1336 pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_free(_res: CResult_NodeFeaturesDecodeErrorZ) { }
1337 impl Drop for CResult_NodeFeaturesDecodeErrorZ {
1338         fn drop(&mut self) {
1339                 if self.result_ok {
1340                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
1341                                 let _ = unsafe { Box::from_raw(self.contents.result) };
1342                         }
1343                 } else {
1344                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1345                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1346                         }
1347                 }
1348         }
1349 }
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 }
1356                 } else {
1357                         let err = unsafe { o.contents.err };
1358                         unsafe { o.contents.err = std::ptr::null_mut(); }
1359                         CResult_NodeFeaturesDecodeErrorZPtr { err }
1360                 };
1361                 Self {
1362                         contents,
1363                         result_ok: o.result_ok,
1364                 }
1365         }
1366 }
1367 #[repr(C)]
1368 pub union CResult_ChannelFeaturesDecodeErrorZPtr {
1369         pub result: *mut crate::ln::features::ChannelFeatures,
1370         pub err: *mut crate::ln::msgs::DecodeError,
1371 }
1372 #[repr(C)]
1373 pub struct CResult_ChannelFeaturesDecodeErrorZ {
1374         pub contents: CResult_ChannelFeaturesDecodeErrorZPtr,
1375         pub result_ok: bool,
1376 }
1377 #[no_mangle]
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)),
1382                 },
1383                 result_ok: true,
1384         }
1385 }
1386 #[no_mangle]
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)),
1391                 },
1392                 result_ok: false,
1393         }
1394 }
1395 #[no_mangle]
1396 pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_free(_res: CResult_ChannelFeaturesDecodeErrorZ) { }
1397 impl Drop for CResult_ChannelFeaturesDecodeErrorZ {
1398         fn drop(&mut self) {
1399                 if self.result_ok {
1400                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
1401                                 let _ = unsafe { Box::from_raw(self.contents.result) };
1402                         }
1403                 } else {
1404                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1405                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1406                         }
1407                 }
1408         }
1409 }
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 }
1416                 } else {
1417                         let err = unsafe { o.contents.err };
1418                         unsafe { o.contents.err = std::ptr::null_mut(); }
1419                         CResult_ChannelFeaturesDecodeErrorZPtr { err }
1420                 };
1421                 Self {
1422                         contents,
1423                         result_ok: o.result_ok,
1424                 }
1425         }
1426 }
1427 #[repr(C)]
1428 pub union CResult_ChannelConfigDecodeErrorZPtr {
1429         pub result: *mut crate::util::config::ChannelConfig,
1430         pub err: *mut crate::ln::msgs::DecodeError,
1431 }
1432 #[repr(C)]
1433 pub struct CResult_ChannelConfigDecodeErrorZ {
1434         pub contents: CResult_ChannelConfigDecodeErrorZPtr,
1435         pub result_ok: bool,
1436 }
1437 #[no_mangle]
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)),
1442                 },
1443                 result_ok: true,
1444         }
1445 }
1446 #[no_mangle]
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)),
1451                 },
1452                 result_ok: false,
1453         }
1454 }
1455 #[no_mangle]
1456 pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_free(_res: CResult_ChannelConfigDecodeErrorZ) { }
1457 impl Drop for CResult_ChannelConfigDecodeErrorZ {
1458         fn drop(&mut self) {
1459                 if self.result_ok {
1460                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
1461                                 let _ = unsafe { Box::from_raw(self.contents.result) };
1462                         }
1463                 } else {
1464                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1465                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1466                         }
1467                 }
1468         }
1469 }
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 }
1476                 } else {
1477                         let err = unsafe { o.contents.err };
1478                         unsafe { o.contents.err = std::ptr::null_mut(); }
1479                         CResult_ChannelConfigDecodeErrorZPtr { err }
1480                 };
1481                 Self {
1482                         contents,
1483                         result_ok: o.result_ok,
1484                 }
1485         }
1486 }
1487 impl Clone for CResult_ChannelConfigDecodeErrorZ {
1488         fn clone(&self) -> Self {
1489                 if self.result_ok {
1490                         Self { result_ok: true, contents: CResult_ChannelConfigDecodeErrorZPtr {
1491                                 result: Box::into_raw(Box::new(<crate::util::config::ChannelConfig>::clone(unsafe { &*self.contents.result })))
1492                         } }
1493                 } else {
1494                         Self { result_ok: false, contents: CResult_ChannelConfigDecodeErrorZPtr {
1495                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
1496                         } }
1497                 }
1498         }
1499 }
1500 #[no_mangle]
1501 pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_clone(orig: &CResult_ChannelConfigDecodeErrorZ) -> CResult_ChannelConfigDecodeErrorZ { orig.clone() }
1502 #[repr(C)]
1503 pub union CResult_boolLightningErrorZPtr {
1504         pub result: *mut bool,
1505         pub err: *mut crate::ln::msgs::LightningError,
1506 }
1507 #[repr(C)]
1508 pub struct CResult_boolLightningErrorZ {
1509         pub contents: CResult_boolLightningErrorZPtr,
1510         pub result_ok: bool,
1511 }
1512 #[no_mangle]
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)),
1517                 },
1518                 result_ok: true,
1519         }
1520 }
1521 #[no_mangle]
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)),
1526                 },
1527                 result_ok: false,
1528         }
1529 }
1530 #[no_mangle]
1531 pub extern "C" fn CResult_boolLightningErrorZ_free(_res: CResult_boolLightningErrorZ) { }
1532 impl Drop for CResult_boolLightningErrorZ {
1533         fn drop(&mut self) {
1534                 if self.result_ok {
1535                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
1536                                 let _ = unsafe { Box::from_raw(self.contents.result) };
1537                         }
1538                 } else {
1539                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1540                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1541                         }
1542                 }
1543         }
1544 }
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 }
1551                 } else {
1552                         let err = unsafe { o.contents.err };
1553                         unsafe { o.contents.err = std::ptr::null_mut(); }
1554                         CResult_boolLightningErrorZPtr { err }
1555                 };
1556                 Self {
1557                         contents,
1558                         result_ok: o.result_ok,
1559                 }
1560         }
1561 }
1562 impl Clone for CResult_boolLightningErrorZ {
1563         fn clone(&self) -> Self {
1564                 if self.result_ok {
1565                         Self { result_ok: true, contents: CResult_boolLightningErrorZPtr {
1566                                 result: Box::into_raw(Box::new(<bool>::clone(unsafe { &*self.contents.result })))
1567                         } }
1568                 } else {
1569                         Self { result_ok: false, contents: CResult_boolLightningErrorZPtr {
1570                                 err: Box::into_raw(Box::new(<crate::ln::msgs::LightningError>::clone(unsafe { &*self.contents.err })))
1571                         } }
1572                 }
1573         }
1574 }
1575 #[no_mangle]
1576 pub extern "C" fn CResult_boolLightningErrorZ_clone(orig: &CResult_boolLightningErrorZ) -> CResult_boolLightningErrorZ { orig.clone() }
1577 #[repr(C)]
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,
1582 }
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 {
1585                 Self {
1586                         a: tup.0,
1587                         b: tup.1,
1588                         c: tup.2,
1589                 }
1590         }
1591 }
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)
1595         }
1596 }
1597 impl Clone for C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1598         fn clone(&self) -> Self {
1599                 Self {
1600                         a: self.a.clone(),
1601                         b: self.b.clone(),
1602                         c: self.c.clone(),
1603                 }
1604         }
1605 }
1606 #[no_mangle]
1607 pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig: &C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { orig.clone() }
1608 #[no_mangle]
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, }
1611 }
1612
1613 #[no_mangle]
1614 pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) { }
1615 #[repr(C)]
1616 pub struct CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1617         pub data: *mut crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ,
1618         pub datalen: usize
1619 }
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();
1625                 self.datalen = 0;
1626                 ret
1627         }
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) }
1630         }
1631 }
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() } }
1637         }
1638 }
1639 #[no_mangle]
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)) };
1645         }
1646 }
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) });
1652                 Self::from(res)
1653         }
1654 }
1655 #[repr(C)]
1656 pub struct CVec_NodeAnnouncementZ {
1657         pub data: *mut crate::ln::msgs::NodeAnnouncement,
1658         pub datalen: usize
1659 }
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();
1665                 self.datalen = 0;
1666                 ret
1667         }
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) }
1670         }
1671 }
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() } }
1677         }
1678 }
1679 #[no_mangle]
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)) };
1685         }
1686 }
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) });
1692                 Self::from(res)
1693         }
1694 }
1695 #[repr(C)]
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,
1700 }
1701 #[repr(C)]
1702 pub struct CResult_NoneLightningErrorZ {
1703         pub contents: CResult_NoneLightningErrorZPtr,
1704         pub result_ok: bool,
1705 }
1706 #[no_mangle]
1707 pub extern "C" fn CResult_NoneLightningErrorZ_ok() -> CResult_NoneLightningErrorZ {
1708         CResult_NoneLightningErrorZ {
1709                 contents: CResult_NoneLightningErrorZPtr {
1710                         result: std::ptr::null_mut(),
1711                 },
1712                 result_ok: true,
1713         }
1714 }
1715 #[no_mangle]
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)),
1720                 },
1721                 result_ok: false,
1722         }
1723 }
1724 #[no_mangle]
1725 pub extern "C" fn CResult_NoneLightningErrorZ_free(_res: CResult_NoneLightningErrorZ) { }
1726 impl Drop for CResult_NoneLightningErrorZ {
1727         fn drop(&mut self) {
1728                 if self.result_ok {
1729                 } else {
1730                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1731                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1732                         }
1733                 }
1734         }
1735 }
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() }
1742                 } else {
1743                         let err = unsafe { o.contents.err };
1744                         unsafe { o.contents.err = std::ptr::null_mut(); }
1745                         CResult_NoneLightningErrorZPtr { err }
1746                 };
1747                 Self {
1748                         contents,
1749                         result_ok: o.result_ok,
1750                 }
1751         }
1752 }
1753 impl Clone for CResult_NoneLightningErrorZ {
1754         fn clone(&self) -> Self {
1755                 if self.result_ok {
1756                         Self { result_ok: true, contents: CResult_NoneLightningErrorZPtr {
1757                                 result: std::ptr::null_mut()
1758                         } }
1759                 } else {
1760                         Self { result_ok: false, contents: CResult_NoneLightningErrorZPtr {
1761                                 err: Box::into_raw(Box::new(<crate::ln::msgs::LightningError>::clone(unsafe { &*self.contents.err })))
1762                         } }
1763                 }
1764         }
1765 }
1766 #[no_mangle]
1767 pub extern "C" fn CResult_NoneLightningErrorZ_clone(orig: &CResult_NoneLightningErrorZ) -> CResult_NoneLightningErrorZ { orig.clone() }
1768 #[repr(C)]
1769 pub struct CVec_MessageSendEventZ {
1770         pub data: *mut crate::util::events::MessageSendEvent,
1771         pub datalen: usize
1772 }
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();
1778                 self.datalen = 0;
1779                 ret
1780         }
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) }
1783         }
1784 }
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() } }
1790         }
1791 }
1792 #[no_mangle]
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)) };
1798         }
1799 }
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) });
1805                 Self::from(res)
1806         }
1807 }
1808 #[repr(C)]
1809 pub union CResult_DirectionalChannelInfoDecodeErrorZPtr {
1810         pub result: *mut crate::routing::network_graph::DirectionalChannelInfo,
1811         pub err: *mut crate::ln::msgs::DecodeError,
1812 }
1813 #[repr(C)]
1814 pub struct CResult_DirectionalChannelInfoDecodeErrorZ {
1815         pub contents: CResult_DirectionalChannelInfoDecodeErrorZPtr,
1816         pub result_ok: bool,
1817 }
1818 #[no_mangle]
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)),
1823                 },
1824                 result_ok: true,
1825         }
1826 }
1827 #[no_mangle]
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)),
1832                 },
1833                 result_ok: false,
1834         }
1835 }
1836 #[no_mangle]
1837 pub extern "C" fn CResult_DirectionalChannelInfoDecodeErrorZ_free(_res: CResult_DirectionalChannelInfoDecodeErrorZ) { }
1838 impl Drop for CResult_DirectionalChannelInfoDecodeErrorZ {
1839         fn drop(&mut self) {
1840                 if self.result_ok {
1841                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
1842                                 let _ = unsafe { Box::from_raw(self.contents.result) };
1843                         }
1844                 } else {
1845                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1846                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1847                         }
1848                 }
1849         }
1850 }
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 }
1857                 } else {
1858                         let err = unsafe { o.contents.err };
1859                         unsafe { o.contents.err = std::ptr::null_mut(); }
1860                         CResult_DirectionalChannelInfoDecodeErrorZPtr { err }
1861                 };
1862                 Self {
1863                         contents,
1864                         result_ok: o.result_ok,
1865                 }
1866         }
1867 }
1868 impl Clone for CResult_DirectionalChannelInfoDecodeErrorZ {
1869         fn clone(&self) -> Self {
1870                 if self.result_ok {
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 })))
1873                         } }
1874                 } else {
1875                         Self { result_ok: false, contents: CResult_DirectionalChannelInfoDecodeErrorZPtr {
1876                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
1877                         } }
1878                 }
1879         }
1880 }
1881 #[no_mangle]
1882 pub extern "C" fn CResult_DirectionalChannelInfoDecodeErrorZ_clone(orig: &CResult_DirectionalChannelInfoDecodeErrorZ) -> CResult_DirectionalChannelInfoDecodeErrorZ { orig.clone() }
1883 #[repr(C)]
1884 pub union CResult_ChannelInfoDecodeErrorZPtr {
1885         pub result: *mut crate::routing::network_graph::ChannelInfo,
1886         pub err: *mut crate::ln::msgs::DecodeError,
1887 }
1888 #[repr(C)]
1889 pub struct CResult_ChannelInfoDecodeErrorZ {
1890         pub contents: CResult_ChannelInfoDecodeErrorZPtr,
1891         pub result_ok: bool,
1892 }
1893 #[no_mangle]
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)),
1898                 },
1899                 result_ok: true,
1900         }
1901 }
1902 #[no_mangle]
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)),
1907                 },
1908                 result_ok: false,
1909         }
1910 }
1911 #[no_mangle]
1912 pub extern "C" fn CResult_ChannelInfoDecodeErrorZ_free(_res: CResult_ChannelInfoDecodeErrorZ) { }
1913 impl Drop for CResult_ChannelInfoDecodeErrorZ {
1914         fn drop(&mut self) {
1915                 if self.result_ok {
1916                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
1917                                 let _ = unsafe { Box::from_raw(self.contents.result) };
1918                         }
1919                 } else {
1920                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1921                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1922                         }
1923                 }
1924         }
1925 }
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 }
1932                 } else {
1933                         let err = unsafe { o.contents.err };
1934                         unsafe { o.contents.err = std::ptr::null_mut(); }
1935                         CResult_ChannelInfoDecodeErrorZPtr { err }
1936                 };
1937                 Self {
1938                         contents,
1939                         result_ok: o.result_ok,
1940                 }
1941         }
1942 }
1943 #[repr(C)]
1944 pub union CResult_RoutingFeesDecodeErrorZPtr {
1945         pub result: *mut crate::routing::network_graph::RoutingFees,
1946         pub err: *mut crate::ln::msgs::DecodeError,
1947 }
1948 #[repr(C)]
1949 pub struct CResult_RoutingFeesDecodeErrorZ {
1950         pub contents: CResult_RoutingFeesDecodeErrorZPtr,
1951         pub result_ok: bool,
1952 }
1953 #[no_mangle]
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)),
1958                 },
1959                 result_ok: true,
1960         }
1961 }
1962 #[no_mangle]
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)),
1967                 },
1968                 result_ok: false,
1969         }
1970 }
1971 #[no_mangle]
1972 pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_free(_res: CResult_RoutingFeesDecodeErrorZ) { }
1973 impl Drop for CResult_RoutingFeesDecodeErrorZ {
1974         fn drop(&mut self) {
1975                 if self.result_ok {
1976                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
1977                                 let _ = unsafe { Box::from_raw(self.contents.result) };
1978                         }
1979                 } else {
1980                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
1981                                 let _ = unsafe { Box::from_raw(self.contents.err) };
1982                         }
1983                 }
1984         }
1985 }
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 }
1992                 } else {
1993                         let err = unsafe { o.contents.err };
1994                         unsafe { o.contents.err = std::ptr::null_mut(); }
1995                         CResult_RoutingFeesDecodeErrorZPtr { err }
1996                 };
1997                 Self {
1998                         contents,
1999                         result_ok: o.result_ok,
2000                 }
2001         }
2002 }
2003 impl Clone for CResult_RoutingFeesDecodeErrorZ {
2004         fn clone(&self) -> Self {
2005                 if self.result_ok {
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 })))
2008                         } }
2009                 } else {
2010                         Self { result_ok: false, contents: CResult_RoutingFeesDecodeErrorZPtr {
2011                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2012                         } }
2013                 }
2014         }
2015 }
2016 #[no_mangle]
2017 pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_clone(orig: &CResult_RoutingFeesDecodeErrorZ) -> CResult_RoutingFeesDecodeErrorZ { orig.clone() }
2018 #[repr(C)]
2019 pub struct CVec_NetAddressZ {
2020         pub data: *mut crate::ln::msgs::NetAddress,
2021         pub datalen: usize
2022 }
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();
2028                 self.datalen = 0;
2029                 ret
2030         }
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) }
2033         }
2034 }
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() } }
2040         }
2041 }
2042 #[no_mangle]
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)) };
2048         }
2049 }
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) });
2055                 Self::from(res)
2056         }
2057 }
2058 #[repr(C)]
2059 pub union CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2060         pub result: *mut crate::routing::network_graph::NodeAnnouncementInfo,
2061         pub err: *mut crate::ln::msgs::DecodeError,
2062 }
2063 #[repr(C)]
2064 pub struct CResult_NodeAnnouncementInfoDecodeErrorZ {
2065         pub contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr,
2066         pub result_ok: bool,
2067 }
2068 #[no_mangle]
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)),
2073                 },
2074                 result_ok: true,
2075         }
2076 }
2077 #[no_mangle]
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)),
2082                 },
2083                 result_ok: false,
2084         }
2085 }
2086 #[no_mangle]
2087 pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res: CResult_NodeAnnouncementInfoDecodeErrorZ) { }
2088 impl Drop for CResult_NodeAnnouncementInfoDecodeErrorZ {
2089         fn drop(&mut self) {
2090                 if self.result_ok {
2091                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
2092                                 let _ = unsafe { Box::from_raw(self.contents.result) };
2093                         }
2094                 } else {
2095                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
2096                                 let _ = unsafe { Box::from_raw(self.contents.err) };
2097                         }
2098                 }
2099         }
2100 }
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 }
2107                 } else {
2108                         let err = unsafe { o.contents.err };
2109                         unsafe { o.contents.err = std::ptr::null_mut(); }
2110                         CResult_NodeAnnouncementInfoDecodeErrorZPtr { err }
2111                 };
2112                 Self {
2113                         contents,
2114                         result_ok: o.result_ok,
2115                 }
2116         }
2117 }
2118 impl Clone for CResult_NodeAnnouncementInfoDecodeErrorZ {
2119         fn clone(&self) -> Self {
2120                 if self.result_ok {
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 })))
2123                         } }
2124                 } else {
2125                         Self { result_ok: false, contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr {
2126                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2127                         } }
2128                 }
2129         }
2130 }
2131 #[no_mangle]
2132 pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig: &CResult_NodeAnnouncementInfoDecodeErrorZ) -> CResult_NodeAnnouncementInfoDecodeErrorZ { orig.clone() }
2133 #[repr(C)]
2134 pub struct CVec_u64Z {
2135         pub data: *mut u64,
2136         pub datalen: usize
2137 }
2138 impl 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();
2143                 self.datalen = 0;
2144                 ret
2145         }
2146         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[u64] {
2147                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
2148         }
2149 }
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() } }
2155         }
2156 }
2157 #[no_mangle]
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)) };
2163         }
2164 }
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) });
2170                 Self::from(res)
2171         }
2172 }
2173 #[repr(C)]
2174 pub union CResult_NodeInfoDecodeErrorZPtr {
2175         pub result: *mut crate::routing::network_graph::NodeInfo,
2176         pub err: *mut crate::ln::msgs::DecodeError,
2177 }
2178 #[repr(C)]
2179 pub struct CResult_NodeInfoDecodeErrorZ {
2180         pub contents: CResult_NodeInfoDecodeErrorZPtr,
2181         pub result_ok: bool,
2182 }
2183 #[no_mangle]
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)),
2188                 },
2189                 result_ok: true,
2190         }
2191 }
2192 #[no_mangle]
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)),
2197                 },
2198                 result_ok: false,
2199         }
2200 }
2201 #[no_mangle]
2202 pub extern "C" fn CResult_NodeInfoDecodeErrorZ_free(_res: CResult_NodeInfoDecodeErrorZ) { }
2203 impl Drop for CResult_NodeInfoDecodeErrorZ {
2204         fn drop(&mut self) {
2205                 if self.result_ok {
2206                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
2207                                 let _ = unsafe { Box::from_raw(self.contents.result) };
2208                         }
2209                 } else {
2210                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
2211                                 let _ = unsafe { Box::from_raw(self.contents.err) };
2212                         }
2213                 }
2214         }
2215 }
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 }
2222                 } else {
2223                         let err = unsafe { o.contents.err };
2224                         unsafe { o.contents.err = std::ptr::null_mut(); }
2225                         CResult_NodeInfoDecodeErrorZPtr { err }
2226                 };
2227                 Self {
2228                         contents,
2229                         result_ok: o.result_ok,
2230                 }
2231         }
2232 }
2233 impl Clone for CResult_NodeInfoDecodeErrorZ {
2234         fn clone(&self) -> Self {
2235                 if self.result_ok {
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 })))
2238                         } }
2239                 } else {
2240                         Self { result_ok: false, contents: CResult_NodeInfoDecodeErrorZPtr {
2241                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2242                         } }
2243                 }
2244         }
2245 }
2246 #[no_mangle]
2247 pub extern "C" fn CResult_NodeInfoDecodeErrorZ_clone(orig: &CResult_NodeInfoDecodeErrorZ) -> CResult_NodeInfoDecodeErrorZ { orig.clone() }
2248 #[repr(C)]
2249 pub union CResult_NetworkGraphDecodeErrorZPtr {
2250         pub result: *mut crate::routing::network_graph::NetworkGraph,
2251         pub err: *mut crate::ln::msgs::DecodeError,
2252 }
2253 #[repr(C)]
2254 pub struct CResult_NetworkGraphDecodeErrorZ {
2255         pub contents: CResult_NetworkGraphDecodeErrorZPtr,
2256         pub result_ok: bool,
2257 }
2258 #[no_mangle]
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)),
2263                 },
2264                 result_ok: true,
2265         }
2266 }
2267 #[no_mangle]
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)),
2272                 },
2273                 result_ok: false,
2274         }
2275 }
2276 #[no_mangle]
2277 pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_free(_res: CResult_NetworkGraphDecodeErrorZ) { }
2278 impl Drop for CResult_NetworkGraphDecodeErrorZ {
2279         fn drop(&mut self) {
2280                 if self.result_ok {
2281                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
2282                                 let _ = unsafe { Box::from_raw(self.contents.result) };
2283                         }
2284                 } else {
2285                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
2286                                 let _ = unsafe { Box::from_raw(self.contents.err) };
2287                         }
2288                 }
2289         }
2290 }
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 }
2297                 } else {
2298                         let err = unsafe { o.contents.err };
2299                         unsafe { o.contents.err = std::ptr::null_mut(); }
2300                         CResult_NetworkGraphDecodeErrorZPtr { err }
2301                 };
2302                 Self {
2303                         contents,
2304                         result_ok: o.result_ok,
2305                 }
2306         }
2307 }
2308 #[repr(C)]
2309 pub struct C2Tuple_usizeTransactionZ {
2310         pub a: usize,
2311         pub b: crate::c_types::Transaction,
2312 }
2313 impl From<(usize, crate::c_types::Transaction)> for C2Tuple_usizeTransactionZ {
2314         fn from (tup: (usize, crate::c_types::Transaction)) -> Self {
2315                 Self {
2316                         a: tup.0,
2317                         b: tup.1,
2318                 }
2319         }
2320 }
2321 impl C2Tuple_usizeTransactionZ {
2322         #[allow(unused)] pub(crate) fn to_rust(mut self) -> (usize, crate::c_types::Transaction) {
2323                 (self.a, self.b)
2324         }
2325 }
2326 #[no_mangle]
2327 pub extern "C" fn C2Tuple_usizeTransactionZ_new(a: usize, b: crate::c_types::Transaction) -> C2Tuple_usizeTransactionZ {
2328         C2Tuple_usizeTransactionZ { a, b, }
2329 }
2330
2331 #[no_mangle]
2332 pub extern "C" fn C2Tuple_usizeTransactionZ_free(_res: C2Tuple_usizeTransactionZ) { }
2333 #[repr(C)]
2334 pub struct CVec_C2Tuple_usizeTransactionZZ {
2335         pub data: *mut crate::c_types::derived::C2Tuple_usizeTransactionZ,
2336         pub datalen: usize
2337 }
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();
2343                 self.datalen = 0;
2344                 ret
2345         }
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) }
2348         }
2349 }
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() } }
2355         }
2356 }
2357 #[no_mangle]
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)) };
2363         }
2364 }
2365 #[repr(C)]
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,
2370 }
2371 #[repr(C)]
2372 pub struct CResult_NoneChannelMonitorUpdateErrZ {
2373         pub contents: CResult_NoneChannelMonitorUpdateErrZPtr,
2374         pub result_ok: bool,
2375 }
2376 #[no_mangle]
2377 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_ok() -> CResult_NoneChannelMonitorUpdateErrZ {
2378         CResult_NoneChannelMonitorUpdateErrZ {
2379                 contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2380                         result: std::ptr::null_mut(),
2381                 },
2382                 result_ok: true,
2383         }
2384 }
2385 #[no_mangle]
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)),
2390                 },
2391                 result_ok: false,
2392         }
2393 }
2394 #[no_mangle]
2395 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_free(_res: CResult_NoneChannelMonitorUpdateErrZ) { }
2396 impl Drop for CResult_NoneChannelMonitorUpdateErrZ {
2397         fn drop(&mut self) {
2398                 if self.result_ok {
2399                 } else {
2400                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
2401                                 let _ = unsafe { Box::from_raw(self.contents.err) };
2402                         }
2403                 }
2404         }
2405 }
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() }
2412                 } else {
2413                         let err = unsafe { o.contents.err };
2414                         unsafe { o.contents.err = std::ptr::null_mut(); }
2415                         CResult_NoneChannelMonitorUpdateErrZPtr { err }
2416                 };
2417                 Self {
2418                         contents,
2419                         result_ok: o.result_ok,
2420                 }
2421         }
2422 }
2423 impl Clone for CResult_NoneChannelMonitorUpdateErrZ {
2424         fn clone(&self) -> Self {
2425                 if self.result_ok {
2426                         Self { result_ok: true, contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2427                                 result: std::ptr::null_mut()
2428                         } }
2429                 } else {
2430                         Self { result_ok: false, contents: CResult_NoneChannelMonitorUpdateErrZPtr {
2431                                 err: Box::into_raw(Box::new(<crate::chain::channelmonitor::ChannelMonitorUpdateErr>::clone(unsafe { &*self.contents.err })))
2432                         } }
2433                 }
2434         }
2435 }
2436 #[no_mangle]
2437 pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_clone(orig: &CResult_NoneChannelMonitorUpdateErrZ) -> CResult_NoneChannelMonitorUpdateErrZ { orig.clone() }
2438 #[repr(C)]
2439 pub struct CVec_MonitorEventZ {
2440         pub data: *mut crate::chain::channelmonitor::MonitorEvent,
2441         pub datalen: usize
2442 }
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();
2448                 self.datalen = 0;
2449                 ret
2450         }
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) }
2453         }
2454 }
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() } }
2460         }
2461 }
2462 #[no_mangle]
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)) };
2468         }
2469 }
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) });
2475                 Self::from(res)
2476         }
2477 }
2478 #[repr(C)]
2479 pub struct CVec_EventZ {
2480         pub data: *mut crate::util::events::Event,
2481         pub datalen: usize
2482 }
2483 impl CVec_EventZ {
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();
2488                 self.datalen = 0;
2489                 ret
2490         }
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) }
2493         }
2494 }
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() } }
2500         }
2501 }
2502 #[no_mangle]
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)) };
2508         }
2509 }
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) });
2515                 Self::from(res)
2516         }
2517 }
2518 #[repr(C)]
2519 pub union CResult_OutPointDecodeErrorZPtr {
2520         pub result: *mut crate::chain::transaction::OutPoint,
2521         pub err: *mut crate::ln::msgs::DecodeError,
2522 }
2523 #[repr(C)]
2524 pub struct CResult_OutPointDecodeErrorZ {
2525         pub contents: CResult_OutPointDecodeErrorZPtr,
2526         pub result_ok: bool,
2527 }
2528 #[no_mangle]
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)),
2533                 },
2534                 result_ok: true,
2535         }
2536 }
2537 #[no_mangle]
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)),
2542                 },
2543                 result_ok: false,
2544         }
2545 }
2546 #[no_mangle]
2547 pub extern "C" fn CResult_OutPointDecodeErrorZ_free(_res: CResult_OutPointDecodeErrorZ) { }
2548 impl Drop for CResult_OutPointDecodeErrorZ {
2549         fn drop(&mut self) {
2550                 if self.result_ok {
2551                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
2552                                 let _ = unsafe { Box::from_raw(self.contents.result) };
2553                         }
2554                 } else {
2555                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
2556                                 let _ = unsafe { Box::from_raw(self.contents.err) };
2557                         }
2558                 }
2559         }
2560 }
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 }
2567                 } else {
2568                         let err = unsafe { o.contents.err };
2569                         unsafe { o.contents.err = std::ptr::null_mut(); }
2570                         CResult_OutPointDecodeErrorZPtr { err }
2571                 };
2572                 Self {
2573                         contents,
2574                         result_ok: o.result_ok,
2575                 }
2576         }
2577 }
2578 impl Clone for CResult_OutPointDecodeErrorZ {
2579         fn clone(&self) -> Self {
2580                 if self.result_ok {
2581                         Self { result_ok: true, contents: CResult_OutPointDecodeErrorZPtr {
2582                                 result: Box::into_raw(Box::new(<crate::chain::transaction::OutPoint>::clone(unsafe { &*self.contents.result })))
2583                         } }
2584                 } else {
2585                         Self { result_ok: false, contents: CResult_OutPointDecodeErrorZPtr {
2586                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2587                         } }
2588                 }
2589         }
2590 }
2591 #[no_mangle]
2592 pub extern "C" fn CResult_OutPointDecodeErrorZ_clone(orig: &CResult_OutPointDecodeErrorZ) -> CResult_OutPointDecodeErrorZ { orig.clone() }
2593 #[repr(C)]
2594 pub union CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2595         pub result: *mut crate::chain::channelmonitor::ChannelMonitorUpdate,
2596         pub err: *mut crate::ln::msgs::DecodeError,
2597 }
2598 #[repr(C)]
2599 pub struct CResult_ChannelMonitorUpdateDecodeErrorZ {
2600         pub contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr,
2601         pub result_ok: bool,
2602 }
2603 #[no_mangle]
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)),
2608                 },
2609                 result_ok: true,
2610         }
2611 }
2612 #[no_mangle]
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)),
2617                 },
2618                 result_ok: false,
2619         }
2620 }
2621 #[no_mangle]
2622 pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res: CResult_ChannelMonitorUpdateDecodeErrorZ) { }
2623 impl Drop for CResult_ChannelMonitorUpdateDecodeErrorZ {
2624         fn drop(&mut self) {
2625                 if self.result_ok {
2626                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
2627                                 let _ = unsafe { Box::from_raw(self.contents.result) };
2628                         }
2629                 } else {
2630                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
2631                                 let _ = unsafe { Box::from_raw(self.contents.err) };
2632                         }
2633                 }
2634         }
2635 }
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 }
2642                 } else {
2643                         let err = unsafe { o.contents.err };
2644                         unsafe { o.contents.err = std::ptr::null_mut(); }
2645                         CResult_ChannelMonitorUpdateDecodeErrorZPtr { err }
2646                 };
2647                 Self {
2648                         contents,
2649                         result_ok: o.result_ok,
2650                 }
2651         }
2652 }
2653 impl Clone for CResult_ChannelMonitorUpdateDecodeErrorZ {
2654         fn clone(&self) -> Self {
2655                 if self.result_ok {
2656                         Self { result_ok: true, contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2657                                 result: Box::into_raw(Box::new(<crate::chain::channelmonitor::ChannelMonitorUpdate>::clone(unsafe { &*self.contents.result })))
2658                         } }
2659                 } else {
2660                         Self { result_ok: false, contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr {
2661                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2662                         } }
2663                 }
2664         }
2665 }
2666 #[no_mangle]
2667 pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig: &CResult_ChannelMonitorUpdateDecodeErrorZ) -> CResult_ChannelMonitorUpdateDecodeErrorZ { orig.clone() }
2668 #[repr(C)]
2669 pub union CResult_HTLCUpdateDecodeErrorZPtr {
2670         pub result: *mut crate::chain::channelmonitor::HTLCUpdate,
2671         pub err: *mut crate::ln::msgs::DecodeError,
2672 }
2673 #[repr(C)]
2674 pub struct CResult_HTLCUpdateDecodeErrorZ {
2675         pub contents: CResult_HTLCUpdateDecodeErrorZPtr,
2676         pub result_ok: bool,
2677 }
2678 #[no_mangle]
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)),
2683                 },
2684                 result_ok: true,
2685         }
2686 }
2687 #[no_mangle]
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)),
2692                 },
2693                 result_ok: false,
2694         }
2695 }
2696 #[no_mangle]
2697 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_free(_res: CResult_HTLCUpdateDecodeErrorZ) { }
2698 impl Drop for CResult_HTLCUpdateDecodeErrorZ {
2699         fn drop(&mut self) {
2700                 if self.result_ok {
2701                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
2702                                 let _ = unsafe { Box::from_raw(self.contents.result) };
2703                         }
2704                 } else {
2705                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
2706                                 let _ = unsafe { Box::from_raw(self.contents.err) };
2707                         }
2708                 }
2709         }
2710 }
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 }
2717                 } else {
2718                         let err = unsafe { o.contents.err };
2719                         unsafe { o.contents.err = std::ptr::null_mut(); }
2720                         CResult_HTLCUpdateDecodeErrorZPtr { err }
2721                 };
2722                 Self {
2723                         contents,
2724                         result_ok: o.result_ok,
2725                 }
2726         }
2727 }
2728 impl Clone for CResult_HTLCUpdateDecodeErrorZ {
2729         fn clone(&self) -> Self {
2730                 if self.result_ok {
2731                         Self { result_ok: true, contents: CResult_HTLCUpdateDecodeErrorZPtr {
2732                                 result: Box::into_raw(Box::new(<crate::chain::channelmonitor::HTLCUpdate>::clone(unsafe { &*self.contents.result })))
2733                         } }
2734                 } else {
2735                         Self { result_ok: false, contents: CResult_HTLCUpdateDecodeErrorZPtr {
2736                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
2737                         } }
2738                 }
2739         }
2740 }
2741 #[no_mangle]
2742 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_clone(orig: &CResult_HTLCUpdateDecodeErrorZ) -> CResult_HTLCUpdateDecodeErrorZ { orig.clone() }
2743 #[repr(C)]
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,
2748 }
2749 #[repr(C)]
2750 pub struct CResult_NoneMonitorUpdateErrorZ {
2751         pub contents: CResult_NoneMonitorUpdateErrorZPtr,
2752         pub result_ok: bool,
2753 }
2754 #[no_mangle]
2755 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_ok() -> CResult_NoneMonitorUpdateErrorZ {
2756         CResult_NoneMonitorUpdateErrorZ {
2757                 contents: CResult_NoneMonitorUpdateErrorZPtr {
2758                         result: std::ptr::null_mut(),
2759                 },
2760                 result_ok: true,
2761         }
2762 }
2763 #[no_mangle]
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)),
2768                 },
2769                 result_ok: false,
2770         }
2771 }
2772 #[no_mangle]
2773 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_free(_res: CResult_NoneMonitorUpdateErrorZ) { }
2774 impl Drop for CResult_NoneMonitorUpdateErrorZ {
2775         fn drop(&mut self) {
2776                 if self.result_ok {
2777                 } else {
2778                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
2779                                 let _ = unsafe { Box::from_raw(self.contents.err) };
2780                         }
2781                 }
2782         }
2783 }
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() }
2790                 } else {
2791                         let err = unsafe { o.contents.err };
2792                         unsafe { o.contents.err = std::ptr::null_mut(); }
2793                         CResult_NoneMonitorUpdateErrorZPtr { err }
2794                 };
2795                 Self {
2796                         contents,
2797                         result_ok: o.result_ok,
2798                 }
2799         }
2800 }
2801 impl Clone for CResult_NoneMonitorUpdateErrorZ {
2802         fn clone(&self) -> Self {
2803                 if self.result_ok {
2804                         Self { result_ok: true, contents: CResult_NoneMonitorUpdateErrorZPtr {
2805                                 result: std::ptr::null_mut()
2806                         } }
2807                 } else {
2808                         Self { result_ok: false, contents: CResult_NoneMonitorUpdateErrorZPtr {
2809                                 err: Box::into_raw(Box::new(<crate::chain::channelmonitor::MonitorUpdateError>::clone(unsafe { &*self.contents.err })))
2810                         } }
2811                 }
2812         }
2813 }
2814 #[no_mangle]
2815 pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_clone(orig: &CResult_NoneMonitorUpdateErrorZ) -> CResult_NoneMonitorUpdateErrorZ { orig.clone() }
2816 #[repr(C)]
2817 pub struct C2Tuple_OutPointScriptZ {
2818         pub a: crate::chain::transaction::OutPoint,
2819         pub b: crate::c_types::derived::CVec_u8Z,
2820 }
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 {
2823                 Self {
2824                         a: tup.0,
2825                         b: tup.1,
2826                 }
2827         }
2828 }
2829 impl C2Tuple_OutPointScriptZ {
2830         #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z) {
2831                 (self.a, self.b)
2832         }
2833 }
2834 impl Clone for C2Tuple_OutPointScriptZ {
2835         fn clone(&self) -> Self {
2836                 Self {
2837                         a: self.a.clone(),
2838                         b: self.b.clone(),
2839                 }
2840         }
2841 }
2842 #[no_mangle]
2843 pub extern "C" fn C2Tuple_OutPointScriptZ_clone(orig: &C2Tuple_OutPointScriptZ) -> C2Tuple_OutPointScriptZ { orig.clone() }
2844 #[no_mangle]
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, }
2847 }
2848
2849 #[no_mangle]
2850 pub extern "C" fn C2Tuple_OutPointScriptZ_free(_res: C2Tuple_OutPointScriptZ) { }
2851 #[repr(C)]
2852 pub struct CVec_TransactionZ {
2853         pub data: *mut crate::c_types::Transaction,
2854         pub datalen: usize
2855 }
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();
2861                 self.datalen = 0;
2862                 ret
2863         }
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) }
2866         }
2867 }
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() } }
2873         }
2874 }
2875 #[no_mangle]
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)) };
2881         }
2882 }
2883 #[repr(C)]
2884 pub struct C2Tuple_u32TxOutZ {
2885         pub a: u32,
2886         pub b: crate::c_types::TxOut,
2887 }
2888 impl From<(u32, crate::c_types::TxOut)> for C2Tuple_u32TxOutZ {
2889         fn from (tup: (u32, crate::c_types::TxOut)) -> Self {
2890                 Self {
2891                         a: tup.0,
2892                         b: tup.1,
2893                 }
2894         }
2895 }
2896 impl C2Tuple_u32TxOutZ {
2897         #[allow(unused)] pub(crate) fn to_rust(mut self) -> (u32, crate::c_types::TxOut) {
2898                 (self.a, self.b)
2899         }
2900 }
2901 impl Clone for C2Tuple_u32TxOutZ {
2902         fn clone(&self) -> Self {
2903                 Self {
2904                         a: self.a.clone(),
2905                         b: self.b.clone(),
2906                 }
2907         }
2908 }
2909 #[no_mangle]
2910 pub extern "C" fn C2Tuple_u32TxOutZ_clone(orig: &C2Tuple_u32TxOutZ) -> C2Tuple_u32TxOutZ { orig.clone() }
2911 #[no_mangle]
2912 pub extern "C" fn C2Tuple_u32TxOutZ_new(a: u32, b: crate::c_types::TxOut) -> C2Tuple_u32TxOutZ {
2913         C2Tuple_u32TxOutZ { a, b, }
2914 }
2915
2916 #[no_mangle]
2917 pub extern "C" fn C2Tuple_u32TxOutZ_free(_res: C2Tuple_u32TxOutZ) { }
2918 #[repr(C)]
2919 pub struct CVec_C2Tuple_u32TxOutZZ {
2920         pub data: *mut crate::c_types::derived::C2Tuple_u32TxOutZ,
2921         pub datalen: usize
2922 }
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();
2928                 self.datalen = 0;
2929                 ret
2930         }
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) }
2933         }
2934 }
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() } }
2940         }
2941 }
2942 #[no_mangle]
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)) };
2948         }
2949 }
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) });
2955                 Self::from(res)
2956         }
2957 }
2958 #[repr(C)]
2959 pub struct C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2960         pub a: crate::c_types::ThirtyTwoBytes,
2961         pub b: crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ,
2962 }
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 {
2965                 Self {
2966                         a: tup.0,
2967                         b: tup.1,
2968                 }
2969         }
2970 }
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) {
2973                 (self.a, self.b)
2974         }
2975 }
2976 #[no_mangle]
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, }
2979 }
2980
2981 #[no_mangle]
2982 pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) { }
2983 #[repr(C)]
2984 pub struct CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
2985         pub data: *mut crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ,
2986         pub datalen: usize
2987 }
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();
2993                 self.datalen = 0;
2994                 ret
2995         }
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) }
2998         }
2999 }
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() } }
3005         }
3006 }
3007 #[no_mangle]
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)) };
3013         }
3014 }
3015 #[repr(C)]
3016 pub struct C2Tuple_BlockHashChannelMonitorZ {
3017         pub a: crate::c_types::ThirtyTwoBytes,
3018         pub b: crate::chain::channelmonitor::ChannelMonitor,
3019 }
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 {
3022                 Self {
3023                         a: tup.0,
3024                         b: tup.1,
3025                 }
3026         }
3027 }
3028 impl C2Tuple_BlockHashChannelMonitorZ {
3029         #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor) {
3030                 (self.a, self.b)
3031         }
3032 }
3033 #[no_mangle]
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, }
3036 }
3037
3038 #[no_mangle]
3039 pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_free(_res: C2Tuple_BlockHashChannelMonitorZ) { }
3040 #[repr(C)]
3041 pub union CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
3042         pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ,
3043         pub err: *mut crate::ln::msgs::DecodeError,
3044 }
3045 #[repr(C)]
3046 pub struct CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3047         pub contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr,
3048         pub result_ok: bool,
3049 }
3050 #[no_mangle]
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)),
3055                 },
3056                 result_ok: true,
3057         }
3058 }
3059 #[no_mangle]
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)),
3064                 },
3065                 result_ok: false,
3066         }
3067 }
3068 #[no_mangle]
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) {
3072                 if self.result_ok {
3073                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
3074                                 let _ = unsafe { Box::from_raw(self.contents.result) };
3075                         }
3076                 } else {
3077                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
3078                                 let _ = unsafe { Box::from_raw(self.contents.err) };
3079                         }
3080                 }
3081         }
3082 }
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 }
3089                 } else {
3090                         let err = unsafe { o.contents.err };
3091                         unsafe { o.contents.err = std::ptr::null_mut(); }
3092                         CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { err }
3093                 };
3094                 Self {
3095                         contents,
3096                         result_ok: o.result_ok,
3097                 }
3098         }
3099 }
3100 #[repr(C)]
3101 pub struct CVec_SpendableOutputDescriptorZ {
3102         pub data: *mut crate::chain::keysinterface::SpendableOutputDescriptor,
3103         pub datalen: usize
3104 }
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();
3110                 self.datalen = 0;
3111                 ret
3112         }
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) }
3115         }
3116 }
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() } }
3122         }
3123 }
3124 #[no_mangle]
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)) };
3130         }
3131 }
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) });
3137                 Self::from(res)
3138         }
3139 }
3140 #[repr(C)]
3141 pub union CResult_TxOutAccessErrorZPtr {
3142         pub result: *mut crate::c_types::TxOut,
3143         pub err: *mut crate::chain::AccessError,
3144 }
3145 #[repr(C)]
3146 pub struct CResult_TxOutAccessErrorZ {
3147         pub contents: CResult_TxOutAccessErrorZPtr,
3148         pub result_ok: bool,
3149 }
3150 #[no_mangle]
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)),
3155                 },
3156                 result_ok: true,
3157         }
3158 }
3159 #[no_mangle]
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)),
3164                 },
3165                 result_ok: false,
3166         }
3167 }
3168 #[no_mangle]
3169 pub extern "C" fn CResult_TxOutAccessErrorZ_free(_res: CResult_TxOutAccessErrorZ) { }
3170 impl Drop for CResult_TxOutAccessErrorZ {
3171         fn drop(&mut self) {
3172                 if self.result_ok {
3173                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
3174                                 let _ = unsafe { Box::from_raw(self.contents.result) };
3175                         }
3176                 } else {
3177                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
3178                                 let _ = unsafe { Box::from_raw(self.contents.err) };
3179                         }
3180                 }
3181         }
3182 }
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 }
3189                 } else {
3190                         let err = unsafe { o.contents.err };
3191                         unsafe { o.contents.err = std::ptr::null_mut(); }
3192                         CResult_TxOutAccessErrorZPtr { err }
3193                 };
3194                 Self {
3195                         contents,
3196                         result_ok: o.result_ok,
3197                 }
3198         }
3199 }
3200 impl Clone for CResult_TxOutAccessErrorZ {
3201         fn clone(&self) -> Self {
3202                 if self.result_ok {
3203                         Self { result_ok: true, contents: CResult_TxOutAccessErrorZPtr {
3204                                 result: Box::into_raw(Box::new(<crate::c_types::TxOut>::clone(unsafe { &*self.contents.result })))
3205                         } }
3206                 } else {
3207                         Self { result_ok: false, contents: CResult_TxOutAccessErrorZPtr {
3208                                 err: Box::into_raw(Box::new(<crate::chain::AccessError>::clone(unsafe { &*self.contents.err })))
3209                         } }
3210                 }
3211         }
3212 }
3213 #[no_mangle]
3214 pub extern "C" fn CResult_TxOutAccessErrorZ_clone(orig: &CResult_TxOutAccessErrorZ) -> CResult_TxOutAccessErrorZ { orig.clone() }
3215 #[repr(C)]
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,
3220 }
3221 #[repr(C)]
3222 pub struct CResult_NoneAPIErrorZ {
3223         pub contents: CResult_NoneAPIErrorZPtr,
3224         pub result_ok: bool,
3225 }
3226 #[no_mangle]
3227 pub extern "C" fn CResult_NoneAPIErrorZ_ok() -> CResult_NoneAPIErrorZ {
3228         CResult_NoneAPIErrorZ {
3229                 contents: CResult_NoneAPIErrorZPtr {
3230                         result: std::ptr::null_mut(),
3231                 },
3232                 result_ok: true,
3233         }
3234 }
3235 #[no_mangle]
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)),
3240                 },
3241                 result_ok: false,
3242         }
3243 }
3244 #[no_mangle]
3245 pub extern "C" fn CResult_NoneAPIErrorZ_free(_res: CResult_NoneAPIErrorZ) { }
3246 impl Drop for CResult_NoneAPIErrorZ {
3247         fn drop(&mut self) {
3248                 if self.result_ok {
3249                 } else {
3250                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
3251                                 let _ = unsafe { Box::from_raw(self.contents.err) };
3252                         }
3253                 }
3254         }
3255 }
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() }
3262                 } else {
3263                         let err = unsafe { o.contents.err };
3264                         unsafe { o.contents.err = std::ptr::null_mut(); }
3265                         CResult_NoneAPIErrorZPtr { err }
3266                 };
3267                 Self {
3268                         contents,
3269                         result_ok: o.result_ok,
3270                 }
3271         }
3272 }
3273 impl Clone for CResult_NoneAPIErrorZ {
3274         fn clone(&self) -> Self {
3275                 if self.result_ok {
3276                         Self { result_ok: true, contents: CResult_NoneAPIErrorZPtr {
3277                                 result: std::ptr::null_mut()
3278                         } }
3279                 } else {
3280                         Self { result_ok: false, contents: CResult_NoneAPIErrorZPtr {
3281                                 err: Box::into_raw(Box::new(<crate::util::errors::APIError>::clone(unsafe { &*self.contents.err })))
3282                         } }
3283                 }
3284         }
3285 }
3286 #[no_mangle]
3287 pub extern "C" fn CResult_NoneAPIErrorZ_clone(orig: &CResult_NoneAPIErrorZ) -> CResult_NoneAPIErrorZ { orig.clone() }
3288 #[repr(C)]
3289 pub struct CVec_ChannelDetailsZ {
3290         pub data: *mut crate::ln::channelmanager::ChannelDetails,
3291         pub datalen: usize
3292 }
3293 impl CVec_ChannelDetailsZ {
3294         #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::channelmanager::ChannelDetails> {
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();
3298                 self.datalen = 0;
3299                 ret
3300         }
3301         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::channelmanager::ChannelDetails] {
3302                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3303         }
3304 }
3305 impl From<Vec<crate::ln::channelmanager::ChannelDetails>> for CVec_ChannelDetailsZ {
3306         fn from(v: Vec<crate::ln::channelmanager::ChannelDetails>) -> 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() } }
3310         }
3311 }
3312 #[no_mangle]
3313 pub extern "C" fn CVec_ChannelDetailsZ_free(_res: CVec_ChannelDetailsZ) { }
3314 impl Drop for CVec_ChannelDetailsZ {
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)) };
3318         }
3319 }
3320 impl Clone for CVec_ChannelDetailsZ {
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) });
3325                 Self::from(res)
3326         }
3327 }
3328 #[repr(C)]
3329 pub union CResult_NonePaymentSendFailureZPtr {
3330         /// Note that this value is always NULL, as there are no contents in the OK variant
3331         pub result: *mut std::ffi::c_void,
3332         pub err: *mut crate::ln::channelmanager::PaymentSendFailure,
3333 }
3334 #[repr(C)]
3335 pub struct CResult_NonePaymentSendFailureZ {
3336         pub contents: CResult_NonePaymentSendFailureZPtr,
3337         pub result_ok: bool,
3338 }
3339 #[no_mangle]
3340 pub extern "C" fn CResult_NonePaymentSendFailureZ_ok() -> CResult_NonePaymentSendFailureZ {
3341         CResult_NonePaymentSendFailureZ {
3342                 contents: CResult_NonePaymentSendFailureZPtr {
3343                         result: std::ptr::null_mut(),
3344                 },
3345                 result_ok: true,
3346         }
3347 }
3348 #[no_mangle]
3349 pub extern "C" fn CResult_NonePaymentSendFailureZ_err(e: crate::ln::channelmanager::PaymentSendFailure) -> CResult_NonePaymentSendFailureZ {
3350         CResult_NonePaymentSendFailureZ {
3351                 contents: CResult_NonePaymentSendFailureZPtr {
3352                         err: Box::into_raw(Box::new(e)),
3353                 },
3354                 result_ok: false,
3355         }
3356 }
3357 #[no_mangle]
3358 pub extern "C" fn CResult_NonePaymentSendFailureZ_free(_res: CResult_NonePaymentSendFailureZ) { }
3359 impl Drop for CResult_NonePaymentSendFailureZ {
3360         fn drop(&mut self) {
3361                 if self.result_ok {
3362                 } else {
3363                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
3364                                 let _ = unsafe { Box::from_raw(self.contents.err) };
3365                         }
3366                 }
3367         }
3368 }
3369 impl From<crate::c_types::CResultTempl<u8, crate::ln::channelmanager::PaymentSendFailure>> for CResult_NonePaymentSendFailureZ {
3370         fn from(mut o: crate::c_types::CResultTempl<u8, crate::ln::channelmanager::PaymentSendFailure>) -> Self {
3371                 let contents = if o.result_ok {
3372                         let _ = unsafe { Box::from_raw(o.contents.result) };
3373                         o.contents.result = std::ptr::null_mut();
3374                         CResult_NonePaymentSendFailureZPtr { result: std::ptr::null_mut() }
3375                 } else {
3376                         let err = unsafe { o.contents.err };
3377                         unsafe { o.contents.err = std::ptr::null_mut(); }
3378                         CResult_NonePaymentSendFailureZPtr { err }
3379                 };
3380                 Self {
3381                         contents,
3382                         result_ok: o.result_ok,
3383                 }
3384         }
3385 }
3386 impl Clone for CResult_NonePaymentSendFailureZ {
3387         fn clone(&self) -> Self {
3388                 if self.result_ok {
3389                         Self { result_ok: true, contents: CResult_NonePaymentSendFailureZPtr {
3390                                 result: std::ptr::null_mut()
3391                         } }
3392                 } else {
3393                         Self { result_ok: false, contents: CResult_NonePaymentSendFailureZPtr {
3394                                 err: Box::into_raw(Box::new(<crate::ln::channelmanager::PaymentSendFailure>::clone(unsafe { &*self.contents.err })))
3395                         } }
3396                 }
3397         }
3398 }
3399 #[no_mangle]
3400 pub extern "C" fn CResult_NonePaymentSendFailureZ_clone(orig: &CResult_NonePaymentSendFailureZ) -> CResult_NonePaymentSendFailureZ { orig.clone() }
3401 #[repr(C)]
3402 pub struct CVec_ChannelMonitorZ {
3403         pub data: *mut crate::chain::channelmonitor::ChannelMonitor,
3404         pub datalen: usize
3405 }
3406 impl CVec_ChannelMonitorZ {
3407         #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::chain::channelmonitor::ChannelMonitor> {
3408                 if self.datalen == 0 { return Vec::new(); }
3409                 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3410                 self.data = std::ptr::null_mut();
3411                 self.datalen = 0;
3412                 ret
3413         }
3414         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::channelmonitor::ChannelMonitor] {
3415                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3416         }
3417 }
3418 impl From<Vec<crate::chain::channelmonitor::ChannelMonitor>> for CVec_ChannelMonitorZ {
3419         fn from(v: Vec<crate::chain::channelmonitor::ChannelMonitor>) -> Self {
3420                 let datalen = v.len();
3421                 let data = Box::into_raw(v.into_boxed_slice());
3422                 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3423         }
3424 }
3425 #[no_mangle]
3426 pub extern "C" fn CVec_ChannelMonitorZ_free(_res: CVec_ChannelMonitorZ) { }
3427 impl Drop for CVec_ChannelMonitorZ {
3428         fn drop(&mut self) {
3429                 if self.datalen == 0 { return; }
3430                 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3431         }
3432 }
3433 impl Clone for CVec_ChannelMonitorZ {
3434         fn clone(&self) -> Self {
3435                 let mut res = Vec::new();
3436                 if self.datalen == 0 { return Self::from(res); }
3437                 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
3438                 Self::from(res)
3439         }
3440 }
3441 #[repr(C)]
3442 pub struct C2Tuple_BlockHashChannelManagerZ {
3443         pub a: crate::c_types::ThirtyTwoBytes,
3444         pub b: crate::ln::channelmanager::ChannelManager,
3445 }
3446 impl From<(crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)> for C2Tuple_BlockHashChannelManagerZ {
3447         fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)) -> Self {
3448                 Self {
3449                         a: tup.0,
3450                         b: tup.1,
3451                 }
3452         }
3453 }
3454 impl C2Tuple_BlockHashChannelManagerZ {
3455         #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager) {
3456                 (self.a, self.b)
3457         }
3458 }
3459 #[no_mangle]
3460 pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::ln::channelmanager::ChannelManager) -> C2Tuple_BlockHashChannelManagerZ {
3461         C2Tuple_BlockHashChannelManagerZ { a, b, }
3462 }
3463
3464 #[no_mangle]
3465 pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_free(_res: C2Tuple_BlockHashChannelManagerZ) { }
3466 #[repr(C)]
3467 pub union CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3468         pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ,
3469         pub err: *mut crate::ln::msgs::DecodeError,
3470 }
3471 #[repr(C)]
3472 pub struct CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3473         pub contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr,
3474         pub result_ok: bool,
3475 }
3476 #[no_mangle]
3477 pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3478         CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3479                 contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3480                         result: Box::into_raw(Box::new(o)),
3481                 },
3482                 result_ok: true,
3483         }
3484 }
3485 #[no_mangle]
3486 pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3487         CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3488                 contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3489                         err: Box::into_raw(Box::new(e)),
3490                 },
3491                 result_ok: false,
3492         }
3493 }
3494 #[no_mangle]
3495 pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ) { }
3496 impl Drop for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3497         fn drop(&mut self) {
3498                 if self.result_ok {
3499                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
3500                                 let _ = unsafe { Box::from_raw(self.contents.result) };
3501                         }
3502                 } else {
3503                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
3504                                 let _ = unsafe { Box::from_raw(self.contents.err) };
3505                         }
3506                 }
3507         }
3508 }
3509 impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ, crate::ln::msgs::DecodeError>> for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3510         fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ, crate::ln::msgs::DecodeError>) -> Self {
3511                 let contents = if o.result_ok {
3512                         let result = unsafe { o.contents.result };
3513                         unsafe { o.contents.result = std::ptr::null_mut() };
3514                         CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { result }
3515                 } else {
3516                         let err = unsafe { o.contents.err };
3517                         unsafe { o.contents.err = std::ptr::null_mut(); }
3518                         CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { err }
3519                 };
3520                 Self {
3521                         contents,
3522                         result_ok: o.result_ok,
3523                 }
3524         }
3525 }
3526 #[repr(C)]
3527 pub struct C2Tuple_u64u64Z {
3528         pub a: u64,
3529         pub b: u64,
3530 }
3531 impl From<(u64, u64)> for C2Tuple_u64u64Z {
3532         fn from (tup: (u64, u64)) -> Self {
3533                 Self {
3534                         a: tup.0,
3535                         b: tup.1,
3536                 }
3537         }
3538 }
3539 impl C2Tuple_u64u64Z {
3540         #[allow(unused)] pub(crate) fn to_rust(mut self) -> (u64, u64) {
3541                 (self.a, self.b)
3542         }
3543 }
3544 impl Clone for C2Tuple_u64u64Z {
3545         fn clone(&self) -> Self {
3546                 Self {
3547                         a: self.a.clone(),
3548                         b: self.b.clone(),
3549                 }
3550         }
3551 }
3552 #[no_mangle]
3553 pub extern "C" fn C2Tuple_u64u64Z_clone(orig: &C2Tuple_u64u64Z) -> C2Tuple_u64u64Z { orig.clone() }
3554 #[no_mangle]
3555 pub extern "C" fn C2Tuple_u64u64Z_new(a: u64, b: u64) -> C2Tuple_u64u64Z {
3556         C2Tuple_u64u64Z { a, b, }
3557 }
3558
3559 #[no_mangle]
3560 pub extern "C" fn C2Tuple_u64u64Z_free(_res: C2Tuple_u64u64Z) { }
3561 #[repr(C)]
3562 pub union CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3563         pub result: *mut crate::chain::keysinterface::SpendableOutputDescriptor,
3564         pub err: *mut crate::ln::msgs::DecodeError,
3565 }
3566 #[repr(C)]
3567 pub struct CResult_SpendableOutputDescriptorDecodeErrorZ {
3568         pub contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr,
3569         pub result_ok: bool,
3570 }
3571 #[no_mangle]
3572 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o: crate::chain::keysinterface::SpendableOutputDescriptor) -> CResult_SpendableOutputDescriptorDecodeErrorZ {
3573         CResult_SpendableOutputDescriptorDecodeErrorZ {
3574                 contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3575                         result: Box::into_raw(Box::new(o)),
3576                 },
3577                 result_ok: true,
3578         }
3579 }
3580 #[no_mangle]
3581 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_SpendableOutputDescriptorDecodeErrorZ {
3582         CResult_SpendableOutputDescriptorDecodeErrorZ {
3583                 contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3584                         err: Box::into_raw(Box::new(e)),
3585                 },
3586                 result_ok: false,
3587         }
3588 }
3589 #[no_mangle]
3590 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res: CResult_SpendableOutputDescriptorDecodeErrorZ) { }
3591 impl Drop for CResult_SpendableOutputDescriptorDecodeErrorZ {
3592         fn drop(&mut self) {
3593                 if self.result_ok {
3594                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
3595                                 let _ = unsafe { Box::from_raw(self.contents.result) };
3596                         }
3597                 } else {
3598                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
3599                                 let _ = unsafe { Box::from_raw(self.contents.err) };
3600                         }
3601                 }
3602         }
3603 }
3604 impl From<crate::c_types::CResultTempl<crate::chain::keysinterface::SpendableOutputDescriptor, crate::ln::msgs::DecodeError>> for CResult_SpendableOutputDescriptorDecodeErrorZ {
3605         fn from(mut o: crate::c_types::CResultTempl<crate::chain::keysinterface::SpendableOutputDescriptor, crate::ln::msgs::DecodeError>) -> Self {
3606                 let contents = if o.result_ok {
3607                         let result = unsafe { o.contents.result };
3608                         unsafe { o.contents.result = std::ptr::null_mut() };
3609                         CResult_SpendableOutputDescriptorDecodeErrorZPtr { result }
3610                 } else {
3611                         let err = unsafe { o.contents.err };
3612                         unsafe { o.contents.err = std::ptr::null_mut(); }
3613                         CResult_SpendableOutputDescriptorDecodeErrorZPtr { err }
3614                 };
3615                 Self {
3616                         contents,
3617                         result_ok: o.result_ok,
3618                 }
3619         }
3620 }
3621 impl Clone for CResult_SpendableOutputDescriptorDecodeErrorZ {
3622         fn clone(&self) -> Self {
3623                 if self.result_ok {
3624                         Self { result_ok: true, contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3625                                 result: Box::into_raw(Box::new(<crate::chain::keysinterface::SpendableOutputDescriptor>::clone(unsafe { &*self.contents.result })))
3626                         } }
3627                 } else {
3628                         Self { result_ok: false, contents: CResult_SpendableOutputDescriptorDecodeErrorZPtr {
3629                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
3630                         } }
3631                 }
3632         }
3633 }
3634 #[no_mangle]
3635 pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig: &CResult_SpendableOutputDescriptorDecodeErrorZ) -> CResult_SpendableOutputDescriptorDecodeErrorZ { orig.clone() }
3636 #[repr(C)]
3637 pub struct C2Tuple_SignatureCVec_SignatureZZ {
3638         pub a: crate::c_types::Signature,
3639         pub b: crate::c_types::derived::CVec_SignatureZ,
3640 }
3641 impl From<(crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ)> for C2Tuple_SignatureCVec_SignatureZZ {
3642         fn from (tup: (crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ)) -> Self {
3643                 Self {
3644                         a: tup.0,
3645                         b: tup.1,
3646                 }
3647         }
3648 }
3649 impl C2Tuple_SignatureCVec_SignatureZZ {
3650         #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::Signature, crate::c_types::derived::CVec_SignatureZ) {
3651                 (self.a, self.b)
3652         }
3653 }
3654 impl Clone for C2Tuple_SignatureCVec_SignatureZZ {
3655         fn clone(&self) -> Self {
3656                 Self {
3657                         a: self.a.clone(),
3658                         b: self.b.clone(),
3659                 }
3660         }
3661 }
3662 #[no_mangle]
3663 pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_clone(orig: &C2Tuple_SignatureCVec_SignatureZZ) -> C2Tuple_SignatureCVec_SignatureZZ { orig.clone() }
3664 #[no_mangle]
3665 pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_new(a: crate::c_types::Signature, b: crate::c_types::derived::CVec_SignatureZ) -> C2Tuple_SignatureCVec_SignatureZZ {
3666         C2Tuple_SignatureCVec_SignatureZZ { a, b, }
3667 }
3668
3669 #[no_mangle]
3670 pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_free(_res: C2Tuple_SignatureCVec_SignatureZZ) { }
3671 #[repr(C)]
3672 pub union CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3673         pub result: *mut crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ,
3674         /// Note that this value is always NULL, as there are no contents in the Err variant
3675         pub err: *mut std::ffi::c_void,
3676 }
3677 #[repr(C)]
3678 pub struct CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3679         pub contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr,
3680         pub result_ok: bool,
3681 }
3682 #[no_mangle]
3683 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o: crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ) -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3684         CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3685                 contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3686                         result: Box::into_raw(Box::new(o)),
3687                 },
3688                 result_ok: true,
3689         }
3690 }
3691 #[no_mangle]
3692 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3693         CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3694                 contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3695                         err: std::ptr::null_mut(),
3696                 },
3697                 result_ok: false,
3698         }
3699 }
3700 #[no_mangle]
3701 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ) { }
3702 impl Drop for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3703         fn drop(&mut self) {
3704                 if self.result_ok {
3705                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
3706                                 let _ = unsafe { Box::from_raw(self.contents.result) };
3707                         }
3708                 } else {
3709                 }
3710         }
3711 }
3712 impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ, u8>> for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3713         fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ, u8>) -> Self {
3714                 let contents = if o.result_ok {
3715                         let result = unsafe { o.contents.result };
3716                         unsafe { o.contents.result = std::ptr::null_mut() };
3717                         CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { result }
3718                 } else {
3719                         let _ = unsafe { Box::from_raw(o.contents.err) };
3720                         o.contents.err = std::ptr::null_mut();
3721                         CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { err: std::ptr::null_mut() }
3722                 };
3723                 Self {
3724                         contents,
3725                         result_ok: o.result_ok,
3726                 }
3727         }
3728 }
3729 impl Clone for CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3730         fn clone(&self) -> Self {
3731                 if self.result_ok {
3732                         Self { result_ok: true, contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3733                                 result: Box::into_raw(Box::new(<crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ>::clone(unsafe { &*self.contents.result })))
3734                         } }
3735                 } else {
3736                         Self { result_ok: false, contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3737                                 err: std::ptr::null_mut()
3738                         } }
3739                 }
3740         }
3741 }
3742 #[no_mangle]
3743 pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig: &CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ) -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { orig.clone() }
3744 #[repr(C)]
3745 pub union CResult_SignatureNoneZPtr {
3746         pub result: *mut crate::c_types::Signature,
3747         /// Note that this value is always NULL, as there are no contents in the Err variant
3748         pub err: *mut std::ffi::c_void,
3749 }
3750 #[repr(C)]
3751 pub struct CResult_SignatureNoneZ {
3752         pub contents: CResult_SignatureNoneZPtr,
3753         pub result_ok: bool,
3754 }
3755 #[no_mangle]
3756 pub extern "C" fn CResult_SignatureNoneZ_ok(o: crate::c_types::Signature) -> CResult_SignatureNoneZ {
3757         CResult_SignatureNoneZ {
3758                 contents: CResult_SignatureNoneZPtr {
3759                         result: Box::into_raw(Box::new(o)),
3760                 },
3761                 result_ok: true,
3762         }
3763 }
3764 #[no_mangle]
3765 pub extern "C" fn CResult_SignatureNoneZ_err() -> CResult_SignatureNoneZ {
3766         CResult_SignatureNoneZ {
3767                 contents: CResult_SignatureNoneZPtr {
3768                         err: std::ptr::null_mut(),
3769                 },
3770                 result_ok: false,
3771         }
3772 }
3773 #[no_mangle]
3774 pub extern "C" fn CResult_SignatureNoneZ_free(_res: CResult_SignatureNoneZ) { }
3775 impl Drop for CResult_SignatureNoneZ {
3776         fn drop(&mut self) {
3777                 if self.result_ok {
3778                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
3779                                 let _ = unsafe { Box::from_raw(self.contents.result) };
3780                         }
3781                 } else {
3782                 }
3783         }
3784 }
3785 impl From<crate::c_types::CResultTempl<crate::c_types::Signature, u8>> for CResult_SignatureNoneZ {
3786         fn from(mut o: crate::c_types::CResultTempl<crate::c_types::Signature, u8>) -> Self {
3787                 let contents = if o.result_ok {
3788                         let result = unsafe { o.contents.result };
3789                         unsafe { o.contents.result = std::ptr::null_mut() };
3790                         CResult_SignatureNoneZPtr { result }
3791                 } else {
3792                         let _ = unsafe { Box::from_raw(o.contents.err) };
3793                         o.contents.err = std::ptr::null_mut();
3794                         CResult_SignatureNoneZPtr { err: std::ptr::null_mut() }
3795                 };
3796                 Self {
3797                         contents,
3798                         result_ok: o.result_ok,
3799                 }
3800         }
3801 }
3802 impl Clone for CResult_SignatureNoneZ {
3803         fn clone(&self) -> Self {
3804                 if self.result_ok {
3805                         Self { result_ok: true, contents: CResult_SignatureNoneZPtr {
3806                                 result: Box::into_raw(Box::new(<crate::c_types::Signature>::clone(unsafe { &*self.contents.result })))
3807                         } }
3808                 } else {
3809                         Self { result_ok: false, contents: CResult_SignatureNoneZPtr {
3810                                 err: std::ptr::null_mut()
3811                         } }
3812                 }
3813         }
3814 }
3815 #[no_mangle]
3816 pub extern "C" fn CResult_SignatureNoneZ_clone(orig: &CResult_SignatureNoneZ) -> CResult_SignatureNoneZ { orig.clone() }
3817 #[repr(C)]
3818 pub union CResult_ChannelKeysDecodeErrorZPtr {
3819         pub result: *mut crate::chain::keysinterface::ChannelKeys,
3820         pub err: *mut crate::ln::msgs::DecodeError,
3821 }
3822 #[repr(C)]
3823 pub struct CResult_ChannelKeysDecodeErrorZ {
3824         pub contents: CResult_ChannelKeysDecodeErrorZPtr,
3825         pub result_ok: bool,
3826 }
3827 #[no_mangle]
3828 pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_ok(o: crate::chain::keysinterface::ChannelKeys) -> CResult_ChannelKeysDecodeErrorZ {
3829         CResult_ChannelKeysDecodeErrorZ {
3830                 contents: CResult_ChannelKeysDecodeErrorZPtr {
3831                         result: Box::into_raw(Box::new(o)),
3832                 },
3833                 result_ok: true,
3834         }
3835 }
3836 #[no_mangle]
3837 pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelKeysDecodeErrorZ {
3838         CResult_ChannelKeysDecodeErrorZ {
3839                 contents: CResult_ChannelKeysDecodeErrorZPtr {
3840                         err: Box::into_raw(Box::new(e)),
3841                 },
3842                 result_ok: false,
3843         }
3844 }
3845 #[no_mangle]
3846 pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_free(_res: CResult_ChannelKeysDecodeErrorZ) { }
3847 impl Drop for CResult_ChannelKeysDecodeErrorZ {
3848         fn drop(&mut self) {
3849                 if self.result_ok {
3850                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
3851                                 let _ = unsafe { Box::from_raw(self.contents.result) };
3852                         }
3853                 } else {
3854                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
3855                                 let _ = unsafe { Box::from_raw(self.contents.err) };
3856                         }
3857                 }
3858         }
3859 }
3860 impl From<crate::c_types::CResultTempl<crate::chain::keysinterface::ChannelKeys, crate::ln::msgs::DecodeError>> for CResult_ChannelKeysDecodeErrorZ {
3861         fn from(mut o: crate::c_types::CResultTempl<crate::chain::keysinterface::ChannelKeys, crate::ln::msgs::DecodeError>) -> Self {
3862                 let contents = if o.result_ok {
3863                         let result = unsafe { o.contents.result };
3864                         unsafe { o.contents.result = std::ptr::null_mut() };
3865                         CResult_ChannelKeysDecodeErrorZPtr { result }
3866                 } else {
3867                         let err = unsafe { o.contents.err };
3868                         unsafe { o.contents.err = std::ptr::null_mut(); }
3869                         CResult_ChannelKeysDecodeErrorZPtr { err }
3870                 };
3871                 Self {
3872                         contents,
3873                         result_ok: o.result_ok,
3874                 }
3875         }
3876 }
3877 impl Clone for CResult_ChannelKeysDecodeErrorZ {
3878         fn clone(&self) -> Self {
3879                 if self.result_ok {
3880                         Self { result_ok: true, contents: CResult_ChannelKeysDecodeErrorZPtr {
3881                                 result: Box::into_raw(Box::new(<crate::chain::keysinterface::ChannelKeys>::clone(unsafe { &*self.contents.result })))
3882                         } }
3883                 } else {
3884                         Self { result_ok: false, contents: CResult_ChannelKeysDecodeErrorZPtr {
3885                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
3886                         } }
3887                 }
3888         }
3889 }
3890 #[no_mangle]
3891 pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_clone(orig: &CResult_ChannelKeysDecodeErrorZ) -> CResult_ChannelKeysDecodeErrorZ { orig.clone() }
3892 #[repr(C)]
3893 pub union CResult_InMemoryChannelKeysDecodeErrorZPtr {
3894         pub result: *mut crate::chain::keysinterface::InMemoryChannelKeys,
3895         pub err: *mut crate::ln::msgs::DecodeError,
3896 }
3897 #[repr(C)]
3898 pub struct CResult_InMemoryChannelKeysDecodeErrorZ {
3899         pub contents: CResult_InMemoryChannelKeysDecodeErrorZPtr,
3900         pub result_ok: bool,
3901 }
3902 #[no_mangle]
3903 pub extern "C" fn CResult_InMemoryChannelKeysDecodeErrorZ_ok(o: crate::chain::keysinterface::InMemoryChannelKeys) -> CResult_InMemoryChannelKeysDecodeErrorZ {
3904         CResult_InMemoryChannelKeysDecodeErrorZ {
3905                 contents: CResult_InMemoryChannelKeysDecodeErrorZPtr {
3906                         result: Box::into_raw(Box::new(o)),
3907                 },
3908                 result_ok: true,
3909         }
3910 }
3911 #[no_mangle]
3912 pub extern "C" fn CResult_InMemoryChannelKeysDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InMemoryChannelKeysDecodeErrorZ {
3913         CResult_InMemoryChannelKeysDecodeErrorZ {
3914                 contents: CResult_InMemoryChannelKeysDecodeErrorZPtr {
3915                         err: Box::into_raw(Box::new(e)),
3916                 },
3917                 result_ok: false,
3918         }
3919 }
3920 #[no_mangle]
3921 pub extern "C" fn CResult_InMemoryChannelKeysDecodeErrorZ_free(_res: CResult_InMemoryChannelKeysDecodeErrorZ) { }
3922 impl Drop for CResult_InMemoryChannelKeysDecodeErrorZ {
3923         fn drop(&mut self) {
3924                 if self.result_ok {
3925                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
3926                                 let _ = unsafe { Box::from_raw(self.contents.result) };
3927                         }
3928                 } else {
3929                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
3930                                 let _ = unsafe { Box::from_raw(self.contents.err) };
3931                         }
3932                 }
3933         }
3934 }
3935 impl From<crate::c_types::CResultTempl<crate::chain::keysinterface::InMemoryChannelKeys, crate::ln::msgs::DecodeError>> for CResult_InMemoryChannelKeysDecodeErrorZ {
3936         fn from(mut o: crate::c_types::CResultTempl<crate::chain::keysinterface::InMemoryChannelKeys, crate::ln::msgs::DecodeError>) -> Self {
3937                 let contents = if o.result_ok {
3938                         let result = unsafe { o.contents.result };
3939                         unsafe { o.contents.result = std::ptr::null_mut() };
3940                         CResult_InMemoryChannelKeysDecodeErrorZPtr { result }
3941                 } else {
3942                         let err = unsafe { o.contents.err };
3943                         unsafe { o.contents.err = std::ptr::null_mut(); }
3944                         CResult_InMemoryChannelKeysDecodeErrorZPtr { err }
3945                 };
3946                 Self {
3947                         contents,
3948                         result_ok: o.result_ok,
3949                 }
3950         }
3951 }
3952 impl Clone for CResult_InMemoryChannelKeysDecodeErrorZ {
3953         fn clone(&self) -> Self {
3954                 if self.result_ok {
3955                         Self { result_ok: true, contents: CResult_InMemoryChannelKeysDecodeErrorZPtr {
3956                                 result: Box::into_raw(Box::new(<crate::chain::keysinterface::InMemoryChannelKeys>::clone(unsafe { &*self.contents.result })))
3957                         } }
3958                 } else {
3959                         Self { result_ok: false, contents: CResult_InMemoryChannelKeysDecodeErrorZPtr {
3960                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
3961                         } }
3962                 }
3963         }
3964 }
3965 #[no_mangle]
3966 pub extern "C" fn CResult_InMemoryChannelKeysDecodeErrorZ_clone(orig: &CResult_InMemoryChannelKeysDecodeErrorZ) -> CResult_InMemoryChannelKeysDecodeErrorZ { orig.clone() }
3967 #[repr(C)]
3968 pub struct CVec_RouteHopZ {
3969         pub data: *mut crate::routing::router::RouteHop,
3970         pub datalen: usize
3971 }
3972 impl CVec_RouteHopZ {
3973         #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::routing::router::RouteHop> {
3974                 if self.datalen == 0 { return Vec::new(); }
3975                 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
3976                 self.data = std::ptr::null_mut();
3977                 self.datalen = 0;
3978                 ret
3979         }
3980         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::routing::router::RouteHop] {
3981                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
3982         }
3983 }
3984 impl From<Vec<crate::routing::router::RouteHop>> for CVec_RouteHopZ {
3985         fn from(v: Vec<crate::routing::router::RouteHop>) -> Self {
3986                 let datalen = v.len();
3987                 let data = Box::into_raw(v.into_boxed_slice());
3988                 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
3989         }
3990 }
3991 #[no_mangle]
3992 pub extern "C" fn CVec_RouteHopZ_free(_res: CVec_RouteHopZ) { }
3993 impl Drop for CVec_RouteHopZ {
3994         fn drop(&mut self) {
3995                 if self.datalen == 0 { return; }
3996                 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
3997         }
3998 }
3999 impl Clone for CVec_RouteHopZ {
4000         fn clone(&self) -> Self {
4001                 let mut res = Vec::new();
4002                 if self.datalen == 0 { return Self::from(res); }
4003                 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4004                 Self::from(res)
4005         }
4006 }
4007 #[repr(C)]
4008 pub struct CVec_CVec_RouteHopZZ {
4009         pub data: *mut crate::c_types::derived::CVec_RouteHopZ,
4010         pub datalen: usize
4011 }
4012 impl CVec_CVec_RouteHopZZ {
4013         #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::CVec_RouteHopZ> {
4014                 if self.datalen == 0 { return Vec::new(); }
4015                 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4016                 self.data = std::ptr::null_mut();
4017                 self.datalen = 0;
4018                 ret
4019         }
4020         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CVec_RouteHopZ] {
4021                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4022         }
4023 }
4024 impl From<Vec<crate::c_types::derived::CVec_RouteHopZ>> for CVec_CVec_RouteHopZZ {
4025         fn from(v: Vec<crate::c_types::derived::CVec_RouteHopZ>) -> Self {
4026                 let datalen = v.len();
4027                 let data = Box::into_raw(v.into_boxed_slice());
4028                 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4029         }
4030 }
4031 #[no_mangle]
4032 pub extern "C" fn CVec_CVec_RouteHopZZ_free(_res: CVec_CVec_RouteHopZZ) { }
4033 impl Drop for CVec_CVec_RouteHopZZ {
4034         fn drop(&mut self) {
4035                 if self.datalen == 0 { return; }
4036                 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4037         }
4038 }
4039 impl Clone for CVec_CVec_RouteHopZZ {
4040         fn clone(&self) -> Self {
4041                 let mut res = Vec::new();
4042                 if self.datalen == 0 { return Self::from(res); }
4043                 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4044                 Self::from(res)
4045         }
4046 }
4047 #[repr(C)]
4048 pub union CResult_RouteDecodeErrorZPtr {
4049         pub result: *mut crate::routing::router::Route,
4050         pub err: *mut crate::ln::msgs::DecodeError,
4051 }
4052 #[repr(C)]
4053 pub struct CResult_RouteDecodeErrorZ {
4054         pub contents: CResult_RouteDecodeErrorZPtr,
4055         pub result_ok: bool,
4056 }
4057 #[no_mangle]
4058 pub extern "C" fn CResult_RouteDecodeErrorZ_ok(o: crate::routing::router::Route) -> CResult_RouteDecodeErrorZ {
4059         CResult_RouteDecodeErrorZ {
4060                 contents: CResult_RouteDecodeErrorZPtr {
4061                         result: Box::into_raw(Box::new(o)),
4062                 },
4063                 result_ok: true,
4064         }
4065 }
4066 #[no_mangle]
4067 pub extern "C" fn CResult_RouteDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RouteDecodeErrorZ {
4068         CResult_RouteDecodeErrorZ {
4069                 contents: CResult_RouteDecodeErrorZPtr {
4070                         err: Box::into_raw(Box::new(e)),
4071                 },
4072                 result_ok: false,
4073         }
4074 }
4075 #[no_mangle]
4076 pub extern "C" fn CResult_RouteDecodeErrorZ_free(_res: CResult_RouteDecodeErrorZ) { }
4077 impl Drop for CResult_RouteDecodeErrorZ {
4078         fn drop(&mut self) {
4079                 if self.result_ok {
4080                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
4081                                 let _ = unsafe { Box::from_raw(self.contents.result) };
4082                         }
4083                 } else {
4084                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
4085                                 let _ = unsafe { Box::from_raw(self.contents.err) };
4086                         }
4087                 }
4088         }
4089 }
4090 impl From<crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::DecodeError>> for CResult_RouteDecodeErrorZ {
4091         fn from(mut o: crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::DecodeError>) -> Self {
4092                 let contents = if o.result_ok {
4093                         let result = unsafe { o.contents.result };
4094                         unsafe { o.contents.result = std::ptr::null_mut() };
4095                         CResult_RouteDecodeErrorZPtr { result }
4096                 } else {
4097                         let err = unsafe { o.contents.err };
4098                         unsafe { o.contents.err = std::ptr::null_mut(); }
4099                         CResult_RouteDecodeErrorZPtr { err }
4100                 };
4101                 Self {
4102                         contents,
4103                         result_ok: o.result_ok,
4104                 }
4105         }
4106 }
4107 impl Clone for CResult_RouteDecodeErrorZ {
4108         fn clone(&self) -> Self {
4109                 if self.result_ok {
4110                         Self { result_ok: true, contents: CResult_RouteDecodeErrorZPtr {
4111                                 result: Box::into_raw(Box::new(<crate::routing::router::Route>::clone(unsafe { &*self.contents.result })))
4112                         } }
4113                 } else {
4114                         Self { result_ok: false, contents: CResult_RouteDecodeErrorZPtr {
4115                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4116                         } }
4117                 }
4118         }
4119 }
4120 #[no_mangle]
4121 pub extern "C" fn CResult_RouteDecodeErrorZ_clone(orig: &CResult_RouteDecodeErrorZ) -> CResult_RouteDecodeErrorZ { orig.clone() }
4122 #[repr(C)]
4123 pub struct CVec_RouteHintZ {
4124         pub data: *mut crate::routing::router::RouteHint,
4125         pub datalen: usize
4126 }
4127 impl CVec_RouteHintZ {
4128         #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::routing::router::RouteHint> {
4129                 if self.datalen == 0 { return Vec::new(); }
4130                 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4131                 self.data = std::ptr::null_mut();
4132                 self.datalen = 0;
4133                 ret
4134         }
4135         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::routing::router::RouteHint] {
4136                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4137         }
4138 }
4139 impl From<Vec<crate::routing::router::RouteHint>> for CVec_RouteHintZ {
4140         fn from(v: Vec<crate::routing::router::RouteHint>) -> Self {
4141                 let datalen = v.len();
4142                 let data = Box::into_raw(v.into_boxed_slice());
4143                 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4144         }
4145 }
4146 #[no_mangle]
4147 pub extern "C" fn CVec_RouteHintZ_free(_res: CVec_RouteHintZ) { }
4148 impl Drop for CVec_RouteHintZ {
4149         fn drop(&mut self) {
4150                 if self.datalen == 0 { return; }
4151                 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4152         }
4153 }
4154 impl Clone for CVec_RouteHintZ {
4155         fn clone(&self) -> Self {
4156                 let mut res = Vec::new();
4157                 if self.datalen == 0 { return Self::from(res); }
4158                 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4159                 Self::from(res)
4160         }
4161 }
4162 #[repr(C)]
4163 pub union CResult_RouteLightningErrorZPtr {
4164         pub result: *mut crate::routing::router::Route,
4165         pub err: *mut crate::ln::msgs::LightningError,
4166 }
4167 #[repr(C)]
4168 pub struct CResult_RouteLightningErrorZ {
4169         pub contents: CResult_RouteLightningErrorZPtr,
4170         pub result_ok: bool,
4171 }
4172 #[no_mangle]
4173 pub extern "C" fn CResult_RouteLightningErrorZ_ok(o: crate::routing::router::Route) -> CResult_RouteLightningErrorZ {
4174         CResult_RouteLightningErrorZ {
4175                 contents: CResult_RouteLightningErrorZPtr {
4176                         result: Box::into_raw(Box::new(o)),
4177                 },
4178                 result_ok: true,
4179         }
4180 }
4181 #[no_mangle]
4182 pub extern "C" fn CResult_RouteLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_RouteLightningErrorZ {
4183         CResult_RouteLightningErrorZ {
4184                 contents: CResult_RouteLightningErrorZPtr {
4185                         err: Box::into_raw(Box::new(e)),
4186                 },
4187                 result_ok: false,
4188         }
4189 }
4190 #[no_mangle]
4191 pub extern "C" fn CResult_RouteLightningErrorZ_free(_res: CResult_RouteLightningErrorZ) { }
4192 impl Drop for CResult_RouteLightningErrorZ {
4193         fn drop(&mut self) {
4194                 if self.result_ok {
4195                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
4196                                 let _ = unsafe { Box::from_raw(self.contents.result) };
4197                         }
4198                 } else {
4199                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
4200                                 let _ = unsafe { Box::from_raw(self.contents.err) };
4201                         }
4202                 }
4203         }
4204 }
4205 impl From<crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::LightningError>> for CResult_RouteLightningErrorZ {
4206         fn from(mut o: crate::c_types::CResultTempl<crate::routing::router::Route, crate::ln::msgs::LightningError>) -> Self {
4207                 let contents = if o.result_ok {
4208                         let result = unsafe { o.contents.result };
4209                         unsafe { o.contents.result = std::ptr::null_mut() };
4210                         CResult_RouteLightningErrorZPtr { result }
4211                 } else {
4212                         let err = unsafe { o.contents.err };
4213                         unsafe { o.contents.err = std::ptr::null_mut(); }
4214                         CResult_RouteLightningErrorZPtr { err }
4215                 };
4216                 Self {
4217                         contents,
4218                         result_ok: o.result_ok,
4219                 }
4220         }
4221 }
4222 impl Clone for CResult_RouteLightningErrorZ {
4223         fn clone(&self) -> Self {
4224                 if self.result_ok {
4225                         Self { result_ok: true, contents: CResult_RouteLightningErrorZPtr {
4226                                 result: Box::into_raw(Box::new(<crate::routing::router::Route>::clone(unsafe { &*self.contents.result })))
4227                         } }
4228                 } else {
4229                         Self { result_ok: false, contents: CResult_RouteLightningErrorZPtr {
4230                                 err: Box::into_raw(Box::new(<crate::ln::msgs::LightningError>::clone(unsafe { &*self.contents.err })))
4231                         } }
4232                 }
4233         }
4234 }
4235 #[no_mangle]
4236 pub extern "C" fn CResult_RouteLightningErrorZ_clone(orig: &CResult_RouteLightningErrorZ) -> CResult_RouteLightningErrorZ { orig.clone() }
4237 #[repr(C)]
4238 pub union CResult_NetAddressu8ZPtr {
4239         pub result: *mut crate::ln::msgs::NetAddress,
4240         pub err: *mut u8,
4241 }
4242 #[repr(C)]
4243 pub struct CResult_NetAddressu8Z {
4244         pub contents: CResult_NetAddressu8ZPtr,
4245         pub result_ok: bool,
4246 }
4247 #[no_mangle]
4248 pub extern "C" fn CResult_NetAddressu8Z_ok(o: crate::ln::msgs::NetAddress) -> CResult_NetAddressu8Z {
4249         CResult_NetAddressu8Z {
4250                 contents: CResult_NetAddressu8ZPtr {
4251                         result: Box::into_raw(Box::new(o)),
4252                 },
4253                 result_ok: true,
4254         }
4255 }
4256 #[no_mangle]
4257 pub extern "C" fn CResult_NetAddressu8Z_err(e: u8) -> CResult_NetAddressu8Z {
4258         CResult_NetAddressu8Z {
4259                 contents: CResult_NetAddressu8ZPtr {
4260                         err: Box::into_raw(Box::new(e)),
4261                 },
4262                 result_ok: false,
4263         }
4264 }
4265 #[no_mangle]
4266 pub extern "C" fn CResult_NetAddressu8Z_free(_res: CResult_NetAddressu8Z) { }
4267 impl Drop for CResult_NetAddressu8Z {
4268         fn drop(&mut self) {
4269                 if self.result_ok {
4270                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
4271                                 let _ = unsafe { Box::from_raw(self.contents.result) };
4272                         }
4273                 } else {
4274                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
4275                                 let _ = unsafe { Box::from_raw(self.contents.err) };
4276                         }
4277                 }
4278         }
4279 }
4280 impl From<crate::c_types::CResultTempl<crate::ln::msgs::NetAddress, u8>> for CResult_NetAddressu8Z {
4281         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::NetAddress, u8>) -> Self {
4282                 let contents = if o.result_ok {
4283                         let result = unsafe { o.contents.result };
4284                         unsafe { o.contents.result = std::ptr::null_mut() };
4285                         CResult_NetAddressu8ZPtr { result }
4286                 } else {
4287                         let err = unsafe { o.contents.err };
4288                         unsafe { o.contents.err = std::ptr::null_mut(); }
4289                         CResult_NetAddressu8ZPtr { err }
4290                 };
4291                 Self {
4292                         contents,
4293                         result_ok: o.result_ok,
4294                 }
4295         }
4296 }
4297 impl Clone for CResult_NetAddressu8Z {
4298         fn clone(&self) -> Self {
4299                 if self.result_ok {
4300                         Self { result_ok: true, contents: CResult_NetAddressu8ZPtr {
4301                                 result: Box::into_raw(Box::new(<crate::ln::msgs::NetAddress>::clone(unsafe { &*self.contents.result })))
4302                         } }
4303                 } else {
4304                         Self { result_ok: false, contents: CResult_NetAddressu8ZPtr {
4305                                 err: Box::into_raw(Box::new(<u8>::clone(unsafe { &*self.contents.err })))
4306                         } }
4307                 }
4308         }
4309 }
4310 #[no_mangle]
4311 pub extern "C" fn CResult_NetAddressu8Z_clone(orig: &CResult_NetAddressu8Z) -> CResult_NetAddressu8Z { orig.clone() }
4312 #[repr(C)]
4313 pub union CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4314         pub result: *mut crate::c_types::derived::CResult_NetAddressu8Z,
4315         pub err: *mut crate::ln::msgs::DecodeError,
4316 }
4317 #[repr(C)]
4318 pub struct CResult_CResult_NetAddressu8ZDecodeErrorZ {
4319         pub contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr,
4320         pub result_ok: bool,
4321 }
4322 #[no_mangle]
4323 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o: crate::c_types::derived::CResult_NetAddressu8Z) -> CResult_CResult_NetAddressu8ZDecodeErrorZ {
4324         CResult_CResult_NetAddressu8ZDecodeErrorZ {
4325                 contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4326                         result: Box::into_raw(Box::new(o)),
4327                 },
4328                 result_ok: true,
4329         }
4330 }
4331 #[no_mangle]
4332 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CResult_NetAddressu8ZDecodeErrorZ {
4333         CResult_CResult_NetAddressu8ZDecodeErrorZ {
4334                 contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4335                         err: Box::into_raw(Box::new(e)),
4336                 },
4337                 result_ok: false,
4338         }
4339 }
4340 #[no_mangle]
4341 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res: CResult_CResult_NetAddressu8ZDecodeErrorZ) { }
4342 impl Drop for CResult_CResult_NetAddressu8ZDecodeErrorZ {
4343         fn drop(&mut self) {
4344                 if self.result_ok {
4345                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
4346                                 let _ = unsafe { Box::from_raw(self.contents.result) };
4347                         }
4348                 } else {
4349                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
4350                                 let _ = unsafe { Box::from_raw(self.contents.err) };
4351                         }
4352                 }
4353         }
4354 }
4355 impl From<crate::c_types::CResultTempl<crate::c_types::derived::CResult_NetAddressu8Z, crate::ln::msgs::DecodeError>> for CResult_CResult_NetAddressu8ZDecodeErrorZ {
4356         fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CResult_NetAddressu8Z, crate::ln::msgs::DecodeError>) -> Self {
4357                 let contents = if o.result_ok {
4358                         let result = unsafe { o.contents.result };
4359                         unsafe { o.contents.result = std::ptr::null_mut() };
4360                         CResult_CResult_NetAddressu8ZDecodeErrorZPtr { result }
4361                 } else {
4362                         let err = unsafe { o.contents.err };
4363                         unsafe { o.contents.err = std::ptr::null_mut(); }
4364                         CResult_CResult_NetAddressu8ZDecodeErrorZPtr { err }
4365                 };
4366                 Self {
4367                         contents,
4368                         result_ok: o.result_ok,
4369                 }
4370         }
4371 }
4372 impl Clone for CResult_CResult_NetAddressu8ZDecodeErrorZ {
4373         fn clone(&self) -> Self {
4374                 if self.result_ok {
4375                         Self { result_ok: true, contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4376                                 result: Box::into_raw(Box::new(<crate::c_types::derived::CResult_NetAddressu8Z>::clone(unsafe { &*self.contents.result })))
4377                         } }
4378                 } else {
4379                         Self { result_ok: false, contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4380                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4381                         } }
4382                 }
4383         }
4384 }
4385 #[no_mangle]
4386 pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig: &CResult_CResult_NetAddressu8ZDecodeErrorZ) -> CResult_CResult_NetAddressu8ZDecodeErrorZ { orig.clone() }
4387 #[repr(C)]
4388 pub struct CVec_UpdateAddHTLCZ {
4389         pub data: *mut crate::ln::msgs::UpdateAddHTLC,
4390         pub datalen: usize
4391 }
4392 impl CVec_UpdateAddHTLCZ {
4393         #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateAddHTLC> {
4394                 if self.datalen == 0 { return Vec::new(); }
4395                 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4396                 self.data = std::ptr::null_mut();
4397                 self.datalen = 0;
4398                 ret
4399         }
4400         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateAddHTLC] {
4401                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4402         }
4403 }
4404 impl From<Vec<crate::ln::msgs::UpdateAddHTLC>> for CVec_UpdateAddHTLCZ {
4405         fn from(v: Vec<crate::ln::msgs::UpdateAddHTLC>) -> Self {
4406                 let datalen = v.len();
4407                 let data = Box::into_raw(v.into_boxed_slice());
4408                 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4409         }
4410 }
4411 #[no_mangle]
4412 pub extern "C" fn CVec_UpdateAddHTLCZ_free(_res: CVec_UpdateAddHTLCZ) { }
4413 impl Drop for CVec_UpdateAddHTLCZ {
4414         fn drop(&mut self) {
4415                 if self.datalen == 0 { return; }
4416                 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4417         }
4418 }
4419 impl Clone for CVec_UpdateAddHTLCZ {
4420         fn clone(&self) -> Self {
4421                 let mut res = Vec::new();
4422                 if self.datalen == 0 { return Self::from(res); }
4423                 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4424                 Self::from(res)
4425         }
4426 }
4427 #[repr(C)]
4428 pub struct CVec_UpdateFulfillHTLCZ {
4429         pub data: *mut crate::ln::msgs::UpdateFulfillHTLC,
4430         pub datalen: usize
4431 }
4432 impl CVec_UpdateFulfillHTLCZ {
4433         #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateFulfillHTLC> {
4434                 if self.datalen == 0 { return Vec::new(); }
4435                 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4436                 self.data = std::ptr::null_mut();
4437                 self.datalen = 0;
4438                 ret
4439         }
4440         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateFulfillHTLC] {
4441                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4442         }
4443 }
4444 impl From<Vec<crate::ln::msgs::UpdateFulfillHTLC>> for CVec_UpdateFulfillHTLCZ {
4445         fn from(v: Vec<crate::ln::msgs::UpdateFulfillHTLC>) -> Self {
4446                 let datalen = v.len();
4447                 let data = Box::into_raw(v.into_boxed_slice());
4448                 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4449         }
4450 }
4451 #[no_mangle]
4452 pub extern "C" fn CVec_UpdateFulfillHTLCZ_free(_res: CVec_UpdateFulfillHTLCZ) { }
4453 impl Drop for CVec_UpdateFulfillHTLCZ {
4454         fn drop(&mut self) {
4455                 if self.datalen == 0 { return; }
4456                 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4457         }
4458 }
4459 impl Clone for CVec_UpdateFulfillHTLCZ {
4460         fn clone(&self) -> Self {
4461                 let mut res = Vec::new();
4462                 if self.datalen == 0 { return Self::from(res); }
4463                 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4464                 Self::from(res)
4465         }
4466 }
4467 #[repr(C)]
4468 pub struct CVec_UpdateFailHTLCZ {
4469         pub data: *mut crate::ln::msgs::UpdateFailHTLC,
4470         pub datalen: usize
4471 }
4472 impl CVec_UpdateFailHTLCZ {
4473         #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateFailHTLC> {
4474                 if self.datalen == 0 { return Vec::new(); }
4475                 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4476                 self.data = std::ptr::null_mut();
4477                 self.datalen = 0;
4478                 ret
4479         }
4480         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateFailHTLC] {
4481                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4482         }
4483 }
4484 impl From<Vec<crate::ln::msgs::UpdateFailHTLC>> for CVec_UpdateFailHTLCZ {
4485         fn from(v: Vec<crate::ln::msgs::UpdateFailHTLC>) -> Self {
4486                 let datalen = v.len();
4487                 let data = Box::into_raw(v.into_boxed_slice());
4488                 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4489         }
4490 }
4491 #[no_mangle]
4492 pub extern "C" fn CVec_UpdateFailHTLCZ_free(_res: CVec_UpdateFailHTLCZ) { }
4493 impl Drop for CVec_UpdateFailHTLCZ {
4494         fn drop(&mut self) {
4495                 if self.datalen == 0 { return; }
4496                 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4497         }
4498 }
4499 impl Clone for CVec_UpdateFailHTLCZ {
4500         fn clone(&self) -> Self {
4501                 let mut res = Vec::new();
4502                 if self.datalen == 0 { return Self::from(res); }
4503                 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4504                 Self::from(res)
4505         }
4506 }
4507 #[repr(C)]
4508 pub struct CVec_UpdateFailMalformedHTLCZ {
4509         pub data: *mut crate::ln::msgs::UpdateFailMalformedHTLC,
4510         pub datalen: usize
4511 }
4512 impl CVec_UpdateFailMalformedHTLCZ {
4513         #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::ln::msgs::UpdateFailMalformedHTLC> {
4514                 if self.datalen == 0 { return Vec::new(); }
4515                 let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
4516                 self.data = std::ptr::null_mut();
4517                 self.datalen = 0;
4518                 ret
4519         }
4520         #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::UpdateFailMalformedHTLC] {
4521                 unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
4522         }
4523 }
4524 impl From<Vec<crate::ln::msgs::UpdateFailMalformedHTLC>> for CVec_UpdateFailMalformedHTLCZ {
4525         fn from(v: Vec<crate::ln::msgs::UpdateFailMalformedHTLC>) -> Self {
4526                 let datalen = v.len();
4527                 let data = Box::into_raw(v.into_boxed_slice());
4528                 Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
4529         }
4530 }
4531 #[no_mangle]
4532 pub extern "C" fn CVec_UpdateFailMalformedHTLCZ_free(_res: CVec_UpdateFailMalformedHTLCZ) { }
4533 impl Drop for CVec_UpdateFailMalformedHTLCZ {
4534         fn drop(&mut self) {
4535                 if self.datalen == 0 { return; }
4536                 unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
4537         }
4538 }
4539 impl Clone for CVec_UpdateFailMalformedHTLCZ {
4540         fn clone(&self) -> Self {
4541                 let mut res = Vec::new();
4542                 if self.datalen == 0 { return Self::from(res); }
4543                 res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) });
4544                 Self::from(res)
4545         }
4546 }
4547 #[repr(C)]
4548 pub union CResult_AcceptChannelDecodeErrorZPtr {
4549         pub result: *mut crate::ln::msgs::AcceptChannel,
4550         pub err: *mut crate::ln::msgs::DecodeError,
4551 }
4552 #[repr(C)]
4553 pub struct CResult_AcceptChannelDecodeErrorZ {
4554         pub contents: CResult_AcceptChannelDecodeErrorZPtr,
4555         pub result_ok: bool,
4556 }
4557 #[no_mangle]
4558 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_ok(o: crate::ln::msgs::AcceptChannel) -> CResult_AcceptChannelDecodeErrorZ {
4559         CResult_AcceptChannelDecodeErrorZ {
4560                 contents: CResult_AcceptChannelDecodeErrorZPtr {
4561                         result: Box::into_raw(Box::new(o)),
4562                 },
4563                 result_ok: true,
4564         }
4565 }
4566 #[no_mangle]
4567 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_AcceptChannelDecodeErrorZ {
4568         CResult_AcceptChannelDecodeErrorZ {
4569                 contents: CResult_AcceptChannelDecodeErrorZPtr {
4570                         err: Box::into_raw(Box::new(e)),
4571                 },
4572                 result_ok: false,
4573         }
4574 }
4575 #[no_mangle]
4576 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_free(_res: CResult_AcceptChannelDecodeErrorZ) { }
4577 impl Drop for CResult_AcceptChannelDecodeErrorZ {
4578         fn drop(&mut self) {
4579                 if self.result_ok {
4580                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
4581                                 let _ = unsafe { Box::from_raw(self.contents.result) };
4582                         }
4583                 } else {
4584                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
4585                                 let _ = unsafe { Box::from_raw(self.contents.err) };
4586                         }
4587                 }
4588         }
4589 }
4590 impl From<crate::c_types::CResultTempl<crate::ln::msgs::AcceptChannel, crate::ln::msgs::DecodeError>> for CResult_AcceptChannelDecodeErrorZ {
4591         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::AcceptChannel, crate::ln::msgs::DecodeError>) -> Self {
4592                 let contents = if o.result_ok {
4593                         let result = unsafe { o.contents.result };
4594                         unsafe { o.contents.result = std::ptr::null_mut() };
4595                         CResult_AcceptChannelDecodeErrorZPtr { result }
4596                 } else {
4597                         let err = unsafe { o.contents.err };
4598                         unsafe { o.contents.err = std::ptr::null_mut(); }
4599                         CResult_AcceptChannelDecodeErrorZPtr { err }
4600                 };
4601                 Self {
4602                         contents,
4603                         result_ok: o.result_ok,
4604                 }
4605         }
4606 }
4607 impl Clone for CResult_AcceptChannelDecodeErrorZ {
4608         fn clone(&self) -> Self {
4609                 if self.result_ok {
4610                         Self { result_ok: true, contents: CResult_AcceptChannelDecodeErrorZPtr {
4611                                 result: Box::into_raw(Box::new(<crate::ln::msgs::AcceptChannel>::clone(unsafe { &*self.contents.result })))
4612                         } }
4613                 } else {
4614                         Self { result_ok: false, contents: CResult_AcceptChannelDecodeErrorZPtr {
4615                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4616                         } }
4617                 }
4618         }
4619 }
4620 #[no_mangle]
4621 pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_clone(orig: &CResult_AcceptChannelDecodeErrorZ) -> CResult_AcceptChannelDecodeErrorZ { orig.clone() }
4622 #[repr(C)]
4623 pub union CResult_AnnouncementSignaturesDecodeErrorZPtr {
4624         pub result: *mut crate::ln::msgs::AnnouncementSignatures,
4625         pub err: *mut crate::ln::msgs::DecodeError,
4626 }
4627 #[repr(C)]
4628 pub struct CResult_AnnouncementSignaturesDecodeErrorZ {
4629         pub contents: CResult_AnnouncementSignaturesDecodeErrorZPtr,
4630         pub result_ok: bool,
4631 }
4632 #[no_mangle]
4633 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_ok(o: crate::ln::msgs::AnnouncementSignatures) -> CResult_AnnouncementSignaturesDecodeErrorZ {
4634         CResult_AnnouncementSignaturesDecodeErrorZ {
4635                 contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4636                         result: Box::into_raw(Box::new(o)),
4637                 },
4638                 result_ok: true,
4639         }
4640 }
4641 #[no_mangle]
4642 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_AnnouncementSignaturesDecodeErrorZ {
4643         CResult_AnnouncementSignaturesDecodeErrorZ {
4644                 contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4645                         err: Box::into_raw(Box::new(e)),
4646                 },
4647                 result_ok: false,
4648         }
4649 }
4650 #[no_mangle]
4651 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_free(_res: CResult_AnnouncementSignaturesDecodeErrorZ) { }
4652 impl Drop for CResult_AnnouncementSignaturesDecodeErrorZ {
4653         fn drop(&mut self) {
4654                 if self.result_ok {
4655                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
4656                                 let _ = unsafe { Box::from_raw(self.contents.result) };
4657                         }
4658                 } else {
4659                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
4660                                 let _ = unsafe { Box::from_raw(self.contents.err) };
4661                         }
4662                 }
4663         }
4664 }
4665 impl From<crate::c_types::CResultTempl<crate::ln::msgs::AnnouncementSignatures, crate::ln::msgs::DecodeError>> for CResult_AnnouncementSignaturesDecodeErrorZ {
4666         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::AnnouncementSignatures, crate::ln::msgs::DecodeError>) -> Self {
4667                 let contents = if o.result_ok {
4668                         let result = unsafe { o.contents.result };
4669                         unsafe { o.contents.result = std::ptr::null_mut() };
4670                         CResult_AnnouncementSignaturesDecodeErrorZPtr { result }
4671                 } else {
4672                         let err = unsafe { o.contents.err };
4673                         unsafe { o.contents.err = std::ptr::null_mut(); }
4674                         CResult_AnnouncementSignaturesDecodeErrorZPtr { err }
4675                 };
4676                 Self {
4677                         contents,
4678                         result_ok: o.result_ok,
4679                 }
4680         }
4681 }
4682 impl Clone for CResult_AnnouncementSignaturesDecodeErrorZ {
4683         fn clone(&self) -> Self {
4684                 if self.result_ok {
4685                         Self { result_ok: true, contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4686                                 result: Box::into_raw(Box::new(<crate::ln::msgs::AnnouncementSignatures>::clone(unsafe { &*self.contents.result })))
4687                         } }
4688                 } else {
4689                         Self { result_ok: false, contents: CResult_AnnouncementSignaturesDecodeErrorZPtr {
4690                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4691                         } }
4692                 }
4693         }
4694 }
4695 #[no_mangle]
4696 pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig: &CResult_AnnouncementSignaturesDecodeErrorZ) -> CResult_AnnouncementSignaturesDecodeErrorZ { orig.clone() }
4697 #[repr(C)]
4698 pub union CResult_ChannelReestablishDecodeErrorZPtr {
4699         pub result: *mut crate::ln::msgs::ChannelReestablish,
4700         pub err: *mut crate::ln::msgs::DecodeError,
4701 }
4702 #[repr(C)]
4703 pub struct CResult_ChannelReestablishDecodeErrorZ {
4704         pub contents: CResult_ChannelReestablishDecodeErrorZPtr,
4705         pub result_ok: bool,
4706 }
4707 #[no_mangle]
4708 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_ok(o: crate::ln::msgs::ChannelReestablish) -> CResult_ChannelReestablishDecodeErrorZ {
4709         CResult_ChannelReestablishDecodeErrorZ {
4710                 contents: CResult_ChannelReestablishDecodeErrorZPtr {
4711                         result: Box::into_raw(Box::new(o)),
4712                 },
4713                 result_ok: true,
4714         }
4715 }
4716 #[no_mangle]
4717 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelReestablishDecodeErrorZ {
4718         CResult_ChannelReestablishDecodeErrorZ {
4719                 contents: CResult_ChannelReestablishDecodeErrorZPtr {
4720                         err: Box::into_raw(Box::new(e)),
4721                 },
4722                 result_ok: false,
4723         }
4724 }
4725 #[no_mangle]
4726 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_free(_res: CResult_ChannelReestablishDecodeErrorZ) { }
4727 impl Drop for CResult_ChannelReestablishDecodeErrorZ {
4728         fn drop(&mut self) {
4729                 if self.result_ok {
4730                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
4731                                 let _ = unsafe { Box::from_raw(self.contents.result) };
4732                         }
4733                 } else {
4734                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
4735                                 let _ = unsafe { Box::from_raw(self.contents.err) };
4736                         }
4737                 }
4738         }
4739 }
4740 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ChannelReestablish, crate::ln::msgs::DecodeError>> for CResult_ChannelReestablishDecodeErrorZ {
4741         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ChannelReestablish, crate::ln::msgs::DecodeError>) -> Self {
4742                 let contents = if o.result_ok {
4743                         let result = unsafe { o.contents.result };
4744                         unsafe { o.contents.result = std::ptr::null_mut() };
4745                         CResult_ChannelReestablishDecodeErrorZPtr { result }
4746                 } else {
4747                         let err = unsafe { o.contents.err };
4748                         unsafe { o.contents.err = std::ptr::null_mut(); }
4749                         CResult_ChannelReestablishDecodeErrorZPtr { err }
4750                 };
4751                 Self {
4752                         contents,
4753                         result_ok: o.result_ok,
4754                 }
4755         }
4756 }
4757 impl Clone for CResult_ChannelReestablishDecodeErrorZ {
4758         fn clone(&self) -> Self {
4759                 if self.result_ok {
4760                         Self { result_ok: true, contents: CResult_ChannelReestablishDecodeErrorZPtr {
4761                                 result: Box::into_raw(Box::new(<crate::ln::msgs::ChannelReestablish>::clone(unsafe { &*self.contents.result })))
4762                         } }
4763                 } else {
4764                         Self { result_ok: false, contents: CResult_ChannelReestablishDecodeErrorZPtr {
4765                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4766                         } }
4767                 }
4768         }
4769 }
4770 #[no_mangle]
4771 pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_clone(orig: &CResult_ChannelReestablishDecodeErrorZ) -> CResult_ChannelReestablishDecodeErrorZ { orig.clone() }
4772 #[repr(C)]
4773 pub union CResult_ClosingSignedDecodeErrorZPtr {
4774         pub result: *mut crate::ln::msgs::ClosingSigned,
4775         pub err: *mut crate::ln::msgs::DecodeError,
4776 }
4777 #[repr(C)]
4778 pub struct CResult_ClosingSignedDecodeErrorZ {
4779         pub contents: CResult_ClosingSignedDecodeErrorZPtr,
4780         pub result_ok: bool,
4781 }
4782 #[no_mangle]
4783 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_ok(o: crate::ln::msgs::ClosingSigned) -> CResult_ClosingSignedDecodeErrorZ {
4784         CResult_ClosingSignedDecodeErrorZ {
4785                 contents: CResult_ClosingSignedDecodeErrorZPtr {
4786                         result: Box::into_raw(Box::new(o)),
4787                 },
4788                 result_ok: true,
4789         }
4790 }
4791 #[no_mangle]
4792 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ClosingSignedDecodeErrorZ {
4793         CResult_ClosingSignedDecodeErrorZ {
4794                 contents: CResult_ClosingSignedDecodeErrorZPtr {
4795                         err: Box::into_raw(Box::new(e)),
4796                 },
4797                 result_ok: false,
4798         }
4799 }
4800 #[no_mangle]
4801 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_free(_res: CResult_ClosingSignedDecodeErrorZ) { }
4802 impl Drop for CResult_ClosingSignedDecodeErrorZ {
4803         fn drop(&mut self) {
4804                 if self.result_ok {
4805                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
4806                                 let _ = unsafe { Box::from_raw(self.contents.result) };
4807                         }
4808                 } else {
4809                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
4810                                 let _ = unsafe { Box::from_raw(self.contents.err) };
4811                         }
4812                 }
4813         }
4814 }
4815 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ClosingSigned, crate::ln::msgs::DecodeError>> for CResult_ClosingSignedDecodeErrorZ {
4816         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ClosingSigned, crate::ln::msgs::DecodeError>) -> Self {
4817                 let contents = if o.result_ok {
4818                         let result = unsafe { o.contents.result };
4819                         unsafe { o.contents.result = std::ptr::null_mut() };
4820                         CResult_ClosingSignedDecodeErrorZPtr { result }
4821                 } else {
4822                         let err = unsafe { o.contents.err };
4823                         unsafe { o.contents.err = std::ptr::null_mut(); }
4824                         CResult_ClosingSignedDecodeErrorZPtr { err }
4825                 };
4826                 Self {
4827                         contents,
4828                         result_ok: o.result_ok,
4829                 }
4830         }
4831 }
4832 impl Clone for CResult_ClosingSignedDecodeErrorZ {
4833         fn clone(&self) -> Self {
4834                 if self.result_ok {
4835                         Self { result_ok: true, contents: CResult_ClosingSignedDecodeErrorZPtr {
4836                                 result: Box::into_raw(Box::new(<crate::ln::msgs::ClosingSigned>::clone(unsafe { &*self.contents.result })))
4837                         } }
4838                 } else {
4839                         Self { result_ok: false, contents: CResult_ClosingSignedDecodeErrorZPtr {
4840                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4841                         } }
4842                 }
4843         }
4844 }
4845 #[no_mangle]
4846 pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_clone(orig: &CResult_ClosingSignedDecodeErrorZ) -> CResult_ClosingSignedDecodeErrorZ { orig.clone() }
4847 #[repr(C)]
4848 pub union CResult_CommitmentSignedDecodeErrorZPtr {
4849         pub result: *mut crate::ln::msgs::CommitmentSigned,
4850         pub err: *mut crate::ln::msgs::DecodeError,
4851 }
4852 #[repr(C)]
4853 pub struct CResult_CommitmentSignedDecodeErrorZ {
4854         pub contents: CResult_CommitmentSignedDecodeErrorZPtr,
4855         pub result_ok: bool,
4856 }
4857 #[no_mangle]
4858 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_ok(o: crate::ln::msgs::CommitmentSigned) -> CResult_CommitmentSignedDecodeErrorZ {
4859         CResult_CommitmentSignedDecodeErrorZ {
4860                 contents: CResult_CommitmentSignedDecodeErrorZPtr {
4861                         result: Box::into_raw(Box::new(o)),
4862                 },
4863                 result_ok: true,
4864         }
4865 }
4866 #[no_mangle]
4867 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CommitmentSignedDecodeErrorZ {
4868         CResult_CommitmentSignedDecodeErrorZ {
4869                 contents: CResult_CommitmentSignedDecodeErrorZPtr {
4870                         err: Box::into_raw(Box::new(e)),
4871                 },
4872                 result_ok: false,
4873         }
4874 }
4875 #[no_mangle]
4876 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_free(_res: CResult_CommitmentSignedDecodeErrorZ) { }
4877 impl Drop for CResult_CommitmentSignedDecodeErrorZ {
4878         fn drop(&mut self) {
4879                 if self.result_ok {
4880                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
4881                                 let _ = unsafe { Box::from_raw(self.contents.result) };
4882                         }
4883                 } else {
4884                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
4885                                 let _ = unsafe { Box::from_raw(self.contents.err) };
4886                         }
4887                 }
4888         }
4889 }
4890 impl From<crate::c_types::CResultTempl<crate::ln::msgs::CommitmentSigned, crate::ln::msgs::DecodeError>> for CResult_CommitmentSignedDecodeErrorZ {
4891         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::CommitmentSigned, crate::ln::msgs::DecodeError>) -> Self {
4892                 let contents = if o.result_ok {
4893                         let result = unsafe { o.contents.result };
4894                         unsafe { o.contents.result = std::ptr::null_mut() };
4895                         CResult_CommitmentSignedDecodeErrorZPtr { result }
4896                 } else {
4897                         let err = unsafe { o.contents.err };
4898                         unsafe { o.contents.err = std::ptr::null_mut(); }
4899                         CResult_CommitmentSignedDecodeErrorZPtr { err }
4900                 };
4901                 Self {
4902                         contents,
4903                         result_ok: o.result_ok,
4904                 }
4905         }
4906 }
4907 impl Clone for CResult_CommitmentSignedDecodeErrorZ {
4908         fn clone(&self) -> Self {
4909                 if self.result_ok {
4910                         Self { result_ok: true, contents: CResult_CommitmentSignedDecodeErrorZPtr {
4911                                 result: Box::into_raw(Box::new(<crate::ln::msgs::CommitmentSigned>::clone(unsafe { &*self.contents.result })))
4912                         } }
4913                 } else {
4914                         Self { result_ok: false, contents: CResult_CommitmentSignedDecodeErrorZPtr {
4915                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4916                         } }
4917                 }
4918         }
4919 }
4920 #[no_mangle]
4921 pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_clone(orig: &CResult_CommitmentSignedDecodeErrorZ) -> CResult_CommitmentSignedDecodeErrorZ { orig.clone() }
4922 #[repr(C)]
4923 pub union CResult_FundingCreatedDecodeErrorZPtr {
4924         pub result: *mut crate::ln::msgs::FundingCreated,
4925         pub err: *mut crate::ln::msgs::DecodeError,
4926 }
4927 #[repr(C)]
4928 pub struct CResult_FundingCreatedDecodeErrorZ {
4929         pub contents: CResult_FundingCreatedDecodeErrorZPtr,
4930         pub result_ok: bool,
4931 }
4932 #[no_mangle]
4933 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_ok(o: crate::ln::msgs::FundingCreated) -> CResult_FundingCreatedDecodeErrorZ {
4934         CResult_FundingCreatedDecodeErrorZ {
4935                 contents: CResult_FundingCreatedDecodeErrorZPtr {
4936                         result: Box::into_raw(Box::new(o)),
4937                 },
4938                 result_ok: true,
4939         }
4940 }
4941 #[no_mangle]
4942 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingCreatedDecodeErrorZ {
4943         CResult_FundingCreatedDecodeErrorZ {
4944                 contents: CResult_FundingCreatedDecodeErrorZPtr {
4945                         err: Box::into_raw(Box::new(e)),
4946                 },
4947                 result_ok: false,
4948         }
4949 }
4950 #[no_mangle]
4951 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_free(_res: CResult_FundingCreatedDecodeErrorZ) { }
4952 impl Drop for CResult_FundingCreatedDecodeErrorZ {
4953         fn drop(&mut self) {
4954                 if self.result_ok {
4955                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
4956                                 let _ = unsafe { Box::from_raw(self.contents.result) };
4957                         }
4958                 } else {
4959                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
4960                                 let _ = unsafe { Box::from_raw(self.contents.err) };
4961                         }
4962                 }
4963         }
4964 }
4965 impl From<crate::c_types::CResultTempl<crate::ln::msgs::FundingCreated, crate::ln::msgs::DecodeError>> for CResult_FundingCreatedDecodeErrorZ {
4966         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::FundingCreated, crate::ln::msgs::DecodeError>) -> Self {
4967                 let contents = if o.result_ok {
4968                         let result = unsafe { o.contents.result };
4969                         unsafe { o.contents.result = std::ptr::null_mut() };
4970                         CResult_FundingCreatedDecodeErrorZPtr { result }
4971                 } else {
4972                         let err = unsafe { o.contents.err };
4973                         unsafe { o.contents.err = std::ptr::null_mut(); }
4974                         CResult_FundingCreatedDecodeErrorZPtr { err }
4975                 };
4976                 Self {
4977                         contents,
4978                         result_ok: o.result_ok,
4979                 }
4980         }
4981 }
4982 impl Clone for CResult_FundingCreatedDecodeErrorZ {
4983         fn clone(&self) -> Self {
4984                 if self.result_ok {
4985                         Self { result_ok: true, contents: CResult_FundingCreatedDecodeErrorZPtr {
4986                                 result: Box::into_raw(Box::new(<crate::ln::msgs::FundingCreated>::clone(unsafe { &*self.contents.result })))
4987                         } }
4988                 } else {
4989                         Self { result_ok: false, contents: CResult_FundingCreatedDecodeErrorZPtr {
4990                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
4991                         } }
4992                 }
4993         }
4994 }
4995 #[no_mangle]
4996 pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_clone(orig: &CResult_FundingCreatedDecodeErrorZ) -> CResult_FundingCreatedDecodeErrorZ { orig.clone() }
4997 #[repr(C)]
4998 pub union CResult_FundingSignedDecodeErrorZPtr {
4999         pub result: *mut crate::ln::msgs::FundingSigned,
5000         pub err: *mut crate::ln::msgs::DecodeError,
5001 }
5002 #[repr(C)]
5003 pub struct CResult_FundingSignedDecodeErrorZ {
5004         pub contents: CResult_FundingSignedDecodeErrorZPtr,
5005         pub result_ok: bool,
5006 }
5007 #[no_mangle]
5008 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_ok(o: crate::ln::msgs::FundingSigned) -> CResult_FundingSignedDecodeErrorZ {
5009         CResult_FundingSignedDecodeErrorZ {
5010                 contents: CResult_FundingSignedDecodeErrorZPtr {
5011                         result: Box::into_raw(Box::new(o)),
5012                 },
5013                 result_ok: true,
5014         }
5015 }
5016 #[no_mangle]
5017 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingSignedDecodeErrorZ {
5018         CResult_FundingSignedDecodeErrorZ {
5019                 contents: CResult_FundingSignedDecodeErrorZPtr {
5020                         err: Box::into_raw(Box::new(e)),
5021                 },
5022                 result_ok: false,
5023         }
5024 }
5025 #[no_mangle]
5026 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_free(_res: CResult_FundingSignedDecodeErrorZ) { }
5027 impl Drop for CResult_FundingSignedDecodeErrorZ {
5028         fn drop(&mut self) {
5029                 if self.result_ok {
5030                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5031                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5032                         }
5033                 } else {
5034                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5035                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5036                         }
5037                 }
5038         }
5039 }
5040 impl From<crate::c_types::CResultTempl<crate::ln::msgs::FundingSigned, crate::ln::msgs::DecodeError>> for CResult_FundingSignedDecodeErrorZ {
5041         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::FundingSigned, crate::ln::msgs::DecodeError>) -> Self {
5042                 let contents = if o.result_ok {
5043                         let result = unsafe { o.contents.result };
5044                         unsafe { o.contents.result = std::ptr::null_mut() };
5045                         CResult_FundingSignedDecodeErrorZPtr { result }
5046                 } else {
5047                         let err = unsafe { o.contents.err };
5048                         unsafe { o.contents.err = std::ptr::null_mut(); }
5049                         CResult_FundingSignedDecodeErrorZPtr { err }
5050                 };
5051                 Self {
5052                         contents,
5053                         result_ok: o.result_ok,
5054                 }
5055         }
5056 }
5057 impl Clone for CResult_FundingSignedDecodeErrorZ {
5058         fn clone(&self) -> Self {
5059                 if self.result_ok {
5060                         Self { result_ok: true, contents: CResult_FundingSignedDecodeErrorZPtr {
5061                                 result: Box::into_raw(Box::new(<crate::ln::msgs::FundingSigned>::clone(unsafe { &*self.contents.result })))
5062                         } }
5063                 } else {
5064                         Self { result_ok: false, contents: CResult_FundingSignedDecodeErrorZPtr {
5065                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5066                         } }
5067                 }
5068         }
5069 }
5070 #[no_mangle]
5071 pub extern "C" fn CResult_FundingSignedDecodeErrorZ_clone(orig: &CResult_FundingSignedDecodeErrorZ) -> CResult_FundingSignedDecodeErrorZ { orig.clone() }
5072 #[repr(C)]
5073 pub union CResult_FundingLockedDecodeErrorZPtr {
5074         pub result: *mut crate::ln::msgs::FundingLocked,
5075         pub err: *mut crate::ln::msgs::DecodeError,
5076 }
5077 #[repr(C)]
5078 pub struct CResult_FundingLockedDecodeErrorZ {
5079         pub contents: CResult_FundingLockedDecodeErrorZPtr,
5080         pub result_ok: bool,
5081 }
5082 #[no_mangle]
5083 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_ok(o: crate::ln::msgs::FundingLocked) -> CResult_FundingLockedDecodeErrorZ {
5084         CResult_FundingLockedDecodeErrorZ {
5085                 contents: CResult_FundingLockedDecodeErrorZPtr {
5086                         result: Box::into_raw(Box::new(o)),
5087                 },
5088                 result_ok: true,
5089         }
5090 }
5091 #[no_mangle]
5092 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingLockedDecodeErrorZ {
5093         CResult_FundingLockedDecodeErrorZ {
5094                 contents: CResult_FundingLockedDecodeErrorZPtr {
5095                         err: Box::into_raw(Box::new(e)),
5096                 },
5097                 result_ok: false,
5098         }
5099 }
5100 #[no_mangle]
5101 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_free(_res: CResult_FundingLockedDecodeErrorZ) { }
5102 impl Drop for CResult_FundingLockedDecodeErrorZ {
5103         fn drop(&mut self) {
5104                 if self.result_ok {
5105                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5106                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5107                         }
5108                 } else {
5109                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5110                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5111                         }
5112                 }
5113         }
5114 }
5115 impl From<crate::c_types::CResultTempl<crate::ln::msgs::FundingLocked, crate::ln::msgs::DecodeError>> for CResult_FundingLockedDecodeErrorZ {
5116         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::FundingLocked, crate::ln::msgs::DecodeError>) -> Self {
5117                 let contents = if o.result_ok {
5118                         let result = unsafe { o.contents.result };
5119                         unsafe { o.contents.result = std::ptr::null_mut() };
5120                         CResult_FundingLockedDecodeErrorZPtr { result }
5121                 } else {
5122                         let err = unsafe { o.contents.err };
5123                         unsafe { o.contents.err = std::ptr::null_mut(); }
5124                         CResult_FundingLockedDecodeErrorZPtr { err }
5125                 };
5126                 Self {
5127                         contents,
5128                         result_ok: o.result_ok,
5129                 }
5130         }
5131 }
5132 impl Clone for CResult_FundingLockedDecodeErrorZ {
5133         fn clone(&self) -> Self {
5134                 if self.result_ok {
5135                         Self { result_ok: true, contents: CResult_FundingLockedDecodeErrorZPtr {
5136                                 result: Box::into_raw(Box::new(<crate::ln::msgs::FundingLocked>::clone(unsafe { &*self.contents.result })))
5137                         } }
5138                 } else {
5139                         Self { result_ok: false, contents: CResult_FundingLockedDecodeErrorZPtr {
5140                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5141                         } }
5142                 }
5143         }
5144 }
5145 #[no_mangle]
5146 pub extern "C" fn CResult_FundingLockedDecodeErrorZ_clone(orig: &CResult_FundingLockedDecodeErrorZ) -> CResult_FundingLockedDecodeErrorZ { orig.clone() }
5147 #[repr(C)]
5148 pub union CResult_InitDecodeErrorZPtr {
5149         pub result: *mut crate::ln::msgs::Init,
5150         pub err: *mut crate::ln::msgs::DecodeError,
5151 }
5152 #[repr(C)]
5153 pub struct CResult_InitDecodeErrorZ {
5154         pub contents: CResult_InitDecodeErrorZPtr,
5155         pub result_ok: bool,
5156 }
5157 #[no_mangle]
5158 pub extern "C" fn CResult_InitDecodeErrorZ_ok(o: crate::ln::msgs::Init) -> CResult_InitDecodeErrorZ {
5159         CResult_InitDecodeErrorZ {
5160                 contents: CResult_InitDecodeErrorZPtr {
5161                         result: Box::into_raw(Box::new(o)),
5162                 },
5163                 result_ok: true,
5164         }
5165 }
5166 #[no_mangle]
5167 pub extern "C" fn CResult_InitDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InitDecodeErrorZ {
5168         CResult_InitDecodeErrorZ {
5169                 contents: CResult_InitDecodeErrorZPtr {
5170                         err: Box::into_raw(Box::new(e)),
5171                 },
5172                 result_ok: false,
5173         }
5174 }
5175 #[no_mangle]
5176 pub extern "C" fn CResult_InitDecodeErrorZ_free(_res: CResult_InitDecodeErrorZ) { }
5177 impl Drop for CResult_InitDecodeErrorZ {
5178         fn drop(&mut self) {
5179                 if self.result_ok {
5180                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5181                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5182                         }
5183                 } else {
5184                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5185                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5186                         }
5187                 }
5188         }
5189 }
5190 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Init, crate::ln::msgs::DecodeError>> for CResult_InitDecodeErrorZ {
5191         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Init, crate::ln::msgs::DecodeError>) -> Self {
5192                 let contents = if o.result_ok {
5193                         let result = unsafe { o.contents.result };
5194                         unsafe { o.contents.result = std::ptr::null_mut() };
5195                         CResult_InitDecodeErrorZPtr { result }
5196                 } else {
5197                         let err = unsafe { o.contents.err };
5198                         unsafe { o.contents.err = std::ptr::null_mut(); }
5199                         CResult_InitDecodeErrorZPtr { err }
5200                 };
5201                 Self {
5202                         contents,
5203                         result_ok: o.result_ok,
5204                 }
5205         }
5206 }
5207 impl Clone for CResult_InitDecodeErrorZ {
5208         fn clone(&self) -> Self {
5209                 if self.result_ok {
5210                         Self { result_ok: true, contents: CResult_InitDecodeErrorZPtr {
5211                                 result: Box::into_raw(Box::new(<crate::ln::msgs::Init>::clone(unsafe { &*self.contents.result })))
5212                         } }
5213                 } else {
5214                         Self { result_ok: false, contents: CResult_InitDecodeErrorZPtr {
5215                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5216                         } }
5217                 }
5218         }
5219 }
5220 #[no_mangle]
5221 pub extern "C" fn CResult_InitDecodeErrorZ_clone(orig: &CResult_InitDecodeErrorZ) -> CResult_InitDecodeErrorZ { orig.clone() }
5222 #[repr(C)]
5223 pub union CResult_OpenChannelDecodeErrorZPtr {
5224         pub result: *mut crate::ln::msgs::OpenChannel,
5225         pub err: *mut crate::ln::msgs::DecodeError,
5226 }
5227 #[repr(C)]
5228 pub struct CResult_OpenChannelDecodeErrorZ {
5229         pub contents: CResult_OpenChannelDecodeErrorZPtr,
5230         pub result_ok: bool,
5231 }
5232 #[no_mangle]
5233 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_ok(o: crate::ln::msgs::OpenChannel) -> CResult_OpenChannelDecodeErrorZ {
5234         CResult_OpenChannelDecodeErrorZ {
5235                 contents: CResult_OpenChannelDecodeErrorZPtr {
5236                         result: Box::into_raw(Box::new(o)),
5237                 },
5238                 result_ok: true,
5239         }
5240 }
5241 #[no_mangle]
5242 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_OpenChannelDecodeErrorZ {
5243         CResult_OpenChannelDecodeErrorZ {
5244                 contents: CResult_OpenChannelDecodeErrorZPtr {
5245                         err: Box::into_raw(Box::new(e)),
5246                 },
5247                 result_ok: false,
5248         }
5249 }
5250 #[no_mangle]
5251 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_free(_res: CResult_OpenChannelDecodeErrorZ) { }
5252 impl Drop for CResult_OpenChannelDecodeErrorZ {
5253         fn drop(&mut self) {
5254                 if self.result_ok {
5255                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5256                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5257                         }
5258                 } else {
5259                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5260                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5261                         }
5262                 }
5263         }
5264 }
5265 impl From<crate::c_types::CResultTempl<crate::ln::msgs::OpenChannel, crate::ln::msgs::DecodeError>> for CResult_OpenChannelDecodeErrorZ {
5266         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::OpenChannel, crate::ln::msgs::DecodeError>) -> Self {
5267                 let contents = if o.result_ok {
5268                         let result = unsafe { o.contents.result };
5269                         unsafe { o.contents.result = std::ptr::null_mut() };
5270                         CResult_OpenChannelDecodeErrorZPtr { result }
5271                 } else {
5272                         let err = unsafe { o.contents.err };
5273                         unsafe { o.contents.err = std::ptr::null_mut(); }
5274                         CResult_OpenChannelDecodeErrorZPtr { err }
5275                 };
5276                 Self {
5277                         contents,
5278                         result_ok: o.result_ok,
5279                 }
5280         }
5281 }
5282 impl Clone for CResult_OpenChannelDecodeErrorZ {
5283         fn clone(&self) -> Self {
5284                 if self.result_ok {
5285                         Self { result_ok: true, contents: CResult_OpenChannelDecodeErrorZPtr {
5286                                 result: Box::into_raw(Box::new(<crate::ln::msgs::OpenChannel>::clone(unsafe { &*self.contents.result })))
5287                         } }
5288                 } else {
5289                         Self { result_ok: false, contents: CResult_OpenChannelDecodeErrorZPtr {
5290                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5291                         } }
5292                 }
5293         }
5294 }
5295 #[no_mangle]
5296 pub extern "C" fn CResult_OpenChannelDecodeErrorZ_clone(orig: &CResult_OpenChannelDecodeErrorZ) -> CResult_OpenChannelDecodeErrorZ { orig.clone() }
5297 #[repr(C)]
5298 pub union CResult_RevokeAndACKDecodeErrorZPtr {
5299         pub result: *mut crate::ln::msgs::RevokeAndACK,
5300         pub err: *mut crate::ln::msgs::DecodeError,
5301 }
5302 #[repr(C)]
5303 pub struct CResult_RevokeAndACKDecodeErrorZ {
5304         pub contents: CResult_RevokeAndACKDecodeErrorZPtr,
5305         pub result_ok: bool,
5306 }
5307 #[no_mangle]
5308 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_ok(o: crate::ln::msgs::RevokeAndACK) -> CResult_RevokeAndACKDecodeErrorZ {
5309         CResult_RevokeAndACKDecodeErrorZ {
5310                 contents: CResult_RevokeAndACKDecodeErrorZPtr {
5311                         result: Box::into_raw(Box::new(o)),
5312                 },
5313                 result_ok: true,
5314         }
5315 }
5316 #[no_mangle]
5317 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RevokeAndACKDecodeErrorZ {
5318         CResult_RevokeAndACKDecodeErrorZ {
5319                 contents: CResult_RevokeAndACKDecodeErrorZPtr {
5320                         err: Box::into_raw(Box::new(e)),
5321                 },
5322                 result_ok: false,
5323         }
5324 }
5325 #[no_mangle]
5326 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_free(_res: CResult_RevokeAndACKDecodeErrorZ) { }
5327 impl Drop for CResult_RevokeAndACKDecodeErrorZ {
5328         fn drop(&mut self) {
5329                 if self.result_ok {
5330                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5331                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5332                         }
5333                 } else {
5334                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5335                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5336                         }
5337                 }
5338         }
5339 }
5340 impl From<crate::c_types::CResultTempl<crate::ln::msgs::RevokeAndACK, crate::ln::msgs::DecodeError>> for CResult_RevokeAndACKDecodeErrorZ {
5341         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::RevokeAndACK, crate::ln::msgs::DecodeError>) -> Self {
5342                 let contents = if o.result_ok {
5343                         let result = unsafe { o.contents.result };
5344                         unsafe { o.contents.result = std::ptr::null_mut() };
5345                         CResult_RevokeAndACKDecodeErrorZPtr { result }
5346                 } else {
5347                         let err = unsafe { o.contents.err };
5348                         unsafe { o.contents.err = std::ptr::null_mut(); }
5349                         CResult_RevokeAndACKDecodeErrorZPtr { err }
5350                 };
5351                 Self {
5352                         contents,
5353                         result_ok: o.result_ok,
5354                 }
5355         }
5356 }
5357 impl Clone for CResult_RevokeAndACKDecodeErrorZ {
5358         fn clone(&self) -> Self {
5359                 if self.result_ok {
5360                         Self { result_ok: true, contents: CResult_RevokeAndACKDecodeErrorZPtr {
5361                                 result: Box::into_raw(Box::new(<crate::ln::msgs::RevokeAndACK>::clone(unsafe { &*self.contents.result })))
5362                         } }
5363                 } else {
5364                         Self { result_ok: false, contents: CResult_RevokeAndACKDecodeErrorZPtr {
5365                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5366                         } }
5367                 }
5368         }
5369 }
5370 #[no_mangle]
5371 pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_clone(orig: &CResult_RevokeAndACKDecodeErrorZ) -> CResult_RevokeAndACKDecodeErrorZ { orig.clone() }
5372 #[repr(C)]
5373 pub union CResult_ShutdownDecodeErrorZPtr {
5374         pub result: *mut crate::ln::msgs::Shutdown,
5375         pub err: *mut crate::ln::msgs::DecodeError,
5376 }
5377 #[repr(C)]
5378 pub struct CResult_ShutdownDecodeErrorZ {
5379         pub contents: CResult_ShutdownDecodeErrorZPtr,
5380         pub result_ok: bool,
5381 }
5382 #[no_mangle]
5383 pub extern "C" fn CResult_ShutdownDecodeErrorZ_ok(o: crate::ln::msgs::Shutdown) -> CResult_ShutdownDecodeErrorZ {
5384         CResult_ShutdownDecodeErrorZ {
5385                 contents: CResult_ShutdownDecodeErrorZPtr {
5386                         result: Box::into_raw(Box::new(o)),
5387                 },
5388                 result_ok: true,
5389         }
5390 }
5391 #[no_mangle]
5392 pub extern "C" fn CResult_ShutdownDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ShutdownDecodeErrorZ {
5393         CResult_ShutdownDecodeErrorZ {
5394                 contents: CResult_ShutdownDecodeErrorZPtr {
5395                         err: Box::into_raw(Box::new(e)),
5396                 },
5397                 result_ok: false,
5398         }
5399 }
5400 #[no_mangle]
5401 pub extern "C" fn CResult_ShutdownDecodeErrorZ_free(_res: CResult_ShutdownDecodeErrorZ) { }
5402 impl Drop for CResult_ShutdownDecodeErrorZ {
5403         fn drop(&mut self) {
5404                 if self.result_ok {
5405                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5406                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5407                         }
5408                 } else {
5409                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5410                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5411                         }
5412                 }
5413         }
5414 }
5415 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Shutdown, crate::ln::msgs::DecodeError>> for CResult_ShutdownDecodeErrorZ {
5416         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Shutdown, crate::ln::msgs::DecodeError>) -> Self {
5417                 let contents = if o.result_ok {
5418                         let result = unsafe { o.contents.result };
5419                         unsafe { o.contents.result = std::ptr::null_mut() };
5420                         CResult_ShutdownDecodeErrorZPtr { result }
5421                 } else {
5422                         let err = unsafe { o.contents.err };
5423                         unsafe { o.contents.err = std::ptr::null_mut(); }
5424                         CResult_ShutdownDecodeErrorZPtr { err }
5425                 };
5426                 Self {
5427                         contents,
5428                         result_ok: o.result_ok,
5429                 }
5430         }
5431 }
5432 impl Clone for CResult_ShutdownDecodeErrorZ {
5433         fn clone(&self) -> Self {
5434                 if self.result_ok {
5435                         Self { result_ok: true, contents: CResult_ShutdownDecodeErrorZPtr {
5436                                 result: Box::into_raw(Box::new(<crate::ln::msgs::Shutdown>::clone(unsafe { &*self.contents.result })))
5437                         } }
5438                 } else {
5439                         Self { result_ok: false, contents: CResult_ShutdownDecodeErrorZPtr {
5440                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5441                         } }
5442                 }
5443         }
5444 }
5445 #[no_mangle]
5446 pub extern "C" fn CResult_ShutdownDecodeErrorZ_clone(orig: &CResult_ShutdownDecodeErrorZ) -> CResult_ShutdownDecodeErrorZ { orig.clone() }
5447 #[repr(C)]
5448 pub union CResult_UpdateFailHTLCDecodeErrorZPtr {
5449         pub result: *mut crate::ln::msgs::UpdateFailHTLC,
5450         pub err: *mut crate::ln::msgs::DecodeError,
5451 }
5452 #[repr(C)]
5453 pub struct CResult_UpdateFailHTLCDecodeErrorZ {
5454         pub contents: CResult_UpdateFailHTLCDecodeErrorZPtr,
5455         pub result_ok: bool,
5456 }
5457 #[no_mangle]
5458 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFailHTLC) -> CResult_UpdateFailHTLCDecodeErrorZ {
5459         CResult_UpdateFailHTLCDecodeErrorZ {
5460                 contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5461                         result: Box::into_raw(Box::new(o)),
5462                 },
5463                 result_ok: true,
5464         }
5465 }
5466 #[no_mangle]
5467 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFailHTLCDecodeErrorZ {
5468         CResult_UpdateFailHTLCDecodeErrorZ {
5469                 contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5470                         err: Box::into_raw(Box::new(e)),
5471                 },
5472                 result_ok: false,
5473         }
5474 }
5475 #[no_mangle]
5476 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_free(_res: CResult_UpdateFailHTLCDecodeErrorZ) { }
5477 impl Drop for CResult_UpdateFailHTLCDecodeErrorZ {
5478         fn drop(&mut self) {
5479                 if self.result_ok {
5480                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5481                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5482                         }
5483                 } else {
5484                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5485                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5486                         }
5487                 }
5488         }
5489 }
5490 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateFailHTLCDecodeErrorZ {
5491         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailHTLC, crate::ln::msgs::DecodeError>) -> Self {
5492                 let contents = if o.result_ok {
5493                         let result = unsafe { o.contents.result };
5494                         unsafe { o.contents.result = std::ptr::null_mut() };
5495                         CResult_UpdateFailHTLCDecodeErrorZPtr { result }
5496                 } else {
5497                         let err = unsafe { o.contents.err };
5498                         unsafe { o.contents.err = std::ptr::null_mut(); }
5499                         CResult_UpdateFailHTLCDecodeErrorZPtr { err }
5500                 };
5501                 Self {
5502                         contents,
5503                         result_ok: o.result_ok,
5504                 }
5505         }
5506 }
5507 impl Clone for CResult_UpdateFailHTLCDecodeErrorZ {
5508         fn clone(&self) -> Self {
5509                 if self.result_ok {
5510                         Self { result_ok: true, contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5511                                 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFailHTLC>::clone(unsafe { &*self.contents.result })))
5512                         } }
5513                 } else {
5514                         Self { result_ok: false, contents: CResult_UpdateFailHTLCDecodeErrorZPtr {
5515                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5516                         } }
5517                 }
5518         }
5519 }
5520 #[no_mangle]
5521 pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFailHTLCDecodeErrorZ) -> CResult_UpdateFailHTLCDecodeErrorZ { orig.clone() }
5522 #[repr(C)]
5523 pub union CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5524         pub result: *mut crate::ln::msgs::UpdateFailMalformedHTLC,
5525         pub err: *mut crate::ln::msgs::DecodeError,
5526 }
5527 #[repr(C)]
5528 pub struct CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5529         pub contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr,
5530         pub result_ok: bool,
5531 }
5532 #[no_mangle]
5533 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFailMalformedHTLC) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5534         CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5535                 contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5536                         result: Box::into_raw(Box::new(o)),
5537                 },
5538                 result_ok: true,
5539         }
5540 }
5541 #[no_mangle]
5542 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5543         CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5544                 contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5545                         err: Box::into_raw(Box::new(e)),
5546                 },
5547                 result_ok: false,
5548         }
5549 }
5550 #[no_mangle]
5551 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res: CResult_UpdateFailMalformedHTLCDecodeErrorZ) { }
5552 impl Drop for CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5553         fn drop(&mut self) {
5554                 if self.result_ok {
5555                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5556                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5557                         }
5558                 } else {
5559                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5560                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5561                         }
5562                 }
5563         }
5564 }
5565 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailMalformedHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5566         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFailMalformedHTLC, crate::ln::msgs::DecodeError>) -> Self {
5567                 let contents = if o.result_ok {
5568                         let result = unsafe { o.contents.result };
5569                         unsafe { o.contents.result = std::ptr::null_mut() };
5570                         CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { result }
5571                 } else {
5572                         let err = unsafe { o.contents.err };
5573                         unsafe { o.contents.err = std::ptr::null_mut(); }
5574                         CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { err }
5575                 };
5576                 Self {
5577                         contents,
5578                         result_ok: o.result_ok,
5579                 }
5580         }
5581 }
5582 impl Clone for CResult_UpdateFailMalformedHTLCDecodeErrorZ {
5583         fn clone(&self) -> Self {
5584                 if self.result_ok {
5585                         Self { result_ok: true, contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5586                                 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFailMalformedHTLC>::clone(unsafe { &*self.contents.result })))
5587                         } }
5588                 } else {
5589                         Self { result_ok: false, contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5590                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5591                         } }
5592                 }
5593         }
5594 }
5595 #[no_mangle]
5596 pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFailMalformedHTLCDecodeErrorZ) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ { orig.clone() }
5597 #[repr(C)]
5598 pub union CResult_UpdateFeeDecodeErrorZPtr {
5599         pub result: *mut crate::ln::msgs::UpdateFee,
5600         pub err: *mut crate::ln::msgs::DecodeError,
5601 }
5602 #[repr(C)]
5603 pub struct CResult_UpdateFeeDecodeErrorZ {
5604         pub contents: CResult_UpdateFeeDecodeErrorZPtr,
5605         pub result_ok: bool,
5606 }
5607 #[no_mangle]
5608 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFee) -> CResult_UpdateFeeDecodeErrorZ {
5609         CResult_UpdateFeeDecodeErrorZ {
5610                 contents: CResult_UpdateFeeDecodeErrorZPtr {
5611                         result: Box::into_raw(Box::new(o)),
5612                 },
5613                 result_ok: true,
5614         }
5615 }
5616 #[no_mangle]
5617 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFeeDecodeErrorZ {
5618         CResult_UpdateFeeDecodeErrorZ {
5619                 contents: CResult_UpdateFeeDecodeErrorZPtr {
5620                         err: Box::into_raw(Box::new(e)),
5621                 },
5622                 result_ok: false,
5623         }
5624 }
5625 #[no_mangle]
5626 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_free(_res: CResult_UpdateFeeDecodeErrorZ) { }
5627 impl Drop for CResult_UpdateFeeDecodeErrorZ {
5628         fn drop(&mut self) {
5629                 if self.result_ok {
5630                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5631                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5632                         }
5633                 } else {
5634                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5635                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5636                         }
5637                 }
5638         }
5639 }
5640 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFee, crate::ln::msgs::DecodeError>> for CResult_UpdateFeeDecodeErrorZ {
5641         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFee, crate::ln::msgs::DecodeError>) -> Self {
5642                 let contents = if o.result_ok {
5643                         let result = unsafe { o.contents.result };
5644                         unsafe { o.contents.result = std::ptr::null_mut() };
5645                         CResult_UpdateFeeDecodeErrorZPtr { result }
5646                 } else {
5647                         let err = unsafe { o.contents.err };
5648                         unsafe { o.contents.err = std::ptr::null_mut(); }
5649                         CResult_UpdateFeeDecodeErrorZPtr { err }
5650                 };
5651                 Self {
5652                         contents,
5653                         result_ok: o.result_ok,
5654                 }
5655         }
5656 }
5657 impl Clone for CResult_UpdateFeeDecodeErrorZ {
5658         fn clone(&self) -> Self {
5659                 if self.result_ok {
5660                         Self { result_ok: true, contents: CResult_UpdateFeeDecodeErrorZPtr {
5661                                 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFee>::clone(unsafe { &*self.contents.result })))
5662                         } }
5663                 } else {
5664                         Self { result_ok: false, contents: CResult_UpdateFeeDecodeErrorZPtr {
5665                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5666                         } }
5667                 }
5668         }
5669 }
5670 #[no_mangle]
5671 pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_clone(orig: &CResult_UpdateFeeDecodeErrorZ) -> CResult_UpdateFeeDecodeErrorZ { orig.clone() }
5672 #[repr(C)]
5673 pub union CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5674         pub result: *mut crate::ln::msgs::UpdateFulfillHTLC,
5675         pub err: *mut crate::ln::msgs::DecodeError,
5676 }
5677 #[repr(C)]
5678 pub struct CResult_UpdateFulfillHTLCDecodeErrorZ {
5679         pub contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr,
5680         pub result_ok: bool,
5681 }
5682 #[no_mangle]
5683 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFulfillHTLC) -> CResult_UpdateFulfillHTLCDecodeErrorZ {
5684         CResult_UpdateFulfillHTLCDecodeErrorZ {
5685                 contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5686                         result: Box::into_raw(Box::new(o)),
5687                 },
5688                 result_ok: true,
5689         }
5690 }
5691 #[no_mangle]
5692 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFulfillHTLCDecodeErrorZ {
5693         CResult_UpdateFulfillHTLCDecodeErrorZ {
5694                 contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5695                         err: Box::into_raw(Box::new(e)),
5696                 },
5697                 result_ok: false,
5698         }
5699 }
5700 #[no_mangle]
5701 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res: CResult_UpdateFulfillHTLCDecodeErrorZ) { }
5702 impl Drop for CResult_UpdateFulfillHTLCDecodeErrorZ {
5703         fn drop(&mut self) {
5704                 if self.result_ok {
5705                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5706                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5707                         }
5708                 } else {
5709                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5710                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5711                         }
5712                 }
5713         }
5714 }
5715 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateFulfillHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateFulfillHTLCDecodeErrorZ {
5716         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateFulfillHTLC, crate::ln::msgs::DecodeError>) -> Self {
5717                 let contents = if o.result_ok {
5718                         let result = unsafe { o.contents.result };
5719                         unsafe { o.contents.result = std::ptr::null_mut() };
5720                         CResult_UpdateFulfillHTLCDecodeErrorZPtr { result }
5721                 } else {
5722                         let err = unsafe { o.contents.err };
5723                         unsafe { o.contents.err = std::ptr::null_mut(); }
5724                         CResult_UpdateFulfillHTLCDecodeErrorZPtr { err }
5725                 };
5726                 Self {
5727                         contents,
5728                         result_ok: o.result_ok,
5729                 }
5730         }
5731 }
5732 impl Clone for CResult_UpdateFulfillHTLCDecodeErrorZ {
5733         fn clone(&self) -> Self {
5734                 if self.result_ok {
5735                         Self { result_ok: true, contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5736                                 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateFulfillHTLC>::clone(unsafe { &*self.contents.result })))
5737                         } }
5738                 } else {
5739                         Self { result_ok: false, contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr {
5740                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5741                         } }
5742                 }
5743         }
5744 }
5745 #[no_mangle]
5746 pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFulfillHTLCDecodeErrorZ) -> CResult_UpdateFulfillHTLCDecodeErrorZ { orig.clone() }
5747 #[repr(C)]
5748 pub union CResult_UpdateAddHTLCDecodeErrorZPtr {
5749         pub result: *mut crate::ln::msgs::UpdateAddHTLC,
5750         pub err: *mut crate::ln::msgs::DecodeError,
5751 }
5752 #[repr(C)]
5753 pub struct CResult_UpdateAddHTLCDecodeErrorZ {
5754         pub contents: CResult_UpdateAddHTLCDecodeErrorZPtr,
5755         pub result_ok: bool,
5756 }
5757 #[no_mangle]
5758 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateAddHTLC) -> CResult_UpdateAddHTLCDecodeErrorZ {
5759         CResult_UpdateAddHTLCDecodeErrorZ {
5760                 contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
5761                         result: Box::into_raw(Box::new(o)),
5762                 },
5763                 result_ok: true,
5764         }
5765 }
5766 #[no_mangle]
5767 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateAddHTLCDecodeErrorZ {
5768         CResult_UpdateAddHTLCDecodeErrorZ {
5769                 contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
5770                         err: Box::into_raw(Box::new(e)),
5771                 },
5772                 result_ok: false,
5773         }
5774 }
5775 #[no_mangle]
5776 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_free(_res: CResult_UpdateAddHTLCDecodeErrorZ) { }
5777 impl Drop for CResult_UpdateAddHTLCDecodeErrorZ {
5778         fn drop(&mut self) {
5779                 if self.result_ok {
5780                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5781                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5782                         }
5783                 } else {
5784                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5785                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5786                         }
5787                 }
5788         }
5789 }
5790 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UpdateAddHTLC, crate::ln::msgs::DecodeError>> for CResult_UpdateAddHTLCDecodeErrorZ {
5791         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UpdateAddHTLC, crate::ln::msgs::DecodeError>) -> Self {
5792                 let contents = if o.result_ok {
5793                         let result = unsafe { o.contents.result };
5794                         unsafe { o.contents.result = std::ptr::null_mut() };
5795                         CResult_UpdateAddHTLCDecodeErrorZPtr { result }
5796                 } else {
5797                         let err = unsafe { o.contents.err };
5798                         unsafe { o.contents.err = std::ptr::null_mut(); }
5799                         CResult_UpdateAddHTLCDecodeErrorZPtr { err }
5800                 };
5801                 Self {
5802                         contents,
5803                         result_ok: o.result_ok,
5804                 }
5805         }
5806 }
5807 impl Clone for CResult_UpdateAddHTLCDecodeErrorZ {
5808         fn clone(&self) -> Self {
5809                 if self.result_ok {
5810                         Self { result_ok: true, contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
5811                                 result: Box::into_raw(Box::new(<crate::ln::msgs::UpdateAddHTLC>::clone(unsafe { &*self.contents.result })))
5812                         } }
5813                 } else {
5814                         Self { result_ok: false, contents: CResult_UpdateAddHTLCDecodeErrorZPtr {
5815                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5816                         } }
5817                 }
5818         }
5819 }
5820 #[no_mangle]
5821 pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_clone(orig: &CResult_UpdateAddHTLCDecodeErrorZ) -> CResult_UpdateAddHTLCDecodeErrorZ { orig.clone() }
5822 #[repr(C)]
5823 pub union CResult_PingDecodeErrorZPtr {
5824         pub result: *mut crate::ln::msgs::Ping,
5825         pub err: *mut crate::ln::msgs::DecodeError,
5826 }
5827 #[repr(C)]
5828 pub struct CResult_PingDecodeErrorZ {
5829         pub contents: CResult_PingDecodeErrorZPtr,
5830         pub result_ok: bool,
5831 }
5832 #[no_mangle]
5833 pub extern "C" fn CResult_PingDecodeErrorZ_ok(o: crate::ln::msgs::Ping) -> CResult_PingDecodeErrorZ {
5834         CResult_PingDecodeErrorZ {
5835                 contents: CResult_PingDecodeErrorZPtr {
5836                         result: Box::into_raw(Box::new(o)),
5837                 },
5838                 result_ok: true,
5839         }
5840 }
5841 #[no_mangle]
5842 pub extern "C" fn CResult_PingDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_PingDecodeErrorZ {
5843         CResult_PingDecodeErrorZ {
5844                 contents: CResult_PingDecodeErrorZPtr {
5845                         err: Box::into_raw(Box::new(e)),
5846                 },
5847                 result_ok: false,
5848         }
5849 }
5850 #[no_mangle]
5851 pub extern "C" fn CResult_PingDecodeErrorZ_free(_res: CResult_PingDecodeErrorZ) { }
5852 impl Drop for CResult_PingDecodeErrorZ {
5853         fn drop(&mut self) {
5854                 if self.result_ok {
5855                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5856                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5857                         }
5858                 } else {
5859                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5860                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5861                         }
5862                 }
5863         }
5864 }
5865 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Ping, crate::ln::msgs::DecodeError>> for CResult_PingDecodeErrorZ {
5866         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Ping, crate::ln::msgs::DecodeError>) -> Self {
5867                 let contents = if o.result_ok {
5868                         let result = unsafe { o.contents.result };
5869                         unsafe { o.contents.result = std::ptr::null_mut() };
5870                         CResult_PingDecodeErrorZPtr { result }
5871                 } else {
5872                         let err = unsafe { o.contents.err };
5873                         unsafe { o.contents.err = std::ptr::null_mut(); }
5874                         CResult_PingDecodeErrorZPtr { err }
5875                 };
5876                 Self {
5877                         contents,
5878                         result_ok: o.result_ok,
5879                 }
5880         }
5881 }
5882 impl Clone for CResult_PingDecodeErrorZ {
5883         fn clone(&self) -> Self {
5884                 if self.result_ok {
5885                         Self { result_ok: true, contents: CResult_PingDecodeErrorZPtr {
5886                                 result: Box::into_raw(Box::new(<crate::ln::msgs::Ping>::clone(unsafe { &*self.contents.result })))
5887                         } }
5888                 } else {
5889                         Self { result_ok: false, contents: CResult_PingDecodeErrorZPtr {
5890                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5891                         } }
5892                 }
5893         }
5894 }
5895 #[no_mangle]
5896 pub extern "C" fn CResult_PingDecodeErrorZ_clone(orig: &CResult_PingDecodeErrorZ) -> CResult_PingDecodeErrorZ { orig.clone() }
5897 #[repr(C)]
5898 pub union CResult_PongDecodeErrorZPtr {
5899         pub result: *mut crate::ln::msgs::Pong,
5900         pub err: *mut crate::ln::msgs::DecodeError,
5901 }
5902 #[repr(C)]
5903 pub struct CResult_PongDecodeErrorZ {
5904         pub contents: CResult_PongDecodeErrorZPtr,
5905         pub result_ok: bool,
5906 }
5907 #[no_mangle]
5908 pub extern "C" fn CResult_PongDecodeErrorZ_ok(o: crate::ln::msgs::Pong) -> CResult_PongDecodeErrorZ {
5909         CResult_PongDecodeErrorZ {
5910                 contents: CResult_PongDecodeErrorZPtr {
5911                         result: Box::into_raw(Box::new(o)),
5912                 },
5913                 result_ok: true,
5914         }
5915 }
5916 #[no_mangle]
5917 pub extern "C" fn CResult_PongDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_PongDecodeErrorZ {
5918         CResult_PongDecodeErrorZ {
5919                 contents: CResult_PongDecodeErrorZPtr {
5920                         err: Box::into_raw(Box::new(e)),
5921                 },
5922                 result_ok: false,
5923         }
5924 }
5925 #[no_mangle]
5926 pub extern "C" fn CResult_PongDecodeErrorZ_free(_res: CResult_PongDecodeErrorZ) { }
5927 impl Drop for CResult_PongDecodeErrorZ {
5928         fn drop(&mut self) {
5929                 if self.result_ok {
5930                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
5931                                 let _ = unsafe { Box::from_raw(self.contents.result) };
5932                         }
5933                 } else {
5934                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
5935                                 let _ = unsafe { Box::from_raw(self.contents.err) };
5936                         }
5937                 }
5938         }
5939 }
5940 impl From<crate::c_types::CResultTempl<crate::ln::msgs::Pong, crate::ln::msgs::DecodeError>> for CResult_PongDecodeErrorZ {
5941         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::Pong, crate::ln::msgs::DecodeError>) -> Self {
5942                 let contents = if o.result_ok {
5943                         let result = unsafe { o.contents.result };
5944                         unsafe { o.contents.result = std::ptr::null_mut() };
5945                         CResult_PongDecodeErrorZPtr { result }
5946                 } else {
5947                         let err = unsafe { o.contents.err };
5948                         unsafe { o.contents.err = std::ptr::null_mut(); }
5949                         CResult_PongDecodeErrorZPtr { err }
5950                 };
5951                 Self {
5952                         contents,
5953                         result_ok: o.result_ok,
5954                 }
5955         }
5956 }
5957 impl Clone for CResult_PongDecodeErrorZ {
5958         fn clone(&self) -> Self {
5959                 if self.result_ok {
5960                         Self { result_ok: true, contents: CResult_PongDecodeErrorZPtr {
5961                                 result: Box::into_raw(Box::new(<crate::ln::msgs::Pong>::clone(unsafe { &*self.contents.result })))
5962                         } }
5963                 } else {
5964                         Self { result_ok: false, contents: CResult_PongDecodeErrorZPtr {
5965                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
5966                         } }
5967                 }
5968         }
5969 }
5970 #[no_mangle]
5971 pub extern "C" fn CResult_PongDecodeErrorZ_clone(orig: &CResult_PongDecodeErrorZ) -> CResult_PongDecodeErrorZ { orig.clone() }
5972 #[repr(C)]
5973 pub union CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
5974         pub result: *mut crate::ln::msgs::UnsignedChannelAnnouncement,
5975         pub err: *mut crate::ln::msgs::DecodeError,
5976 }
5977 #[repr(C)]
5978 pub struct CResult_UnsignedChannelAnnouncementDecodeErrorZ {
5979         pub contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr,
5980         pub result_ok: bool,
5981 }
5982 #[no_mangle]
5983 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedChannelAnnouncement) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ {
5984         CResult_UnsignedChannelAnnouncementDecodeErrorZ {
5985                 contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
5986                         result: Box::into_raw(Box::new(o)),
5987                 },
5988                 result_ok: true,
5989         }
5990 }
5991 #[no_mangle]
5992 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ {
5993         CResult_UnsignedChannelAnnouncementDecodeErrorZ {
5994                 contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
5995                         err: Box::into_raw(Box::new(e)),
5996                 },
5997                 result_ok: false,
5998         }
5999 }
6000 #[no_mangle]
6001 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res: CResult_UnsignedChannelAnnouncementDecodeErrorZ) { }
6002 impl Drop for CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6003         fn drop(&mut self) {
6004                 if self.result_ok {
6005                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6006                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6007                         }
6008                 } else {
6009                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6010                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6011                         }
6012                 }
6013         }
6014 }
6015 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelAnnouncement, crate::ln::msgs::DecodeError>> for CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6016         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6017                 let contents = if o.result_ok {
6018                         let result = unsafe { o.contents.result };
6019                         unsafe { o.contents.result = std::ptr::null_mut() };
6020                         CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { result }
6021                 } else {
6022                         let err = unsafe { o.contents.err };
6023                         unsafe { o.contents.err = std::ptr::null_mut(); }
6024                         CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { err }
6025                 };
6026                 Self {
6027                         contents,
6028                         result_ok: o.result_ok,
6029                 }
6030         }
6031 }
6032 impl Clone for CResult_UnsignedChannelAnnouncementDecodeErrorZ {
6033         fn clone(&self) -> Self {
6034                 if self.result_ok {
6035                         Self { result_ok: true, contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6036                                 result: Box::into_raw(Box::new(<crate::ln::msgs::UnsignedChannelAnnouncement>::clone(unsafe { &*self.contents.result })))
6037                         } }
6038                 } else {
6039                         Self { result_ok: false, contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6040                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6041                         } }
6042                 }
6043         }
6044 }
6045 #[no_mangle]
6046 pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig: &CResult_UnsignedChannelAnnouncementDecodeErrorZ) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ { orig.clone() }
6047 #[repr(C)]
6048 pub union CResult_ChannelAnnouncementDecodeErrorZPtr {
6049         pub result: *mut crate::ln::msgs::ChannelAnnouncement,
6050         pub err: *mut crate::ln::msgs::DecodeError,
6051 }
6052 #[repr(C)]
6053 pub struct CResult_ChannelAnnouncementDecodeErrorZ {
6054         pub contents: CResult_ChannelAnnouncementDecodeErrorZPtr,
6055         pub result_ok: bool,
6056 }
6057 #[no_mangle]
6058 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::ChannelAnnouncement) -> CResult_ChannelAnnouncementDecodeErrorZ {
6059         CResult_ChannelAnnouncementDecodeErrorZ {
6060                 contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6061                         result: Box::into_raw(Box::new(o)),
6062                 },
6063                 result_ok: true,
6064         }
6065 }
6066 #[no_mangle]
6067 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelAnnouncementDecodeErrorZ {
6068         CResult_ChannelAnnouncementDecodeErrorZ {
6069                 contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6070                         err: Box::into_raw(Box::new(e)),
6071                 },
6072                 result_ok: false,
6073         }
6074 }
6075 #[no_mangle]
6076 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_free(_res: CResult_ChannelAnnouncementDecodeErrorZ) { }
6077 impl Drop for CResult_ChannelAnnouncementDecodeErrorZ {
6078         fn drop(&mut self) {
6079                 if self.result_ok {
6080                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6081                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6082                         }
6083                 } else {
6084                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6085                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6086                         }
6087                 }
6088         }
6089 }
6090 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::DecodeError>> for CResult_ChannelAnnouncementDecodeErrorZ {
6091         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6092                 let contents = if o.result_ok {
6093                         let result = unsafe { o.contents.result };
6094                         unsafe { o.contents.result = std::ptr::null_mut() };
6095                         CResult_ChannelAnnouncementDecodeErrorZPtr { result }
6096                 } else {
6097                         let err = unsafe { o.contents.err };
6098                         unsafe { o.contents.err = std::ptr::null_mut(); }
6099                         CResult_ChannelAnnouncementDecodeErrorZPtr { err }
6100                 };
6101                 Self {
6102                         contents,
6103                         result_ok: o.result_ok,
6104                 }
6105         }
6106 }
6107 impl Clone for CResult_ChannelAnnouncementDecodeErrorZ {
6108         fn clone(&self) -> Self {
6109                 if self.result_ok {
6110                         Self { result_ok: true, contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6111                                 result: Box::into_raw(Box::new(<crate::ln::msgs::ChannelAnnouncement>::clone(unsafe { &*self.contents.result })))
6112                         } }
6113                 } else {
6114                         Self { result_ok: false, contents: CResult_ChannelAnnouncementDecodeErrorZPtr {
6115                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6116                         } }
6117                 }
6118         }
6119 }
6120 #[no_mangle]
6121 pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_clone(orig: &CResult_ChannelAnnouncementDecodeErrorZ) -> CResult_ChannelAnnouncementDecodeErrorZ { orig.clone() }
6122 #[repr(C)]
6123 pub union CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6124         pub result: *mut crate::ln::msgs::UnsignedChannelUpdate,
6125         pub err: *mut crate::ln::msgs::DecodeError,
6126 }
6127 #[repr(C)]
6128 pub struct CResult_UnsignedChannelUpdateDecodeErrorZ {
6129         pub contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr,
6130         pub result_ok: bool,
6131 }
6132 #[no_mangle]
6133 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedChannelUpdate) -> CResult_UnsignedChannelUpdateDecodeErrorZ {
6134         CResult_UnsignedChannelUpdateDecodeErrorZ {
6135                 contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6136                         result: Box::into_raw(Box::new(o)),
6137                 },
6138                 result_ok: true,
6139         }
6140 }
6141 #[no_mangle]
6142 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedChannelUpdateDecodeErrorZ {
6143         CResult_UnsignedChannelUpdateDecodeErrorZ {
6144                 contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6145                         err: Box::into_raw(Box::new(e)),
6146                 },
6147                 result_ok: false,
6148         }
6149 }
6150 #[no_mangle]
6151 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res: CResult_UnsignedChannelUpdateDecodeErrorZ) { }
6152 impl Drop for CResult_UnsignedChannelUpdateDecodeErrorZ {
6153         fn drop(&mut self) {
6154                 if self.result_ok {
6155                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6156                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6157                         }
6158                 } else {
6159                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6160                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6161                         }
6162                 }
6163         }
6164 }
6165 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelUpdate, crate::ln::msgs::DecodeError>> for CResult_UnsignedChannelUpdateDecodeErrorZ {
6166         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UnsignedChannelUpdate, crate::ln::msgs::DecodeError>) -> Self {
6167                 let contents = if o.result_ok {
6168                         let result = unsafe { o.contents.result };
6169                         unsafe { o.contents.result = std::ptr::null_mut() };
6170                         CResult_UnsignedChannelUpdateDecodeErrorZPtr { result }
6171                 } else {
6172                         let err = unsafe { o.contents.err };
6173                         unsafe { o.contents.err = std::ptr::null_mut(); }
6174                         CResult_UnsignedChannelUpdateDecodeErrorZPtr { err }
6175                 };
6176                 Self {
6177                         contents,
6178                         result_ok: o.result_ok,
6179                 }
6180         }
6181 }
6182 impl Clone for CResult_UnsignedChannelUpdateDecodeErrorZ {
6183         fn clone(&self) -> Self {
6184                 if self.result_ok {
6185                         Self { result_ok: true, contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6186                                 result: Box::into_raw(Box::new(<crate::ln::msgs::UnsignedChannelUpdate>::clone(unsafe { &*self.contents.result })))
6187                         } }
6188                 } else {
6189                         Self { result_ok: false, contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr {
6190                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6191                         } }
6192                 }
6193         }
6194 }
6195 #[no_mangle]
6196 pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig: &CResult_UnsignedChannelUpdateDecodeErrorZ) -> CResult_UnsignedChannelUpdateDecodeErrorZ { orig.clone() }
6197 #[repr(C)]
6198 pub union CResult_ChannelUpdateDecodeErrorZPtr {
6199         pub result: *mut crate::ln::msgs::ChannelUpdate,
6200         pub err: *mut crate::ln::msgs::DecodeError,
6201 }
6202 #[repr(C)]
6203 pub struct CResult_ChannelUpdateDecodeErrorZ {
6204         pub contents: CResult_ChannelUpdateDecodeErrorZPtr,
6205         pub result_ok: bool,
6206 }
6207 #[no_mangle]
6208 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_ok(o: crate::ln::msgs::ChannelUpdate) -> CResult_ChannelUpdateDecodeErrorZ {
6209         CResult_ChannelUpdateDecodeErrorZ {
6210                 contents: CResult_ChannelUpdateDecodeErrorZPtr {
6211                         result: Box::into_raw(Box::new(o)),
6212                 },
6213                 result_ok: true,
6214         }
6215 }
6216 #[no_mangle]
6217 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelUpdateDecodeErrorZ {
6218         CResult_ChannelUpdateDecodeErrorZ {
6219                 contents: CResult_ChannelUpdateDecodeErrorZPtr {
6220                         err: Box::into_raw(Box::new(e)),
6221                 },
6222                 result_ok: false,
6223         }
6224 }
6225 #[no_mangle]
6226 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_free(_res: CResult_ChannelUpdateDecodeErrorZ) { }
6227 impl Drop for CResult_ChannelUpdateDecodeErrorZ {
6228         fn drop(&mut self) {
6229                 if self.result_ok {
6230                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6231                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6232                         }
6233                 } else {
6234                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6235                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6236                         }
6237                 }
6238         }
6239 }
6240 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ChannelUpdate, crate::ln::msgs::DecodeError>> for CResult_ChannelUpdateDecodeErrorZ {
6241         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ChannelUpdate, crate::ln::msgs::DecodeError>) -> Self {
6242                 let contents = if o.result_ok {
6243                         let result = unsafe { o.contents.result };
6244                         unsafe { o.contents.result = std::ptr::null_mut() };
6245                         CResult_ChannelUpdateDecodeErrorZPtr { result }
6246                 } else {
6247                         let err = unsafe { o.contents.err };
6248                         unsafe { o.contents.err = std::ptr::null_mut(); }
6249                         CResult_ChannelUpdateDecodeErrorZPtr { err }
6250                 };
6251                 Self {
6252                         contents,
6253                         result_ok: o.result_ok,
6254                 }
6255         }
6256 }
6257 impl Clone for CResult_ChannelUpdateDecodeErrorZ {
6258         fn clone(&self) -> Self {
6259                 if self.result_ok {
6260                         Self { result_ok: true, contents: CResult_ChannelUpdateDecodeErrorZPtr {
6261                                 result: Box::into_raw(Box::new(<crate::ln::msgs::ChannelUpdate>::clone(unsafe { &*self.contents.result })))
6262                         } }
6263                 } else {
6264                         Self { result_ok: false, contents: CResult_ChannelUpdateDecodeErrorZPtr {
6265                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6266                         } }
6267                 }
6268         }
6269 }
6270 #[no_mangle]
6271 pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_clone(orig: &CResult_ChannelUpdateDecodeErrorZ) -> CResult_ChannelUpdateDecodeErrorZ { orig.clone() }
6272 #[repr(C)]
6273 pub union CResult_ErrorMessageDecodeErrorZPtr {
6274         pub result: *mut crate::ln::msgs::ErrorMessage,
6275         pub err: *mut crate::ln::msgs::DecodeError,
6276 }
6277 #[repr(C)]
6278 pub struct CResult_ErrorMessageDecodeErrorZ {
6279         pub contents: CResult_ErrorMessageDecodeErrorZPtr,
6280         pub result_ok: bool,
6281 }
6282 #[no_mangle]
6283 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_ok(o: crate::ln::msgs::ErrorMessage) -> CResult_ErrorMessageDecodeErrorZ {
6284         CResult_ErrorMessageDecodeErrorZ {
6285                 contents: CResult_ErrorMessageDecodeErrorZPtr {
6286                         result: Box::into_raw(Box::new(o)),
6287                 },
6288                 result_ok: true,
6289         }
6290 }
6291 #[no_mangle]
6292 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ErrorMessageDecodeErrorZ {
6293         CResult_ErrorMessageDecodeErrorZ {
6294                 contents: CResult_ErrorMessageDecodeErrorZPtr {
6295                         err: Box::into_raw(Box::new(e)),
6296                 },
6297                 result_ok: false,
6298         }
6299 }
6300 #[no_mangle]
6301 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_free(_res: CResult_ErrorMessageDecodeErrorZ) { }
6302 impl Drop for CResult_ErrorMessageDecodeErrorZ {
6303         fn drop(&mut self) {
6304                 if self.result_ok {
6305                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6306                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6307                         }
6308                 } else {
6309                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6310                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6311                         }
6312                 }
6313         }
6314 }
6315 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ErrorMessage, crate::ln::msgs::DecodeError>> for CResult_ErrorMessageDecodeErrorZ {
6316         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ErrorMessage, crate::ln::msgs::DecodeError>) -> Self {
6317                 let contents = if o.result_ok {
6318                         let result = unsafe { o.contents.result };
6319                         unsafe { o.contents.result = std::ptr::null_mut() };
6320                         CResult_ErrorMessageDecodeErrorZPtr { result }
6321                 } else {
6322                         let err = unsafe { o.contents.err };
6323                         unsafe { o.contents.err = std::ptr::null_mut(); }
6324                         CResult_ErrorMessageDecodeErrorZPtr { err }
6325                 };
6326                 Self {
6327                         contents,
6328                         result_ok: o.result_ok,
6329                 }
6330         }
6331 }
6332 impl Clone for CResult_ErrorMessageDecodeErrorZ {
6333         fn clone(&self) -> Self {
6334                 if self.result_ok {
6335                         Self { result_ok: true, contents: CResult_ErrorMessageDecodeErrorZPtr {
6336                                 result: Box::into_raw(Box::new(<crate::ln::msgs::ErrorMessage>::clone(unsafe { &*self.contents.result })))
6337                         } }
6338                 } else {
6339                         Self { result_ok: false, contents: CResult_ErrorMessageDecodeErrorZPtr {
6340                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6341                         } }
6342                 }
6343         }
6344 }
6345 #[no_mangle]
6346 pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_clone(orig: &CResult_ErrorMessageDecodeErrorZ) -> CResult_ErrorMessageDecodeErrorZ { orig.clone() }
6347 #[repr(C)]
6348 pub union CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6349         pub result: *mut crate::ln::msgs::UnsignedNodeAnnouncement,
6350         pub err: *mut crate::ln::msgs::DecodeError,
6351 }
6352 #[repr(C)]
6353 pub struct CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6354         pub contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr,
6355         pub result_ok: bool,
6356 }
6357 #[no_mangle]
6358 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedNodeAnnouncement) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6359         CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6360                 contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6361                         result: Box::into_raw(Box::new(o)),
6362                 },
6363                 result_ok: true,
6364         }
6365 }
6366 #[no_mangle]
6367 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6368         CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6369                 contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6370                         err: Box::into_raw(Box::new(e)),
6371                 },
6372                 result_ok: false,
6373         }
6374 }
6375 #[no_mangle]
6376 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res: CResult_UnsignedNodeAnnouncementDecodeErrorZ) { }
6377 impl Drop for CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6378         fn drop(&mut self) {
6379                 if self.result_ok {
6380                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6381                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6382                         }
6383                 } else {
6384                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6385                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6386                         }
6387                 }
6388         }
6389 }
6390 impl From<crate::c_types::CResultTempl<crate::ln::msgs::UnsignedNodeAnnouncement, crate::ln::msgs::DecodeError>> for CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6391         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::UnsignedNodeAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6392                 let contents = if o.result_ok {
6393                         let result = unsafe { o.contents.result };
6394                         unsafe { o.contents.result = std::ptr::null_mut() };
6395                         CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { result }
6396                 } else {
6397                         let err = unsafe { o.contents.err };
6398                         unsafe { o.contents.err = std::ptr::null_mut(); }
6399                         CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { err }
6400                 };
6401                 Self {
6402                         contents,
6403                         result_ok: o.result_ok,
6404                 }
6405         }
6406 }
6407 impl Clone for CResult_UnsignedNodeAnnouncementDecodeErrorZ {
6408         fn clone(&self) -> Self {
6409                 if self.result_ok {
6410                         Self { result_ok: true, contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6411                                 result: Box::into_raw(Box::new(<crate::ln::msgs::UnsignedNodeAnnouncement>::clone(unsafe { &*self.contents.result })))
6412                         } }
6413                 } else {
6414                         Self { result_ok: false, contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6415                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6416                         } }
6417                 }
6418         }
6419 }
6420 #[no_mangle]
6421 pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig: &CResult_UnsignedNodeAnnouncementDecodeErrorZ) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ { orig.clone() }
6422 #[repr(C)]
6423 pub union CResult_NodeAnnouncementDecodeErrorZPtr {
6424         pub result: *mut crate::ln::msgs::NodeAnnouncement,
6425         pub err: *mut crate::ln::msgs::DecodeError,
6426 }
6427 #[repr(C)]
6428 pub struct CResult_NodeAnnouncementDecodeErrorZ {
6429         pub contents: CResult_NodeAnnouncementDecodeErrorZPtr,
6430         pub result_ok: bool,
6431 }
6432 #[no_mangle]
6433 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::NodeAnnouncement) -> CResult_NodeAnnouncementDecodeErrorZ {
6434         CResult_NodeAnnouncementDecodeErrorZ {
6435                 contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6436                         result: Box::into_raw(Box::new(o)),
6437                 },
6438                 result_ok: true,
6439         }
6440 }
6441 #[no_mangle]
6442 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeAnnouncementDecodeErrorZ {
6443         CResult_NodeAnnouncementDecodeErrorZ {
6444                 contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6445                         err: Box::into_raw(Box::new(e)),
6446                 },
6447                 result_ok: false,
6448         }
6449 }
6450 #[no_mangle]
6451 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_free(_res: CResult_NodeAnnouncementDecodeErrorZ) { }
6452 impl Drop for CResult_NodeAnnouncementDecodeErrorZ {
6453         fn drop(&mut self) {
6454                 if self.result_ok {
6455                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6456                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6457                         }
6458                 } else {
6459                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6460                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6461                         }
6462                 }
6463         }
6464 }
6465 impl From<crate::c_types::CResultTempl<crate::ln::msgs::NodeAnnouncement, crate::ln::msgs::DecodeError>> for CResult_NodeAnnouncementDecodeErrorZ {
6466         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::NodeAnnouncement, crate::ln::msgs::DecodeError>) -> Self {
6467                 let contents = if o.result_ok {
6468                         let result = unsafe { o.contents.result };
6469                         unsafe { o.contents.result = std::ptr::null_mut() };
6470                         CResult_NodeAnnouncementDecodeErrorZPtr { result }
6471                 } else {
6472                         let err = unsafe { o.contents.err };
6473                         unsafe { o.contents.err = std::ptr::null_mut(); }
6474                         CResult_NodeAnnouncementDecodeErrorZPtr { err }
6475                 };
6476                 Self {
6477                         contents,
6478                         result_ok: o.result_ok,
6479                 }
6480         }
6481 }
6482 impl Clone for CResult_NodeAnnouncementDecodeErrorZ {
6483         fn clone(&self) -> Self {
6484                 if self.result_ok {
6485                         Self { result_ok: true, contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6486                                 result: Box::into_raw(Box::new(<crate::ln::msgs::NodeAnnouncement>::clone(unsafe { &*self.contents.result })))
6487                         } }
6488                 } else {
6489                         Self { result_ok: false, contents: CResult_NodeAnnouncementDecodeErrorZPtr {
6490                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6491                         } }
6492                 }
6493         }
6494 }
6495 #[no_mangle]
6496 pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_clone(orig: &CResult_NodeAnnouncementDecodeErrorZ) -> CResult_NodeAnnouncementDecodeErrorZ { orig.clone() }
6497 #[repr(C)]
6498 pub union CResult_QueryShortChannelIdsDecodeErrorZPtr {
6499         pub result: *mut crate::ln::msgs::QueryShortChannelIds,
6500         pub err: *mut crate::ln::msgs::DecodeError,
6501 }
6502 #[repr(C)]
6503 pub struct CResult_QueryShortChannelIdsDecodeErrorZ {
6504         pub contents: CResult_QueryShortChannelIdsDecodeErrorZPtr,
6505         pub result_ok: bool,
6506 }
6507 #[no_mangle]
6508 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_ok(o: crate::ln::msgs::QueryShortChannelIds) -> CResult_QueryShortChannelIdsDecodeErrorZ {
6509         CResult_QueryShortChannelIdsDecodeErrorZ {
6510                 contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6511                         result: Box::into_raw(Box::new(o)),
6512                 },
6513                 result_ok: true,
6514         }
6515 }
6516 #[no_mangle]
6517 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_QueryShortChannelIdsDecodeErrorZ {
6518         CResult_QueryShortChannelIdsDecodeErrorZ {
6519                 contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6520                         err: Box::into_raw(Box::new(e)),
6521                 },
6522                 result_ok: false,
6523         }
6524 }
6525 #[no_mangle]
6526 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_free(_res: CResult_QueryShortChannelIdsDecodeErrorZ) { }
6527 impl Drop for CResult_QueryShortChannelIdsDecodeErrorZ {
6528         fn drop(&mut self) {
6529                 if self.result_ok {
6530                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6531                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6532                         }
6533                 } else {
6534                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6535                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6536                         }
6537                 }
6538         }
6539 }
6540 impl From<crate::c_types::CResultTempl<crate::ln::msgs::QueryShortChannelIds, crate::ln::msgs::DecodeError>> for CResult_QueryShortChannelIdsDecodeErrorZ {
6541         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::QueryShortChannelIds, crate::ln::msgs::DecodeError>) -> Self {
6542                 let contents = if o.result_ok {
6543                         let result = unsafe { o.contents.result };
6544                         unsafe { o.contents.result = std::ptr::null_mut() };
6545                         CResult_QueryShortChannelIdsDecodeErrorZPtr { result }
6546                 } else {
6547                         let err = unsafe { o.contents.err };
6548                         unsafe { o.contents.err = std::ptr::null_mut(); }
6549                         CResult_QueryShortChannelIdsDecodeErrorZPtr { err }
6550                 };
6551                 Self {
6552                         contents,
6553                         result_ok: o.result_ok,
6554                 }
6555         }
6556 }
6557 impl Clone for CResult_QueryShortChannelIdsDecodeErrorZ {
6558         fn clone(&self) -> Self {
6559                 if self.result_ok {
6560                         Self { result_ok: true, contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6561                                 result: Box::into_raw(Box::new(<crate::ln::msgs::QueryShortChannelIds>::clone(unsafe { &*self.contents.result })))
6562                         } }
6563                 } else {
6564                         Self { result_ok: false, contents: CResult_QueryShortChannelIdsDecodeErrorZPtr {
6565                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6566                         } }
6567                 }
6568         }
6569 }
6570 #[no_mangle]
6571 pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig: &CResult_QueryShortChannelIdsDecodeErrorZ) -> CResult_QueryShortChannelIdsDecodeErrorZ { orig.clone() }
6572 #[repr(C)]
6573 pub union CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6574         pub result: *mut crate::ln::msgs::ReplyShortChannelIdsEnd,
6575         pub err: *mut crate::ln::msgs::DecodeError,
6576 }
6577 #[repr(C)]
6578 pub struct CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6579         pub contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr,
6580         pub result_ok: bool,
6581 }
6582 #[no_mangle]
6583 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o: crate::ln::msgs::ReplyShortChannelIdsEnd) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6584         CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6585                 contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6586                         result: Box::into_raw(Box::new(o)),
6587                 },
6588                 result_ok: true,
6589         }
6590 }
6591 #[no_mangle]
6592 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6593         CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6594                 contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6595                         err: Box::into_raw(Box::new(e)),
6596                 },
6597                 result_ok: false,
6598         }
6599 }
6600 #[no_mangle]
6601 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res: CResult_ReplyShortChannelIdsEndDecodeErrorZ) { }
6602 impl Drop for CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6603         fn drop(&mut self) {
6604                 if self.result_ok {
6605                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6606                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6607                         }
6608                 } else {
6609                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6610                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6611                         }
6612                 }
6613         }
6614 }
6615 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ReplyShortChannelIdsEnd, crate::ln::msgs::DecodeError>> for CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6616         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ReplyShortChannelIdsEnd, crate::ln::msgs::DecodeError>) -> Self {
6617                 let contents = if o.result_ok {
6618                         let result = unsafe { o.contents.result };
6619                         unsafe { o.contents.result = std::ptr::null_mut() };
6620                         CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { result }
6621                 } else {
6622                         let err = unsafe { o.contents.err };
6623                         unsafe { o.contents.err = std::ptr::null_mut(); }
6624                         CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { err }
6625                 };
6626                 Self {
6627                         contents,
6628                         result_ok: o.result_ok,
6629                 }
6630         }
6631 }
6632 impl Clone for CResult_ReplyShortChannelIdsEndDecodeErrorZ {
6633         fn clone(&self) -> Self {
6634                 if self.result_ok {
6635                         Self { result_ok: true, contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6636                                 result: Box::into_raw(Box::new(<crate::ln::msgs::ReplyShortChannelIdsEnd>::clone(unsafe { &*self.contents.result })))
6637                         } }
6638                 } else {
6639                         Self { result_ok: false, contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6640                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6641                         } }
6642                 }
6643         }
6644 }
6645 #[no_mangle]
6646 pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig: &CResult_ReplyShortChannelIdsEndDecodeErrorZ) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ { orig.clone() }
6647 #[repr(C)]
6648 pub union CResult_QueryChannelRangeDecodeErrorZPtr {
6649         pub result: *mut crate::ln::msgs::QueryChannelRange,
6650         pub err: *mut crate::ln::msgs::DecodeError,
6651 }
6652 #[repr(C)]
6653 pub struct CResult_QueryChannelRangeDecodeErrorZ {
6654         pub contents: CResult_QueryChannelRangeDecodeErrorZPtr,
6655         pub result_ok: bool,
6656 }
6657 #[no_mangle]
6658 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_ok(o: crate::ln::msgs::QueryChannelRange) -> CResult_QueryChannelRangeDecodeErrorZ {
6659         CResult_QueryChannelRangeDecodeErrorZ {
6660                 contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6661                         result: Box::into_raw(Box::new(o)),
6662                 },
6663                 result_ok: true,
6664         }
6665 }
6666 #[no_mangle]
6667 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_QueryChannelRangeDecodeErrorZ {
6668         CResult_QueryChannelRangeDecodeErrorZ {
6669                 contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6670                         err: Box::into_raw(Box::new(e)),
6671                 },
6672                 result_ok: false,
6673         }
6674 }
6675 #[no_mangle]
6676 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_free(_res: CResult_QueryChannelRangeDecodeErrorZ) { }
6677 impl Drop for CResult_QueryChannelRangeDecodeErrorZ {
6678         fn drop(&mut self) {
6679                 if self.result_ok {
6680                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6681                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6682                         }
6683                 } else {
6684                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6685                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6686                         }
6687                 }
6688         }
6689 }
6690 impl From<crate::c_types::CResultTempl<crate::ln::msgs::QueryChannelRange, crate::ln::msgs::DecodeError>> for CResult_QueryChannelRangeDecodeErrorZ {
6691         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::QueryChannelRange, crate::ln::msgs::DecodeError>) -> Self {
6692                 let contents = if o.result_ok {
6693                         let result = unsafe { o.contents.result };
6694                         unsafe { o.contents.result = std::ptr::null_mut() };
6695                         CResult_QueryChannelRangeDecodeErrorZPtr { result }
6696                 } else {
6697                         let err = unsafe { o.contents.err };
6698                         unsafe { o.contents.err = std::ptr::null_mut(); }
6699                         CResult_QueryChannelRangeDecodeErrorZPtr { err }
6700                 };
6701                 Self {
6702                         contents,
6703                         result_ok: o.result_ok,
6704                 }
6705         }
6706 }
6707 impl Clone for CResult_QueryChannelRangeDecodeErrorZ {
6708         fn clone(&self) -> Self {
6709                 if self.result_ok {
6710                         Self { result_ok: true, contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6711                                 result: Box::into_raw(Box::new(<crate::ln::msgs::QueryChannelRange>::clone(unsafe { &*self.contents.result })))
6712                         } }
6713                 } else {
6714                         Self { result_ok: false, contents: CResult_QueryChannelRangeDecodeErrorZPtr {
6715                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6716                         } }
6717                 }
6718         }
6719 }
6720 #[no_mangle]
6721 pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_clone(orig: &CResult_QueryChannelRangeDecodeErrorZ) -> CResult_QueryChannelRangeDecodeErrorZ { orig.clone() }
6722 #[repr(C)]
6723 pub union CResult_ReplyChannelRangeDecodeErrorZPtr {
6724         pub result: *mut crate::ln::msgs::ReplyChannelRange,
6725         pub err: *mut crate::ln::msgs::DecodeError,
6726 }
6727 #[repr(C)]
6728 pub struct CResult_ReplyChannelRangeDecodeErrorZ {
6729         pub contents: CResult_ReplyChannelRangeDecodeErrorZPtr,
6730         pub result_ok: bool,
6731 }
6732 #[no_mangle]
6733 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_ok(o: crate::ln::msgs::ReplyChannelRange) -> CResult_ReplyChannelRangeDecodeErrorZ {
6734         CResult_ReplyChannelRangeDecodeErrorZ {
6735                 contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
6736                         result: Box::into_raw(Box::new(o)),
6737                 },
6738                 result_ok: true,
6739         }
6740 }
6741 #[no_mangle]
6742 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ReplyChannelRangeDecodeErrorZ {
6743         CResult_ReplyChannelRangeDecodeErrorZ {
6744                 contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
6745                         err: Box::into_raw(Box::new(e)),
6746                 },
6747                 result_ok: false,
6748         }
6749 }
6750 #[no_mangle]
6751 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_free(_res: CResult_ReplyChannelRangeDecodeErrorZ) { }
6752 impl Drop for CResult_ReplyChannelRangeDecodeErrorZ {
6753         fn drop(&mut self) {
6754                 if self.result_ok {
6755                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6756                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6757                         }
6758                 } else {
6759                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6760                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6761                         }
6762                 }
6763         }
6764 }
6765 impl From<crate::c_types::CResultTempl<crate::ln::msgs::ReplyChannelRange, crate::ln::msgs::DecodeError>> for CResult_ReplyChannelRangeDecodeErrorZ {
6766         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::ReplyChannelRange, crate::ln::msgs::DecodeError>) -> Self {
6767                 let contents = if o.result_ok {
6768                         let result = unsafe { o.contents.result };
6769                         unsafe { o.contents.result = std::ptr::null_mut() };
6770                         CResult_ReplyChannelRangeDecodeErrorZPtr { result }
6771                 } else {
6772                         let err = unsafe { o.contents.err };
6773                         unsafe { o.contents.err = std::ptr::null_mut(); }
6774                         CResult_ReplyChannelRangeDecodeErrorZPtr { err }
6775                 };
6776                 Self {
6777                         contents,
6778                         result_ok: o.result_ok,
6779                 }
6780         }
6781 }
6782 impl Clone for CResult_ReplyChannelRangeDecodeErrorZ {
6783         fn clone(&self) -> Self {
6784                 if self.result_ok {
6785                         Self { result_ok: true, contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
6786                                 result: Box::into_raw(Box::new(<crate::ln::msgs::ReplyChannelRange>::clone(unsafe { &*self.contents.result })))
6787                         } }
6788                 } else {
6789                         Self { result_ok: false, contents: CResult_ReplyChannelRangeDecodeErrorZPtr {
6790                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6791                         } }
6792                 }
6793         }
6794 }
6795 #[no_mangle]
6796 pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_clone(orig: &CResult_ReplyChannelRangeDecodeErrorZ) -> CResult_ReplyChannelRangeDecodeErrorZ { orig.clone() }
6797 #[repr(C)]
6798 pub union CResult_GossipTimestampFilterDecodeErrorZPtr {
6799         pub result: *mut crate::ln::msgs::GossipTimestampFilter,
6800         pub err: *mut crate::ln::msgs::DecodeError,
6801 }
6802 #[repr(C)]
6803 pub struct CResult_GossipTimestampFilterDecodeErrorZ {
6804         pub contents: CResult_GossipTimestampFilterDecodeErrorZPtr,
6805         pub result_ok: bool,
6806 }
6807 #[no_mangle]
6808 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_ok(o: crate::ln::msgs::GossipTimestampFilter) -> CResult_GossipTimestampFilterDecodeErrorZ {
6809         CResult_GossipTimestampFilterDecodeErrorZ {
6810                 contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
6811                         result: Box::into_raw(Box::new(o)),
6812                 },
6813                 result_ok: true,
6814         }
6815 }
6816 #[no_mangle]
6817 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_GossipTimestampFilterDecodeErrorZ {
6818         CResult_GossipTimestampFilterDecodeErrorZ {
6819                 contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
6820                         err: Box::into_raw(Box::new(e)),
6821                 },
6822                 result_ok: false,
6823         }
6824 }
6825 #[no_mangle]
6826 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_free(_res: CResult_GossipTimestampFilterDecodeErrorZ) { }
6827 impl Drop for CResult_GossipTimestampFilterDecodeErrorZ {
6828         fn drop(&mut self) {
6829                 if self.result_ok {
6830                         if unsafe { !(self.contents.result as *mut ()).is_null() } {
6831                                 let _ = unsafe { Box::from_raw(self.contents.result) };
6832                         }
6833                 } else {
6834                         if unsafe { !(self.contents.err as *mut ()).is_null() } {
6835                                 let _ = unsafe { Box::from_raw(self.contents.err) };
6836                         }
6837                 }
6838         }
6839 }
6840 impl From<crate::c_types::CResultTempl<crate::ln::msgs::GossipTimestampFilter, crate::ln::msgs::DecodeError>> for CResult_GossipTimestampFilterDecodeErrorZ {
6841         fn from(mut o: crate::c_types::CResultTempl<crate::ln::msgs::GossipTimestampFilter, crate::ln::msgs::DecodeError>) -> Self {
6842                 let contents = if o.result_ok {
6843                         let result = unsafe { o.contents.result };
6844                         unsafe { o.contents.result = std::ptr::null_mut() };
6845                         CResult_GossipTimestampFilterDecodeErrorZPtr { result }
6846                 } else {
6847                         let err = unsafe { o.contents.err };
6848                         unsafe { o.contents.err = std::ptr::null_mut(); }
6849                         CResult_GossipTimestampFilterDecodeErrorZPtr { err }
6850                 };
6851                 Self {
6852                         contents,
6853                         result_ok: o.result_ok,
6854                 }
6855         }
6856 }
6857 impl Clone for CResult_GossipTimestampFilterDecodeErrorZ {
6858         fn clone(&self) -> Self {
6859                 if self.result_ok {
6860                         Self { result_ok: true, contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
6861                                 result: Box::into_raw(Box::new(<crate::ln::msgs::GossipTimestampFilter>::clone(unsafe { &*self.contents.result })))
6862                         } }
6863                 } else {
6864                         Self { result_ok: false, contents: CResult_GossipTimestampFilterDecodeErrorZPtr {
6865                                 err: Box::into_raw(Box::new(<crate::ln::msgs::DecodeError>::clone(unsafe { &*self.contents.err })))
6866                         } }
6867                 }
6868         }
6869 }
6870 #[no_mangle]
6871 pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_clone(orig: &CResult_GossipTimestampFilterDecodeErrorZ) -> CResult_GossipTimestampFilterDecodeErrorZ { orig.clone() }