1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
4 // This file is licensed under the license available in the LICENSE or LICENSE.md
5 // file in the root of this repository or, if no such file exists, the same
6 // license as that which applies to the original source files from which this
7 // source was automatically generated.
9 //! Feature flag definitions for the Lightning protocol according to [BOLT #9].
11 //! Lightning nodes advertise a supported set of operation through feature flags. Features are
12 //! applicable for a specific context as indicated in some [messages]. [`Features`] encapsulates
13 //! behavior for specifying and checking feature flags for a particular context. Each feature is
14 //! defined internally by a trait specifying the corresponding flags (i.e., even and odd bits).
16 //! Whether a feature is considered \"known\" or \"unknown\" is relative to the implementation, whereas
17 //! the term \"supports\" is used in reference to a particular set of [`Features`]. That is, a node
18 //! supports a feature if it advertises the feature (as either required or optional) to its peers.
19 //! And the implementation can interpret a feature if the feature is known to it.
21 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
22 //! [messages]: crate::ln::msgs
24 use alloc::str::FromStr;
25 use core::ffi::c_void;
26 use core::convert::Infallible;
27 use bitcoin::hashes::Hash;
28 use crate::c_types::*;
29 #[cfg(feature="no-std")]
30 use alloc::{vec::Vec, boxed::Box};
34 use alloc::str::FromStr;
35 use core::ffi::c_void;
36 use core::convert::Infallible;
37 use bitcoin::hashes::Hash;
38 use crate::c_types::*;
39 #[cfg(feature="no-std")]
40 use alloc::{vec::Vec, boxed::Box};
42 /// Set this feature as optional.
44 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
45 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_optional()
48 /// Set this feature as required.
50 pub extern "C" fn InitFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
51 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_required()
54 /// Checks if this feature is supported.
57 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
58 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
62 /// Set this feature as optional.
64 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
65 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_optional()
68 /// Set this feature as required.
70 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
71 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_required()
74 /// Checks if this feature is supported.
77 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
78 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
82 /// Checks if this feature is required.
85 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
86 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
90 /// Checks if this feature is required.
93 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
94 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
98 /// Set this feature as optional.
100 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
101 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_optional()
104 /// Set this feature as required.
106 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
107 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_required()
110 /// Checks if this feature is supported.
113 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
114 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
118 /// Set this feature as optional.
120 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
121 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_optional()
124 /// Set this feature as required.
126 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
127 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_required()
130 /// Checks if this feature is supported.
133 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
134 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
138 /// Set this feature as optional.
140 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
141 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_optional()
144 /// Set this feature as required.
146 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
147 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_required()
150 /// Checks if this feature is supported.
153 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
154 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
158 /// Checks if this feature is required.
161 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
162 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
166 /// Checks if this feature is required.
169 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
170 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
174 /// Set this feature as optional.
176 pub extern "C" fn InitFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
177 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_optional()
180 /// Set this feature as required.
182 pub extern "C" fn InitFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
183 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_required()
186 /// Checks if this feature is supported.
189 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
190 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
194 /// Set this feature as optional.
196 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
197 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_optional()
200 /// Set this feature as required.
202 pub extern "C" fn NodeFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
203 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_required()
206 /// Checks if this feature is supported.
209 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
210 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
214 /// Checks if this feature is required.
217 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
218 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
222 /// Checks if this feature is required.
225 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
226 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
230 /// Set this feature as optional.
232 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
233 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_optional()
236 /// Set this feature as required.
238 pub extern "C" fn InitFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
239 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_required()
242 /// Checks if this feature is supported.
245 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
246 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
250 /// Set this feature as optional.
252 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
253 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_optional()
256 /// Set this feature as required.
258 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
259 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_required()
262 /// Checks if this feature is supported.
265 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
266 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
270 /// Set this feature as optional.
272 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
273 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_optional()
276 /// Set this feature as required.
278 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
279 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_required()
282 /// Checks if this feature is supported.
285 pub extern "C" fn InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
286 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
290 /// Checks if this feature is required.
293 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
294 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
298 /// Checks if this feature is required.
301 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
302 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
306 /// Checks if this feature is required.
309 pub extern "C" fn InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
310 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
314 /// Set this feature as optional.
316 pub extern "C" fn InitFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
317 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_optional()
320 /// Set this feature as required.
322 pub extern "C" fn InitFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
323 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_required()
326 /// Checks if this feature is supported.
329 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
330 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
334 /// Set this feature as optional.
336 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
337 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_optional()
340 /// Set this feature as required.
342 pub extern "C" fn NodeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
343 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_required()
346 /// Checks if this feature is supported.
349 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
350 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
354 /// Set this feature as optional.
356 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
357 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_optional()
360 /// Set this feature as required.
362 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
363 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_required()
366 /// Checks if this feature is supported.
369 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
370 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
374 /// Checks if this feature is required.
377 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
378 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
382 /// Checks if this feature is required.
385 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
386 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
390 /// Checks if this feature is required.
393 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
394 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
398 /// Set this feature as optional.
400 pub extern "C" fn InitFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
401 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_optional()
404 /// Set this feature as required.
406 pub extern "C" fn InitFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
407 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_required()
410 /// Checks if this feature is supported.
413 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
414 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
418 /// Set this feature as optional.
420 pub extern "C" fn NodeFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
421 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_optional()
424 /// Set this feature as required.
426 pub extern "C" fn NodeFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
427 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_required()
430 /// Checks if this feature is supported.
433 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
434 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
438 /// Set this feature as optional.
440 pub extern "C" fn InvoiceFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
441 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_optional()
444 /// Set this feature as required.
446 pub extern "C" fn InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
447 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_required()
450 /// Checks if this feature is supported.
453 pub extern "C" fn InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
454 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
458 /// Checks if this feature is required.
461 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
462 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
466 /// Checks if this feature is required.
469 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
470 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
474 /// Checks if this feature is required.
477 pub extern "C" fn InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
478 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
482 /// Set this feature as optional.
484 pub extern "C" fn InitFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
485 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_optional()
488 /// Set this feature as required.
490 pub extern "C" fn InitFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
491 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_required()
494 /// Checks if this feature is supported.
497 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
498 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
502 /// Set this feature as optional.
504 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
505 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_optional()
508 /// Set this feature as required.
510 pub extern "C" fn NodeFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
511 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_required()
514 /// Checks if this feature is supported.
517 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
518 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
522 /// Set this feature as optional.
524 pub extern "C" fn InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
525 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_optional()
528 /// Set this feature as required.
530 pub extern "C" fn InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
531 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_required()
534 /// Checks if this feature is supported.
537 pub extern "C" fn InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
538 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
542 /// Checks if this feature is required.
545 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
546 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
550 /// Checks if this feature is required.
553 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
554 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
558 /// Checks if this feature is required.
561 pub extern "C" fn InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
562 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
566 /// Set this feature as optional.
568 pub extern "C" fn InitFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
569 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_optional()
572 /// Set this feature as required.
574 pub extern "C" fn InitFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
575 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_required()
578 /// Checks if this feature is supported.
581 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
582 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
586 /// Set this feature as optional.
588 pub extern "C" fn NodeFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
589 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_optional()
592 /// Set this feature as required.
594 pub extern "C" fn NodeFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
595 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_required()
598 /// Checks if this feature is supported.
601 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
602 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
606 /// Checks if this feature is required.
609 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
610 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
614 /// Checks if this feature is required.
617 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
618 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
622 /// Set this feature as optional.
624 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
625 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_optional()
628 /// Set this feature as required.
630 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
631 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_required()
634 /// Checks if this feature is supported.
637 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
638 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
642 /// Set this feature as optional.
644 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
645 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_optional()
648 /// Set this feature as required.
650 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
651 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_required()
654 /// Checks if this feature is supported.
657 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
658 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
662 /// Checks if this feature is required.
665 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
666 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
670 /// Checks if this feature is required.
673 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
674 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
678 /// Set this feature as optional.
680 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
681 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
684 /// Set this feature as required.
686 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
687 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
690 /// Checks if this feature is supported.
693 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
694 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
698 /// Set this feature as optional.
700 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
701 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
704 /// Set this feature as required.
706 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
707 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
710 /// Checks if this feature is supported.
713 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
714 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
718 /// Checks if this feature is required.
721 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
722 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
726 /// Checks if this feature is required.
729 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
730 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
734 /// Set this feature as optional.
736 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
737 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
740 /// Set this feature as required.
742 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
743 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
746 /// Checks if this feature is supported.
749 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
750 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
754 /// Set this feature as optional.
756 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
757 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
760 /// Set this feature as required.
762 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
763 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
766 /// Checks if this feature is supported.
769 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
770 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
774 /// Set this feature as optional.
776 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
777 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
780 /// Set this feature as required.
782 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
783 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
786 /// Checks if this feature is supported.
789 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
790 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
794 /// Checks if this feature is required.
797 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
798 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
802 /// Checks if this feature is required.
805 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
806 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
810 /// Checks if this feature is required.
813 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
814 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
818 /// Set this feature as optional.
820 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
821 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
824 /// Set this feature as required.
826 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
827 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
830 /// Checks if this feature is supported.
833 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
834 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
838 /// Set this feature as optional.
840 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
841 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
844 /// Set this feature as required.
846 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
847 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
850 /// Checks if this feature is supported.
853 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
854 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
858 /// Set this feature as optional.
860 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
861 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
864 /// Set this feature as required.
866 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
867 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
870 /// Checks if this feature is supported.
873 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
874 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
878 /// Checks if this feature is required.
881 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
882 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
886 /// Checks if this feature is required.
889 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
890 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
894 /// Checks if this feature is required.
897 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
898 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
902 /// Set this feature as optional.
904 pub extern "C" fn NodeFeatures_set_keysend_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
905 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_optional()
908 /// Set this feature as required.
910 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
911 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
914 /// Checks if this feature is supported.
917 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
918 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
922 /// Checks if this feature is required.
925 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
926 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
931 /// Checks if two InitFeaturess contain equal inner contents.
932 /// This ignores pointers and is_owned flags and looks at the values in fields.
933 /// Two objects with NULL inner values will be considered "equal" here.
935 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
936 if a.inner == b.inner { return true; }
937 if a.inner.is_null() || b.inner.is_null() { return false; }
938 if a.get_native_ref() == b.get_native_ref() { true } else { false }
940 /// Checks if two NodeFeaturess contain equal inner contents.
941 /// This ignores pointers and is_owned flags and looks at the values in fields.
942 /// Two objects with NULL inner values will be considered "equal" here.
944 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
945 if a.inner == b.inner { return true; }
946 if a.inner.is_null() || b.inner.is_null() { return false; }
947 if a.get_native_ref() == b.get_native_ref() { true } else { false }
949 /// Checks if two ChannelFeaturess contain equal inner contents.
950 /// This ignores pointers and is_owned flags and looks at the values in fields.
951 /// Two objects with NULL inner values will be considered "equal" here.
953 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
954 if a.inner == b.inner { return true; }
955 if a.inner.is_null() || b.inner.is_null() { return false; }
956 if a.get_native_ref() == b.get_native_ref() { true } else { false }
958 /// Checks if two InvoiceFeaturess contain equal inner contents.
959 /// This ignores pointers and is_owned flags and looks at the values in fields.
960 /// Two objects with NULL inner values will be considered "equal" here.
962 pub extern "C" fn InvoiceFeatures_eq(a: &InvoiceFeatures, b: &InvoiceFeatures) -> bool {
963 if a.inner == b.inner { return true; }
964 if a.inner.is_null() || b.inner.is_null() { return false; }
965 if a.get_native_ref() == b.get_native_ref() { true } else { false }
967 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
968 /// This ignores pointers and is_owned flags and looks at the values in fields.
969 /// Two objects with NULL inner values will be considered "equal" here.
971 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
972 if a.inner == b.inner { return true; }
973 if a.inner.is_null() || b.inner.is_null() { return false; }
974 if a.get_native_ref() == b.get_native_ref() { true } else { false }
976 impl Clone for InitFeatures {
977 fn clone(&self) -> Self {
979 inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
980 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
986 /// Used only if an object of this type is returned as a trait impl by a method
987 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
988 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
991 /// Creates a copy of the InitFeatures
992 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
995 impl Clone for NodeFeatures {
996 fn clone(&self) -> Self {
998 inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
999 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1005 /// Used only if an object of this type is returned as a trait impl by a method
1006 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1007 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
1010 /// Creates a copy of the NodeFeatures
1011 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1014 impl Clone for ChannelFeatures {
1015 fn clone(&self) -> Self {
1017 inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1018 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1024 /// Used only if an object of this type is returned as a trait impl by a method
1025 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1026 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
1029 /// Creates a copy of the ChannelFeatures
1030 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1033 impl Clone for InvoiceFeatures {
1034 fn clone(&self) -> Self {
1036 inner: if <*mut nativeInvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1037 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1043 /// Used only if an object of this type is returned as a trait impl by a method
1044 pub(crate) extern "C" fn InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1045 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceFeatures)).clone() })) as *mut c_void
1048 /// Creates a copy of the InvoiceFeatures
1049 pub extern "C" fn InvoiceFeatures_clone(orig: &InvoiceFeatures) -> InvoiceFeatures {
1052 impl Clone for ChannelTypeFeatures {
1053 fn clone(&self) -> Self {
1055 inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1056 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1062 /// Used only if an object of this type is returned as a trait impl by a method
1063 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1064 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
1067 /// Creates a copy of the ChannelTypeFeatures
1068 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1072 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1073 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1075 /// Features used within an `init` message.
1078 pub struct InitFeatures {
1079 /// A pointer to the opaque Rust object.
1081 /// Nearly everywhere, inner must be non-null, however in places where
1082 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1083 pub inner: *mut nativeInitFeatures,
1084 /// Indicates that this is the only struct which contains the same pointer.
1086 /// Rust functions which take ownership of an object provided via an argument require
1087 /// this to be true and invalidate the object pointed to by inner.
1091 impl Drop for InitFeatures {
1092 fn drop(&mut self) {
1093 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1094 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1098 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1100 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1102 /// Used only if an object of this type is returned as a trait impl by a method
1103 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1104 unsafe { let _ = Box::from_raw(this_ptr as *mut nativeInitFeatures); }
1108 pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1109 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1111 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1112 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1114 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1115 pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1116 assert!(self.is_owned);
1117 let ret = ObjOps::untweak_ptr(self.inner);
1118 self.inner = core::ptr::null_mut();
1123 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1124 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1126 /// Features used within a `node_announcement` message.
1129 pub struct NodeFeatures {
1130 /// A pointer to the opaque Rust object.
1132 /// Nearly everywhere, inner must be non-null, however in places where
1133 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1134 pub inner: *mut nativeNodeFeatures,
1135 /// Indicates that this is the only struct which contains the same pointer.
1137 /// Rust functions which take ownership of an object provided via an argument require
1138 /// this to be true and invalidate the object pointed to by inner.
1142 impl Drop for NodeFeatures {
1143 fn drop(&mut self) {
1144 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1145 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1149 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1151 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1153 /// Used only if an object of this type is returned as a trait impl by a method
1154 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1155 unsafe { let _ = Box::from_raw(this_ptr as *mut nativeNodeFeatures); }
1159 pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1160 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1162 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1163 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1165 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1166 pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1167 assert!(self.is_owned);
1168 let ret = ObjOps::untweak_ptr(self.inner);
1169 self.inner = core::ptr::null_mut();
1174 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1175 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1177 /// Features used within a `channel_announcement` message.
1180 pub struct ChannelFeatures {
1181 /// A pointer to the opaque Rust object.
1183 /// Nearly everywhere, inner must be non-null, however in places where
1184 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1185 pub inner: *mut nativeChannelFeatures,
1186 /// Indicates that this is the only struct which contains the same pointer.
1188 /// Rust functions which take ownership of an object provided via an argument require
1189 /// this to be true and invalidate the object pointed to by inner.
1193 impl Drop for ChannelFeatures {
1194 fn drop(&mut self) {
1195 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1196 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1200 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1202 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1204 /// Used only if an object of this type is returned as a trait impl by a method
1205 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1206 unsafe { let _ = Box::from_raw(this_ptr as *mut nativeChannelFeatures); }
1209 impl ChannelFeatures {
1210 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1211 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1213 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1214 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1216 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1217 pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1218 assert!(self.is_owned);
1219 let ret = ObjOps::untweak_ptr(self.inner);
1220 self.inner = core::ptr::null_mut();
1225 use lightning::ln::features::InvoiceFeatures as nativeInvoiceFeaturesImport;
1226 pub(crate) type nativeInvoiceFeatures = nativeInvoiceFeaturesImport;
1228 /// Features used within an invoice.
1231 pub struct InvoiceFeatures {
1232 /// A pointer to the opaque Rust object.
1234 /// Nearly everywhere, inner must be non-null, however in places where
1235 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1236 pub inner: *mut nativeInvoiceFeatures,
1237 /// Indicates that this is the only struct which contains the same pointer.
1239 /// Rust functions which take ownership of an object provided via an argument require
1240 /// this to be true and invalidate the object pointed to by inner.
1244 impl Drop for InvoiceFeatures {
1245 fn drop(&mut self) {
1246 if self.is_owned && !<*mut nativeInvoiceFeatures>::is_null(self.inner) {
1247 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1251 /// Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
1253 pub extern "C" fn InvoiceFeatures_free(this_obj: InvoiceFeatures) { }
1255 /// Used only if an object of this type is returned as a trait impl by a method
1256 pub(crate) extern "C" fn InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1257 unsafe { let _ = Box::from_raw(this_ptr as *mut nativeInvoiceFeatures); }
1260 impl InvoiceFeatures {
1261 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceFeatures {
1262 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1264 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceFeatures {
1265 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1267 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1268 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceFeatures {
1269 assert!(self.is_owned);
1270 let ret = ObjOps::untweak_ptr(self.inner);
1271 self.inner = core::ptr::null_mut();
1276 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
1277 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
1279 /// Features used within the channel_type field in an OpenChannel message.
1281 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
1282 /// semantics of our interaction with our peer.
1284 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
1285 /// the counterparty, only required features are allowed here.
1287 /// This is serialized differently from other feature types - it is not prefixed by a length, and
1288 /// thus must only appear inside a TLV where its length is known in advance.
1291 pub struct ChannelTypeFeatures {
1292 /// A pointer to the opaque Rust object.
1294 /// Nearly everywhere, inner must be non-null, however in places where
1295 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1296 pub inner: *mut nativeChannelTypeFeatures,
1297 /// Indicates that this is the only struct which contains the same pointer.
1299 /// Rust functions which take ownership of an object provided via an argument require
1300 /// this to be true and invalidate the object pointed to by inner.
1304 impl Drop for ChannelTypeFeatures {
1305 fn drop(&mut self) {
1306 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
1307 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1311 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
1313 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
1315 /// Used only if an object of this type is returned as a trait impl by a method
1316 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
1317 unsafe { let _ = Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures); }
1320 impl ChannelTypeFeatures {
1321 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
1322 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1324 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
1325 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1327 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1328 pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
1329 assert!(self.is_owned);
1330 let ret = ObjOps::untweak_ptr(self.inner);
1331 self.inner = core::ptr::null_mut();
1335 /// Create a blank Features with no features set
1338 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
1339 let mut ret = lightning::ln::features::InitFeatures::empty();
1340 crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1343 /// Creates a Features with the bits set which are known by the implementation
1346 pub extern "C" fn InitFeatures_known() -> crate::lightning::ln::features::InitFeatures {
1347 let mut ret = lightning::ln::features::InitFeatures::known();
1348 crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1351 /// Returns true if this `Features` object contains unknown feature flags which are set as
1355 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1356 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1360 /// Create a blank Features with no features set
1363 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
1364 let mut ret = lightning::ln::features::NodeFeatures::empty();
1365 crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1368 /// Creates a Features with the bits set which are known by the implementation
1371 pub extern "C" fn NodeFeatures_known() -> crate::lightning::ln::features::NodeFeatures {
1372 let mut ret = lightning::ln::features::NodeFeatures::known();
1373 crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1376 /// Returns true if this `Features` object contains unknown feature flags which are set as
1380 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1381 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1385 /// Create a blank Features with no features set
1388 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
1389 let mut ret = lightning::ln::features::ChannelFeatures::empty();
1390 crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1393 /// Creates a Features with the bits set which are known by the implementation
1396 pub extern "C" fn ChannelFeatures_known() -> crate::lightning::ln::features::ChannelFeatures {
1397 let mut ret = lightning::ln::features::ChannelFeatures::known();
1398 crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1401 /// Returns true if this `Features` object contains unknown feature flags which are set as
1405 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
1406 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1410 /// Create a blank Features with no features set
1413 pub extern "C" fn InvoiceFeatures_empty() -> crate::lightning::ln::features::InvoiceFeatures {
1414 let mut ret = lightning::ln::features::InvoiceFeatures::empty();
1415 crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1418 /// Creates a Features with the bits set which are known by the implementation
1421 pub extern "C" fn InvoiceFeatures_known() -> crate::lightning::ln::features::InvoiceFeatures {
1422 let mut ret = lightning::ln::features::InvoiceFeatures::known();
1423 crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1426 /// Returns true if this `Features` object contains unknown feature flags which are set as
1430 pub extern "C" fn InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1431 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1435 /// Create a blank Features with no features set
1438 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
1439 let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
1440 crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1443 /// Creates a Features with the bits set which are known by the implementation
1446 pub extern "C" fn ChannelTypeFeatures_known() -> crate::lightning::ln::features::ChannelTypeFeatures {
1447 let mut ret = lightning::ln::features::ChannelTypeFeatures::known();
1448 crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1451 /// Returns true if this `Features` object contains unknown feature flags which are set as
1455 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1456 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1461 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
1462 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
1463 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1466 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1467 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
1470 /// Read a InitFeatures from a byte array, created by InitFeatures_write
1471 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
1472 let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1473 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
1477 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
1478 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
1479 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1482 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1483 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
1486 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
1487 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
1488 let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1489 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
1493 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
1494 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
1495 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1498 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1499 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
1502 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
1503 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
1504 let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1505 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
1509 /// Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
1510 pub extern "C" fn InvoiceFeatures_write(obj: &crate::lightning::ln::features::InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
1511 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1514 pub(crate) extern "C" fn InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1515 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceFeatures) })
1518 /// Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
1519 pub extern "C" fn InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InvoiceFeaturesDecodeErrorZ {
1520 let res: Result<lightning::ln::features::InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1521 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
1525 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
1526 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
1527 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1530 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1531 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
1534 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
1535 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
1536 let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1537 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };