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 //! The following features are currently required in the LDK:
22 //! - `VariableLengthOnion` - requires/supports variable-length routing onion payloads
23 //! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for more information).
24 //! - `StaticRemoteKey` - requires/supports static key for remote output
25 //! (see [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more information).
27 //! The following features are currently supported in the LDK:
28 //! - `DataLossProtect` - requires/supports that a node which has somehow fallen behind, e.g., has been restored from an old backup,
29 //! can detect that it has fallen behind
30 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
31 //! - `InitialRoutingSync` - requires/supports that the sending node needs a complete routing information dump
32 //! (see [BOLT-7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#initial-sync) for more information).
33 //! - `UpfrontShutdownScript` - commits to a shutdown scriptpubkey when opening a channel
34 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message) for more information).
35 //! - `GossipQueries` - requires/supports more sophisticated gossip control
36 //! (see [BOLT-7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md) for more information).
37 //! - `PaymentSecret` - requires/supports that a node supports payment_secret field
38 //! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for more information).
39 //! - `BasicMPP` - requires/supports that a node can receive basic multi-part payments
40 //! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#basic-multi-part-payments) for more information).
41 //! - `ShutdownAnySegwit` - requires/supports that future segwit versions are allowed in `shutdown`
42 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
43 //! - `ChannelType` - node supports the channel_type field in open/accept
44 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
45 //! - `SCIDPrivacy` - supply channel aliases for routing
46 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
47 //! - `Keysend` - send funds to a node without an invoice
48 //! (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
50 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
51 //! [messages]: crate::ln::msgs
53 use alloc::str::FromStr;
54 use core::ffi::c_void;
55 use core::convert::Infallible;
56 use bitcoin::hashes::Hash;
57 use crate::c_types::*;
58 #[cfg(feature="no-std")]
59 use alloc::{vec::Vec, boxed::Box};
63 use alloc::str::FromStr;
64 use core::ffi::c_void;
65 use core::convert::Infallible;
66 use bitcoin::hashes::Hash;
67 use crate::c_types::*;
68 #[cfg(feature="no-std")]
69 use alloc::{vec::Vec, boxed::Box};
71 /// Set this feature as optional.
73 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
74 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_optional()
77 /// Set this feature as required.
79 pub extern "C" fn InitFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
80 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_required()
83 /// Checks if this feature is supported.
86 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
87 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
91 /// Set this feature as optional.
93 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
94 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_optional()
97 /// Set this feature as required.
99 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
100 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_required()
103 /// Checks if this feature is supported.
106 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
107 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
111 /// Checks if this feature is required.
114 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
115 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
119 /// Checks if this feature is required.
122 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
123 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
127 /// Set this feature as optional.
129 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
130 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_optional()
133 /// Set this feature as required.
135 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
136 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_required()
139 /// Checks if this feature is supported.
142 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
143 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
147 /// Set this feature as optional.
149 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
150 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_optional()
153 /// Set this feature as required.
155 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
156 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_required()
159 /// Checks if this feature is supported.
162 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
163 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
167 /// Set this feature as optional.
169 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
170 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_optional()
173 /// Set this feature as required.
175 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
176 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_required()
179 /// Checks if this feature is supported.
182 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
183 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
187 /// Checks if this feature is required.
190 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
191 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
195 /// Checks if this feature is required.
198 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
199 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
203 /// Set this feature as optional.
205 pub extern "C" fn InitFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
206 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_optional()
209 /// Set this feature as required.
211 pub extern "C" fn InitFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
212 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_required()
215 /// Checks if this feature is supported.
218 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
219 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
223 /// Set this feature as optional.
225 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
226 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_optional()
229 /// Set this feature as required.
231 pub extern "C" fn NodeFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
232 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_required()
235 /// Checks if this feature is supported.
238 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
239 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
243 /// Checks if this feature is required.
246 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
247 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
251 /// Checks if this feature is required.
254 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
255 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
259 /// Set this feature as optional.
261 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
262 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_optional()
265 /// Set this feature as required.
267 pub extern "C" fn InitFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
268 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_required()
271 /// Checks if this feature is supported.
274 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
275 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
279 /// Set this feature as optional.
281 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
282 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_optional()
285 /// Set this feature as required.
287 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
288 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_required()
291 /// Checks if this feature is supported.
294 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
295 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
299 /// Set this feature as optional.
301 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
302 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_optional()
305 /// Set this feature as required.
307 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
308 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_required()
311 /// Checks if this feature is supported.
314 pub extern "C" fn InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
315 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
319 /// Checks if this feature is required.
322 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
323 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
327 /// Checks if this feature is required.
330 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
331 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
335 /// Checks if this feature is required.
338 pub extern "C" fn InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
339 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
343 /// Set this feature as optional.
345 pub extern "C" fn InitFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
346 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_optional()
349 /// Set this feature as required.
351 pub extern "C" fn InitFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
352 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_required()
355 /// Checks if this feature is supported.
358 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
359 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
363 /// Set this feature as optional.
365 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
366 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_optional()
369 /// Set this feature as required.
371 pub extern "C" fn NodeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
372 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_required()
375 /// Checks if this feature is supported.
378 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
379 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
383 /// Set this feature as optional.
385 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
386 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_optional()
389 /// Set this feature as required.
391 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
392 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_required()
395 /// Checks if this feature is supported.
398 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
399 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
403 /// Checks if this feature is required.
406 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
407 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
411 /// Checks if this feature is required.
414 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
415 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
419 /// Checks if this feature is required.
422 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
423 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
427 /// Set this feature as optional.
429 pub extern "C" fn InitFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
430 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_optional()
433 /// Set this feature as required.
435 pub extern "C" fn InitFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
436 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_required()
439 /// Checks if this feature is supported.
442 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
443 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
447 /// Set this feature as optional.
449 pub extern "C" fn NodeFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
450 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_optional()
453 /// Set this feature as required.
455 pub extern "C" fn NodeFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
456 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_required()
459 /// Checks if this feature is supported.
462 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
463 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
467 /// Set this feature as optional.
469 pub extern "C" fn InvoiceFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
470 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_optional()
473 /// Set this feature as required.
475 pub extern "C" fn InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
476 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_required()
479 /// Checks if this feature is supported.
482 pub extern "C" fn InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
483 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
487 /// Checks if this feature is required.
490 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
491 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
495 /// Checks if this feature is required.
498 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
499 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
503 /// Checks if this feature is required.
506 pub extern "C" fn InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
507 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
511 /// Set this feature as optional.
513 pub extern "C" fn InitFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
514 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_optional()
517 /// Set this feature as required.
519 pub extern "C" fn InitFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
520 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_required()
523 /// Checks if this feature is supported.
526 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
527 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
531 /// Set this feature as optional.
533 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
534 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_optional()
537 /// Set this feature as required.
539 pub extern "C" fn NodeFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
540 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_required()
543 /// Checks if this feature is supported.
546 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
547 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
551 /// Set this feature as optional.
553 pub extern "C" fn InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
554 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_optional()
557 /// Set this feature as required.
559 pub extern "C" fn InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
560 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_required()
563 /// Checks if this feature is supported.
566 pub extern "C" fn InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
567 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
571 /// Checks if this feature is required.
574 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
575 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
579 /// Checks if this feature is required.
582 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
583 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
587 /// Checks if this feature is required.
590 pub extern "C" fn InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
591 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
595 /// Set this feature as optional.
597 pub extern "C" fn InitFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
598 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_optional()
601 /// Set this feature as required.
603 pub extern "C" fn InitFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
604 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_required()
607 /// Checks if this feature is supported.
610 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
611 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
615 /// Set this feature as optional.
617 pub extern "C" fn NodeFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
618 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_optional()
621 /// Set this feature as required.
623 pub extern "C" fn NodeFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
624 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_required()
627 /// Checks if this feature is supported.
630 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
631 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
635 /// Checks if this feature is required.
638 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
639 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
643 /// Checks if this feature is required.
646 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
647 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
651 /// Set this feature as optional.
653 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
654 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_optional()
657 /// Set this feature as required.
659 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
660 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_required()
663 /// Checks if this feature is supported.
666 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
667 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
671 /// Set this feature as optional.
673 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
674 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_optional()
677 /// Set this feature as required.
679 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
680 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_required()
683 /// Checks if this feature is supported.
686 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
687 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
691 /// Checks if this feature is required.
694 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
695 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
699 /// Checks if this feature is required.
702 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
703 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
707 /// Set this feature as optional.
709 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
710 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
713 /// Set this feature as required.
715 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
716 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
719 /// Checks if this feature is supported.
722 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
723 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
727 /// Set this feature as optional.
729 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
730 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
733 /// Set this feature as required.
735 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
736 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
739 /// Checks if this feature is supported.
742 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
743 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
747 /// Checks if this feature is required.
750 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
751 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
755 /// Checks if this feature is required.
758 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
759 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
763 /// Set this feature as optional.
765 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
766 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
769 /// Set this feature as required.
771 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
772 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
775 /// Checks if this feature is supported.
778 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
779 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
783 /// Set this feature as optional.
785 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
786 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
789 /// Set this feature as required.
791 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
792 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
795 /// Checks if this feature is supported.
798 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
799 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
803 /// Set this feature as optional.
805 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
806 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
809 /// Set this feature as required.
811 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
812 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
815 /// Checks if this feature is supported.
818 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
819 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
823 /// Checks if this feature is required.
826 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
827 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
831 /// Checks if this feature is required.
834 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
835 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
839 /// Checks if this feature is required.
842 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
843 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
847 /// Set this feature as optional.
849 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
850 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
853 /// Set this feature as required.
855 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
856 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
859 /// Checks if this feature is supported.
862 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
863 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
867 /// Set this feature as optional.
869 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
870 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
873 /// Set this feature as required.
875 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
876 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
879 /// Checks if this feature is supported.
882 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
883 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
887 /// Set this feature as optional.
889 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
890 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
893 /// Set this feature as required.
895 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
896 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
899 /// Checks if this feature is supported.
902 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
903 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
907 /// Checks if this feature is required.
910 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
911 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
915 /// Checks if this feature is required.
918 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
919 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
923 /// Checks if this feature is required.
926 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
927 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
931 /// Set this feature as optional.
933 pub extern "C" fn NodeFeatures_set_keysend_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
934 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_optional()
937 /// Set this feature as required.
939 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
940 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
943 /// Checks if this feature is supported.
946 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
947 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
951 /// Checks if this feature is required.
954 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
955 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
960 /// Checks if two InitFeaturess contain equal inner contents.
961 /// This ignores pointers and is_owned flags and looks at the values in fields.
962 /// Two objects with NULL inner values will be considered "equal" here.
964 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
965 if a.inner == b.inner { return true; }
966 if a.inner.is_null() || b.inner.is_null() { return false; }
967 if a.get_native_ref() == b.get_native_ref() { true } else { false }
969 /// Checks if two NodeFeaturess contain equal inner contents.
970 /// This ignores pointers and is_owned flags and looks at the values in fields.
971 /// Two objects with NULL inner values will be considered "equal" here.
973 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
974 if a.inner == b.inner { return true; }
975 if a.inner.is_null() || b.inner.is_null() { return false; }
976 if a.get_native_ref() == b.get_native_ref() { true } else { false }
978 /// Checks if two ChannelFeaturess contain equal inner contents.
979 /// This ignores pointers and is_owned flags and looks at the values in fields.
980 /// Two objects with NULL inner values will be considered "equal" here.
982 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
983 if a.inner == b.inner { return true; }
984 if a.inner.is_null() || b.inner.is_null() { return false; }
985 if a.get_native_ref() == b.get_native_ref() { true } else { false }
987 /// Checks if two InvoiceFeaturess contain equal inner contents.
988 /// This ignores pointers and is_owned flags and looks at the values in fields.
989 /// Two objects with NULL inner values will be considered "equal" here.
991 pub extern "C" fn InvoiceFeatures_eq(a: &InvoiceFeatures, b: &InvoiceFeatures) -> bool {
992 if a.inner == b.inner { return true; }
993 if a.inner.is_null() || b.inner.is_null() { return false; }
994 if a.get_native_ref() == b.get_native_ref() { true } else { false }
996 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
997 /// This ignores pointers and is_owned flags and looks at the values in fields.
998 /// Two objects with NULL inner values will be considered "equal" here.
1000 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
1001 if a.inner == b.inner { return true; }
1002 if a.inner.is_null() || b.inner.is_null() { return false; }
1003 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1005 impl Clone for InitFeatures {
1006 fn clone(&self) -> Self {
1008 inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1009 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1015 /// Used only if an object of this type is returned as a trait impl by a method
1016 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1017 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
1020 /// Creates a copy of the InitFeatures
1021 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1024 impl Clone for NodeFeatures {
1025 fn clone(&self) -> Self {
1027 inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1028 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1034 /// Used only if an object of this type is returned as a trait impl by a method
1035 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1036 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
1039 /// Creates a copy of the NodeFeatures
1040 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1043 impl Clone for ChannelFeatures {
1044 fn clone(&self) -> Self {
1046 inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1047 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1053 /// Used only if an object of this type is returned as a trait impl by a method
1054 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1055 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
1058 /// Creates a copy of the ChannelFeatures
1059 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1062 impl Clone for InvoiceFeatures {
1063 fn clone(&self) -> Self {
1065 inner: if <*mut nativeInvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1066 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1072 /// Used only if an object of this type is returned as a trait impl by a method
1073 pub(crate) extern "C" fn InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1074 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceFeatures)).clone() })) as *mut c_void
1077 /// Creates a copy of the InvoiceFeatures
1078 pub extern "C" fn InvoiceFeatures_clone(orig: &InvoiceFeatures) -> InvoiceFeatures {
1081 impl Clone for ChannelTypeFeatures {
1082 fn clone(&self) -> Self {
1084 inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1085 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1091 /// Used only if an object of this type is returned as a trait impl by a method
1092 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1093 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
1096 /// Creates a copy of the ChannelTypeFeatures
1097 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1101 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1102 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1104 /// Features used within an `init` message.
1107 pub struct InitFeatures {
1108 /// A pointer to the opaque Rust object.
1110 /// Nearly everywhere, inner must be non-null, however in places where
1111 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1112 pub inner: *mut nativeInitFeatures,
1113 /// Indicates that this is the only struct which contains the same pointer.
1115 /// Rust functions which take ownership of an object provided via an argument require
1116 /// this to be true and invalidate the object pointed to by inner.
1120 impl Drop for InitFeatures {
1121 fn drop(&mut self) {
1122 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1123 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1127 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1129 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1131 /// Used only if an object of this type is returned as a trait impl by a method
1132 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1133 unsafe { let _ = Box::from_raw(this_ptr as *mut nativeInitFeatures); }
1137 pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1138 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1140 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1141 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1143 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1144 pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1145 assert!(self.is_owned);
1146 let ret = ObjOps::untweak_ptr(self.inner);
1147 self.inner = core::ptr::null_mut();
1152 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1153 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1155 /// Features used within a `node_announcement` message.
1158 pub struct NodeFeatures {
1159 /// A pointer to the opaque Rust object.
1161 /// Nearly everywhere, inner must be non-null, however in places where
1162 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1163 pub inner: *mut nativeNodeFeatures,
1164 /// Indicates that this is the only struct which contains the same pointer.
1166 /// Rust functions which take ownership of an object provided via an argument require
1167 /// this to be true and invalidate the object pointed to by inner.
1171 impl Drop for NodeFeatures {
1172 fn drop(&mut self) {
1173 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1174 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1178 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1180 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1182 /// Used only if an object of this type is returned as a trait impl by a method
1183 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1184 unsafe { let _ = Box::from_raw(this_ptr as *mut nativeNodeFeatures); }
1188 pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1189 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1191 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1192 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1194 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1195 pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1196 assert!(self.is_owned);
1197 let ret = ObjOps::untweak_ptr(self.inner);
1198 self.inner = core::ptr::null_mut();
1203 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1204 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1206 /// Features used within a `channel_announcement` message.
1209 pub struct ChannelFeatures {
1210 /// A pointer to the opaque Rust object.
1212 /// Nearly everywhere, inner must be non-null, however in places where
1213 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1214 pub inner: *mut nativeChannelFeatures,
1215 /// Indicates that this is the only struct which contains the same pointer.
1217 /// Rust functions which take ownership of an object provided via an argument require
1218 /// this to be true and invalidate the object pointed to by inner.
1222 impl Drop for ChannelFeatures {
1223 fn drop(&mut self) {
1224 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1225 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1229 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1231 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1233 /// Used only if an object of this type is returned as a trait impl by a method
1234 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1235 unsafe { let _ = Box::from_raw(this_ptr as *mut nativeChannelFeatures); }
1238 impl ChannelFeatures {
1239 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1240 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1242 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1243 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1245 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1246 pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1247 assert!(self.is_owned);
1248 let ret = ObjOps::untweak_ptr(self.inner);
1249 self.inner = core::ptr::null_mut();
1254 use lightning::ln::features::InvoiceFeatures as nativeInvoiceFeaturesImport;
1255 pub(crate) type nativeInvoiceFeatures = nativeInvoiceFeaturesImport;
1257 /// Features used within an invoice.
1260 pub struct InvoiceFeatures {
1261 /// A pointer to the opaque Rust object.
1263 /// Nearly everywhere, inner must be non-null, however in places where
1264 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1265 pub inner: *mut nativeInvoiceFeatures,
1266 /// Indicates that this is the only struct which contains the same pointer.
1268 /// Rust functions which take ownership of an object provided via an argument require
1269 /// this to be true and invalidate the object pointed to by inner.
1273 impl Drop for InvoiceFeatures {
1274 fn drop(&mut self) {
1275 if self.is_owned && !<*mut nativeInvoiceFeatures>::is_null(self.inner) {
1276 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1280 /// Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
1282 pub extern "C" fn InvoiceFeatures_free(this_obj: InvoiceFeatures) { }
1284 /// Used only if an object of this type is returned as a trait impl by a method
1285 pub(crate) extern "C" fn InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1286 unsafe { let _ = Box::from_raw(this_ptr as *mut nativeInvoiceFeatures); }
1289 impl InvoiceFeatures {
1290 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceFeatures {
1291 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1293 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceFeatures {
1294 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1296 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1297 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceFeatures {
1298 assert!(self.is_owned);
1299 let ret = ObjOps::untweak_ptr(self.inner);
1300 self.inner = core::ptr::null_mut();
1305 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
1306 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
1308 /// Features used within the channel_type field in an OpenChannel message.
1310 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
1311 /// semantics of our interaction with our peer.
1313 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
1314 /// the counterparty, only required features are allowed here.
1316 /// This is serialized differently from other feature types - it is not prefixed by a length, and
1317 /// thus must only appear inside a TLV where its length is known in advance.
1320 pub struct ChannelTypeFeatures {
1321 /// A pointer to the opaque Rust object.
1323 /// Nearly everywhere, inner must be non-null, however in places where
1324 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1325 pub inner: *mut nativeChannelTypeFeatures,
1326 /// Indicates that this is the only struct which contains the same pointer.
1328 /// Rust functions which take ownership of an object provided via an argument require
1329 /// this to be true and invalidate the object pointed to by inner.
1333 impl Drop for ChannelTypeFeatures {
1334 fn drop(&mut self) {
1335 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
1336 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1340 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
1342 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
1344 /// Used only if an object of this type is returned as a trait impl by a method
1345 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
1346 unsafe { let _ = Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures); }
1349 impl ChannelTypeFeatures {
1350 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
1351 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1353 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
1354 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1356 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1357 pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
1358 assert!(self.is_owned);
1359 let ret = ObjOps::untweak_ptr(self.inner);
1360 self.inner = core::ptr::null_mut();
1364 /// Create a blank Features with no features set
1367 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
1368 let mut ret = lightning::ln::features::InitFeatures::empty();
1369 crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1372 /// Creates a Features with the bits set which are known by the implementation
1375 pub extern "C" fn InitFeatures_known() -> crate::lightning::ln::features::InitFeatures {
1376 let mut ret = lightning::ln::features::InitFeatures::known();
1377 crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1380 /// Returns true if this `Features` object contains unknown feature flags which are set as
1384 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1385 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1389 /// Create a blank Features with no features set
1392 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
1393 let mut ret = lightning::ln::features::NodeFeatures::empty();
1394 crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1397 /// Creates a Features with the bits set which are known by the implementation
1400 pub extern "C" fn NodeFeatures_known() -> crate::lightning::ln::features::NodeFeatures {
1401 let mut ret = lightning::ln::features::NodeFeatures::known();
1402 crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1405 /// Returns true if this `Features` object contains unknown feature flags which are set as
1409 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1410 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1414 /// Create a blank Features with no features set
1417 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
1418 let mut ret = lightning::ln::features::ChannelFeatures::empty();
1419 crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1422 /// Creates a Features with the bits set which are known by the implementation
1425 pub extern "C" fn ChannelFeatures_known() -> crate::lightning::ln::features::ChannelFeatures {
1426 let mut ret = lightning::ln::features::ChannelFeatures::known();
1427 crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1430 /// Returns true if this `Features` object contains unknown feature flags which are set as
1434 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
1435 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1439 /// Create a blank Features with no features set
1442 pub extern "C" fn InvoiceFeatures_empty() -> crate::lightning::ln::features::InvoiceFeatures {
1443 let mut ret = lightning::ln::features::InvoiceFeatures::empty();
1444 crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1447 /// Creates a Features with the bits set which are known by the implementation
1450 pub extern "C" fn InvoiceFeatures_known() -> crate::lightning::ln::features::InvoiceFeatures {
1451 let mut ret = lightning::ln::features::InvoiceFeatures::known();
1452 crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1455 /// Returns true if this `Features` object contains unknown feature flags which are set as
1459 pub extern "C" fn InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1460 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1464 /// Create a blank Features with no features set
1467 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
1468 let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
1469 crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1472 /// Creates a Features with the bits set which are known by the implementation
1475 pub extern "C" fn ChannelTypeFeatures_known() -> crate::lightning::ln::features::ChannelTypeFeatures {
1476 let mut ret = lightning::ln::features::ChannelTypeFeatures::known();
1477 crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1480 /// Returns true if this `Features` object contains unknown feature flags which are set as
1484 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1485 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1490 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
1491 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
1492 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1495 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1496 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
1499 /// Read a InitFeatures from a byte array, created by InitFeatures_write
1500 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
1501 let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1502 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() };
1506 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
1507 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
1508 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1511 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1512 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
1515 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
1516 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
1517 let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1518 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() };
1522 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
1523 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
1524 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1527 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1528 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
1531 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
1532 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
1533 let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1534 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() };
1538 /// Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
1539 pub extern "C" fn InvoiceFeatures_write(obj: &crate::lightning::ln::features::InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
1540 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1543 pub(crate) extern "C" fn InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1544 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceFeatures) })
1547 /// Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
1548 pub extern "C" fn InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InvoiceFeaturesDecodeErrorZ {
1549 let res: Result<lightning::ln::features::InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1550 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() };
1554 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
1555 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
1556 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1559 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1560 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
1563 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
1564 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
1565 let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1566 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() };