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 //! - `Wumbo` - requires/supports that a node create large channels. Called `option_support_large_channel` in the spec.
42 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message) for more information).
43 //! - `ShutdownAnySegwit` - requires/supports that future segwit versions are allowed in `shutdown`
44 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
45 //! - `OnionMessages` - requires/supports forwarding onion messages
46 //! (see [BOLT-7](https://github.com/lightning/bolts/pull/759/files) for more information).
48 //! - `ChannelType` - node supports the channel_type field in open/accept
49 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
50 //! - `SCIDPrivacy` - supply channel aliases for routing
51 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
52 //! - `Keysend` - send funds to a node without an invoice
53 //! (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
54 //! - `AnchorsZeroFeeHtlcTx` - requires/supports that commitment transactions include anchor outputs
55 //! and HTLC transactions are pre-signed with zero fee (see
56 //! [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more
59 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
60 //! [messages]: crate::ln::msgs
62 use alloc::str::FromStr;
63 use core::ffi::c_void;
64 use core::convert::Infallible;
65 use bitcoin::hashes::Hash;
66 use crate::c_types::*;
67 #[cfg(feature="no-std")]
68 use alloc::{vec::Vec, boxed::Box};
72 use alloc::str::FromStr;
73 use core::ffi::c_void;
74 use core::convert::Infallible;
75 use bitcoin::hashes::Hash;
76 use crate::c_types::*;
77 #[cfg(feature="no-std")]
78 use alloc::{vec::Vec, boxed::Box};
80 /// Set this feature as optional.
82 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
83 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_optional()
86 /// Set this feature as required.
88 pub extern "C" fn InitFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
89 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_required()
92 /// Checks if this feature is supported.
95 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
96 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
100 /// Set this feature as optional.
102 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
103 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_optional()
106 /// Set this feature as required.
108 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
109 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_required()
112 /// Checks if this feature is supported.
115 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
116 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
120 /// Checks if this feature is required.
123 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
124 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
128 /// Checks if this feature is required.
131 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
132 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
136 /// Set this feature as optional.
138 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
139 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_optional()
142 /// Set this feature as required.
144 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
145 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_required()
148 /// Checks if this feature is supported.
151 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
152 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
156 /// Set this feature as optional.
158 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
159 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_optional()
162 /// Set this feature as required.
164 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
165 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_required()
168 /// Checks if this feature is supported.
171 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
172 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
176 /// Set this feature as optional.
178 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
179 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_optional()
182 /// Set this feature as required.
184 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
185 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_required()
188 /// Checks if this feature is supported.
191 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
192 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
196 /// Checks if this feature is required.
199 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
200 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
204 /// Checks if this feature is required.
207 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
208 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
212 /// Set this feature as optional.
214 pub extern "C" fn InitFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
215 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_optional()
218 /// Set this feature as required.
220 pub extern "C" fn InitFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
221 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_required()
224 /// Checks if this feature is supported.
227 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
228 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
232 /// Set this feature as optional.
234 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
235 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_optional()
238 /// Set this feature as required.
240 pub extern "C" fn NodeFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
241 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_required()
244 /// Checks if this feature is supported.
247 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
248 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
252 /// Checks if this feature is required.
255 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
256 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
260 /// Checks if this feature is required.
263 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
264 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
268 /// Set this feature as optional.
270 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
271 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_optional()
274 /// Set this feature as required.
276 pub extern "C" fn InitFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
277 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_required()
280 /// Checks if this feature is supported.
283 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
284 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
288 /// Set this feature as optional.
290 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
291 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_optional()
294 /// Set this feature as required.
296 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
297 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_required()
300 /// Checks if this feature is supported.
303 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
304 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
308 /// Set this feature as optional.
310 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
311 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_optional()
314 /// Set this feature as required.
316 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
317 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_required()
320 /// Checks if this feature is supported.
323 pub extern "C" fn InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
324 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
328 /// Checks if this feature is required.
331 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
332 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
336 /// Checks if this feature is required.
339 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
340 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
344 /// Checks if this feature is required.
347 pub extern "C" fn InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
348 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
352 /// Set this feature as optional.
354 pub extern "C" fn InitFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
355 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_optional()
358 /// Set this feature as required.
360 pub extern "C" fn InitFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
361 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_required()
364 /// Checks if this feature is supported.
367 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
368 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
372 /// Set this feature as optional.
374 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
375 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_optional()
378 /// Set this feature as required.
380 pub extern "C" fn NodeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
381 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_required()
384 /// Checks if this feature is supported.
387 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
388 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
392 /// Set this feature as optional.
394 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
395 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_optional()
398 /// Set this feature as required.
400 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
401 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_required()
404 /// Checks if this feature is supported.
407 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
408 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
412 /// Checks if this feature is required.
415 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
416 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
420 /// Checks if this feature is required.
423 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
424 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
428 /// Checks if this feature is required.
431 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
432 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
436 /// Set this feature as optional.
438 pub extern "C" fn InitFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
439 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_optional()
442 /// Set this feature as required.
444 pub extern "C" fn InitFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
445 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_required()
448 /// Checks if this feature is supported.
451 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
452 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
456 /// Set this feature as optional.
458 pub extern "C" fn NodeFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
459 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_optional()
462 /// Set this feature as required.
464 pub extern "C" fn NodeFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
465 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_required()
468 /// Checks if this feature is supported.
471 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
472 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
476 /// Set this feature as optional.
478 pub extern "C" fn InvoiceFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
479 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_optional()
482 /// Set this feature as required.
484 pub extern "C" fn InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
485 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_required()
488 /// Checks if this feature is supported.
491 pub extern "C" fn InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
492 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
496 /// Checks if this feature is required.
499 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
500 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
504 /// Checks if this feature is required.
507 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
508 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
512 /// Checks if this feature is required.
515 pub extern "C" fn InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
516 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
520 /// Set this feature as optional.
522 pub extern "C" fn InitFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
523 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_optional()
526 /// Set this feature as required.
528 pub extern "C" fn InitFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
529 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_required()
532 /// Checks if this feature is supported.
535 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
536 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
540 /// Set this feature as optional.
542 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
543 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_optional()
546 /// Set this feature as required.
548 pub extern "C" fn NodeFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
549 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_required()
552 /// Checks if this feature is supported.
555 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
556 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
560 /// Set this feature as optional.
562 pub extern "C" fn InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
563 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_optional()
566 /// Set this feature as required.
568 pub extern "C" fn InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
569 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_required()
572 /// Checks if this feature is supported.
575 pub extern "C" fn InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
576 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
580 /// Set this feature as optional.
582 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
583 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_optional()
586 /// Set this feature as required.
588 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
589 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_required()
592 /// Checks if this feature is supported.
595 pub extern "C" fn Bolt12InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
596 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
600 /// Checks if this feature is required.
603 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
604 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
608 /// Checks if this feature is required.
611 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
612 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
616 /// Checks if this feature is required.
619 pub extern "C" fn InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
620 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
624 /// Checks if this feature is required.
627 pub extern "C" fn Bolt12InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
628 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
632 /// Set this feature as optional.
634 pub extern "C" fn InitFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
635 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_optional()
638 /// Set this feature as required.
640 pub extern "C" fn InitFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
641 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_required()
644 /// Checks if this feature is supported.
647 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
648 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
652 /// Set this feature as optional.
654 pub extern "C" fn NodeFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
655 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_optional()
658 /// Set this feature as required.
660 pub extern "C" fn NodeFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
661 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_required()
664 /// Checks if this feature is supported.
667 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
668 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
672 /// Checks if this feature is required.
675 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
676 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
680 /// Checks if this feature is required.
683 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
684 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
688 /// Set this feature as optional.
690 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
691 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
694 /// Set this feature as required.
696 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
697 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
700 /// Checks if this feature is supported.
703 pub extern "C" fn InitFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
704 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
708 /// Set this feature as optional.
710 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
711 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
714 /// Set this feature as required.
716 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
717 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
720 /// Checks if this feature is supported.
723 pub extern "C" fn NodeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
724 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
728 /// Set this feature as optional.
730 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
731 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
734 /// Set this feature as required.
736 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
737 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
740 /// Checks if this feature is supported.
743 pub extern "C" fn ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
744 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
748 /// Checks if this feature is required.
751 pub extern "C" fn InitFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
752 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
756 /// Checks if this feature is required.
759 pub extern "C" fn NodeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
760 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
764 /// Checks if this feature is required.
767 pub extern "C" fn ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
768 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
772 /// Set this feature as optional.
774 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
775 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_optional()
778 /// Set this feature as required.
780 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
781 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_required()
784 /// Checks if this feature is supported.
787 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
788 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
792 /// Set this feature as optional.
794 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
795 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_optional()
798 /// Set this feature as required.
800 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
801 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_required()
804 /// Checks if this feature is supported.
807 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
808 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
812 /// Checks if this feature is required.
815 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
816 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
820 /// Checks if this feature is required.
823 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
824 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
828 /// Set this feature as optional.
830 pub extern "C" fn InitFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
831 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_optional()
834 /// Set this feature as required.
836 pub extern "C" fn InitFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
837 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_required()
840 /// Checks if this feature is supported.
843 pub extern "C" fn InitFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
844 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
848 /// Set this feature as optional.
850 pub extern "C" fn NodeFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
851 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_optional()
854 /// Set this feature as required.
856 pub extern "C" fn NodeFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
857 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_required()
860 /// Checks if this feature is supported.
863 pub extern "C" fn NodeFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
864 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
868 /// Checks if this feature is required.
871 pub extern "C" fn InitFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
872 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
876 /// Checks if this feature is required.
879 pub extern "C" fn NodeFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
880 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
884 /// Set this feature as optional.
886 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
887 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
890 /// Set this feature as required.
892 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
893 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
896 /// Checks if this feature is supported.
899 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
900 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
904 /// Set this feature as optional.
906 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
907 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
910 /// Set this feature as required.
912 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
913 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
916 /// Checks if this feature is supported.
919 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
920 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
924 /// Checks if this feature is required.
927 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
928 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
932 /// Checks if this feature is required.
935 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
936 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
940 /// Set this feature as optional.
942 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
943 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
946 /// Set this feature as required.
948 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
949 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
952 /// Checks if this feature is supported.
955 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
956 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
960 /// Set this feature as optional.
962 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
963 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
966 /// Set this feature as required.
968 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
969 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
972 /// Checks if this feature is supported.
975 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
976 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
980 /// Set this feature as optional.
982 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
983 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
986 /// Set this feature as required.
988 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
989 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
992 /// Checks if this feature is supported.
995 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
996 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1000 /// Checks if this feature is required.
1003 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1004 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1008 /// Checks if this feature is required.
1011 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1012 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1016 /// Checks if this feature is required.
1019 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1020 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1024 /// Set this feature as optional.
1026 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1027 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
1030 /// Set this feature as required.
1032 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1033 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
1036 /// Checks if this feature is supported.
1039 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1040 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1044 /// Set this feature as optional.
1046 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1047 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
1050 /// Set this feature as required.
1052 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1053 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
1056 /// Checks if this feature is supported.
1059 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1060 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1064 /// Set this feature as optional.
1066 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1067 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
1070 /// Set this feature as required.
1072 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1073 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
1076 /// Checks if this feature is supported.
1079 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1080 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1084 /// Checks if this feature is required.
1087 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1088 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1092 /// Checks if this feature is required.
1095 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1096 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1100 /// Checks if this feature is required.
1103 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1104 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1108 /// Set this feature as optional.
1110 pub extern "C" fn NodeFeatures_set_keysend_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1111 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_optional()
1114 /// Set this feature as required.
1116 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1117 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
1120 /// Checks if this feature is supported.
1123 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1124 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
1128 /// Checks if this feature is required.
1131 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1132 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
1137 /// Checks if two InitFeaturess contain equal inner contents.
1138 /// This ignores pointers and is_owned flags and looks at the values in fields.
1139 /// Two objects with NULL inner values will be considered "equal" here.
1141 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
1142 if a.inner == b.inner { return true; }
1143 if a.inner.is_null() || b.inner.is_null() { return false; }
1144 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1146 /// Checks if two NodeFeaturess contain equal inner contents.
1147 /// This ignores pointers and is_owned flags and looks at the values in fields.
1148 /// Two objects with NULL inner values will be considered "equal" here.
1150 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
1151 if a.inner == b.inner { return true; }
1152 if a.inner.is_null() || b.inner.is_null() { return false; }
1153 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1155 /// Checks if two ChannelFeaturess contain equal inner contents.
1156 /// This ignores pointers and is_owned flags and looks at the values in fields.
1157 /// Two objects with NULL inner values will be considered "equal" here.
1159 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
1160 if a.inner == b.inner { return true; }
1161 if a.inner.is_null() || b.inner.is_null() { return false; }
1162 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1164 /// Checks if two InvoiceFeaturess contain equal inner contents.
1165 /// This ignores pointers and is_owned flags and looks at the values in fields.
1166 /// Two objects with NULL inner values will be considered "equal" here.
1168 pub extern "C" fn InvoiceFeatures_eq(a: &InvoiceFeatures, b: &InvoiceFeatures) -> bool {
1169 if a.inner == b.inner { return true; }
1170 if a.inner.is_null() || b.inner.is_null() { return false; }
1171 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1173 /// Checks if two OfferFeaturess contain equal inner contents.
1174 /// This ignores pointers and is_owned flags and looks at the values in fields.
1175 /// Two objects with NULL inner values will be considered "equal" here.
1177 pub extern "C" fn OfferFeatures_eq(a: &OfferFeatures, b: &OfferFeatures) -> bool {
1178 if a.inner == b.inner { return true; }
1179 if a.inner.is_null() || b.inner.is_null() { return false; }
1180 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1182 /// Checks if two InvoiceRequestFeaturess contain equal inner contents.
1183 /// This ignores pointers and is_owned flags and looks at the values in fields.
1184 /// Two objects with NULL inner values will be considered "equal" here.
1186 pub extern "C" fn InvoiceRequestFeatures_eq(a: &InvoiceRequestFeatures, b: &InvoiceRequestFeatures) -> bool {
1187 if a.inner == b.inner { return true; }
1188 if a.inner.is_null() || b.inner.is_null() { return false; }
1189 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1191 /// Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
1192 /// This ignores pointers and is_owned flags and looks at the values in fields.
1193 /// Two objects with NULL inner values will be considered "equal" here.
1195 pub extern "C" fn Bolt12InvoiceFeatures_eq(a: &Bolt12InvoiceFeatures, b: &Bolt12InvoiceFeatures) -> bool {
1196 if a.inner == b.inner { return true; }
1197 if a.inner.is_null() || b.inner.is_null() { return false; }
1198 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1200 /// Checks if two BlindedHopFeaturess contain equal inner contents.
1201 /// This ignores pointers and is_owned flags and looks at the values in fields.
1202 /// Two objects with NULL inner values will be considered "equal" here.
1204 pub extern "C" fn BlindedHopFeatures_eq(a: &BlindedHopFeatures, b: &BlindedHopFeatures) -> bool {
1205 if a.inner == b.inner { return true; }
1206 if a.inner.is_null() || b.inner.is_null() { return false; }
1207 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1209 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
1210 /// This ignores pointers and is_owned flags and looks at the values in fields.
1211 /// Two objects with NULL inner values will be considered "equal" here.
1213 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
1214 if a.inner == b.inner { return true; }
1215 if a.inner.is_null() || b.inner.is_null() { return false; }
1216 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1218 impl Clone for InitFeatures {
1219 fn clone(&self) -> Self {
1221 inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1222 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1228 /// Used only if an object of this type is returned as a trait impl by a method
1229 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1230 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
1233 /// Creates a copy of the InitFeatures
1234 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1237 impl Clone for NodeFeatures {
1238 fn clone(&self) -> Self {
1240 inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1241 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1247 /// Used only if an object of this type is returned as a trait impl by a method
1248 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1249 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
1252 /// Creates a copy of the NodeFeatures
1253 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1256 impl Clone for ChannelFeatures {
1257 fn clone(&self) -> Self {
1259 inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1260 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1266 /// Used only if an object of this type is returned as a trait impl by a method
1267 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1268 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
1271 /// Creates a copy of the ChannelFeatures
1272 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1275 impl Clone for InvoiceFeatures {
1276 fn clone(&self) -> Self {
1278 inner: if <*mut nativeInvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1279 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1285 /// Used only if an object of this type is returned as a trait impl by a method
1286 pub(crate) extern "C" fn InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1287 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceFeatures)).clone() })) as *mut c_void
1290 /// Creates a copy of the InvoiceFeatures
1291 pub extern "C" fn InvoiceFeatures_clone(orig: &InvoiceFeatures) -> InvoiceFeatures {
1294 impl Clone for OfferFeatures {
1295 fn clone(&self) -> Self {
1297 inner: if <*mut nativeOfferFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1298 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1304 /// Used only if an object of this type is returned as a trait impl by a method
1305 pub(crate) extern "C" fn OfferFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1306 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOfferFeatures)).clone() })) as *mut c_void
1309 /// Creates a copy of the OfferFeatures
1310 pub extern "C" fn OfferFeatures_clone(orig: &OfferFeatures) -> OfferFeatures {
1313 impl Clone for InvoiceRequestFeatures {
1314 fn clone(&self) -> Self {
1316 inner: if <*mut nativeInvoiceRequestFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1317 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1323 /// Used only if an object of this type is returned as a trait impl by a method
1324 pub(crate) extern "C" fn InvoiceRequestFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1325 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
1328 /// Creates a copy of the InvoiceRequestFeatures
1329 pub extern "C" fn InvoiceRequestFeatures_clone(orig: &InvoiceRequestFeatures) -> InvoiceRequestFeatures {
1332 impl Clone for Bolt12InvoiceFeatures {
1333 fn clone(&self) -> Self {
1335 inner: if <*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1336 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1342 /// Used only if an object of this type is returned as a trait impl by a method
1343 pub(crate) extern "C" fn Bolt12InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1344 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt12InvoiceFeatures)).clone() })) as *mut c_void
1347 /// Creates a copy of the Bolt12InvoiceFeatures
1348 pub extern "C" fn Bolt12InvoiceFeatures_clone(orig: &Bolt12InvoiceFeatures) -> Bolt12InvoiceFeatures {
1351 impl Clone for BlindedHopFeatures {
1352 fn clone(&self) -> Self {
1354 inner: if <*mut nativeBlindedHopFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1355 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1361 /// Used only if an object of this type is returned as a trait impl by a method
1362 pub(crate) extern "C" fn BlindedHopFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1363 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBlindedHopFeatures)).clone() })) as *mut c_void
1366 /// Creates a copy of the BlindedHopFeatures
1367 pub extern "C" fn BlindedHopFeatures_clone(orig: &BlindedHopFeatures) -> BlindedHopFeatures {
1370 impl Clone for ChannelTypeFeatures {
1371 fn clone(&self) -> Self {
1373 inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1374 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1380 /// Used only if an object of this type is returned as a trait impl by a method
1381 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1382 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
1385 /// Creates a copy of the ChannelTypeFeatures
1386 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1390 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1391 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1393 /// Features used within an `init` message.
1396 pub struct InitFeatures {
1397 /// A pointer to the opaque Rust object.
1399 /// Nearly everywhere, inner must be non-null, however in places where
1400 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1401 pub inner: *mut nativeInitFeatures,
1402 /// Indicates that this is the only struct which contains the same pointer.
1404 /// Rust functions which take ownership of an object provided via an argument require
1405 /// this to be true and invalidate the object pointed to by inner.
1409 impl Drop for InitFeatures {
1410 fn drop(&mut self) {
1411 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1412 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1416 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1418 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1420 /// Used only if an object of this type is returned as a trait impl by a method
1421 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1422 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInitFeatures) };
1426 pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1427 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1429 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1430 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1432 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1433 pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1434 assert!(self.is_owned);
1435 let ret = ObjOps::untweak_ptr(self.inner);
1436 self.inner = core::ptr::null_mut();
1441 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1442 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1444 /// Features used within a `node_announcement` message.
1447 pub struct NodeFeatures {
1448 /// A pointer to the opaque Rust object.
1450 /// Nearly everywhere, inner must be non-null, however in places where
1451 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1452 pub inner: *mut nativeNodeFeatures,
1453 /// Indicates that this is the only struct which contains the same pointer.
1455 /// Rust functions which take ownership of an object provided via an argument require
1456 /// this to be true and invalidate the object pointed to by inner.
1460 impl Drop for NodeFeatures {
1461 fn drop(&mut self) {
1462 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1463 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1467 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1469 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1471 /// Used only if an object of this type is returned as a trait impl by a method
1472 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1473 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeNodeFeatures) };
1477 pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1478 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1480 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1481 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1483 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1484 pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1485 assert!(self.is_owned);
1486 let ret = ObjOps::untweak_ptr(self.inner);
1487 self.inner = core::ptr::null_mut();
1492 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1493 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1495 /// Features used within a `channel_announcement` message.
1498 pub struct ChannelFeatures {
1499 /// A pointer to the opaque Rust object.
1501 /// Nearly everywhere, inner must be non-null, however in places where
1502 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1503 pub inner: *mut nativeChannelFeatures,
1504 /// Indicates that this is the only struct which contains the same pointer.
1506 /// Rust functions which take ownership of an object provided via an argument require
1507 /// this to be true and invalidate the object pointed to by inner.
1511 impl Drop for ChannelFeatures {
1512 fn drop(&mut self) {
1513 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1514 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1518 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1520 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1522 /// Used only if an object of this type is returned as a trait impl by a method
1523 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1524 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelFeatures) };
1527 impl ChannelFeatures {
1528 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1529 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1531 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1532 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1534 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1535 pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1536 assert!(self.is_owned);
1537 let ret = ObjOps::untweak_ptr(self.inner);
1538 self.inner = core::ptr::null_mut();
1543 use lightning::ln::features::InvoiceFeatures as nativeInvoiceFeaturesImport;
1544 pub(crate) type nativeInvoiceFeatures = nativeInvoiceFeaturesImport;
1546 /// Features used within an invoice.
1549 pub struct InvoiceFeatures {
1550 /// A pointer to the opaque Rust object.
1552 /// Nearly everywhere, inner must be non-null, however in places where
1553 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1554 pub inner: *mut nativeInvoiceFeatures,
1555 /// Indicates that this is the only struct which contains the same pointer.
1557 /// Rust functions which take ownership of an object provided via an argument require
1558 /// this to be true and invalidate the object pointed to by inner.
1562 impl Drop for InvoiceFeatures {
1563 fn drop(&mut self) {
1564 if self.is_owned && !<*mut nativeInvoiceFeatures>::is_null(self.inner) {
1565 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1569 /// Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
1571 pub extern "C" fn InvoiceFeatures_free(this_obj: InvoiceFeatures) { }
1573 /// Used only if an object of this type is returned as a trait impl by a method
1574 pub(crate) extern "C" fn InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1575 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceFeatures) };
1578 impl InvoiceFeatures {
1579 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceFeatures {
1580 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1582 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceFeatures {
1583 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1585 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1586 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceFeatures {
1587 assert!(self.is_owned);
1588 let ret = ObjOps::untweak_ptr(self.inner);
1589 self.inner = core::ptr::null_mut();
1594 use lightning::ln::features::OfferFeatures as nativeOfferFeaturesImport;
1595 pub(crate) type nativeOfferFeatures = nativeOfferFeaturesImport;
1597 /// Features used within an `offer`.
1600 pub struct OfferFeatures {
1601 /// A pointer to the opaque Rust object.
1603 /// Nearly everywhere, inner must be non-null, however in places where
1604 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1605 pub inner: *mut nativeOfferFeatures,
1606 /// Indicates that this is the only struct which contains the same pointer.
1608 /// Rust functions which take ownership of an object provided via an argument require
1609 /// this to be true and invalidate the object pointed to by inner.
1613 impl Drop for OfferFeatures {
1614 fn drop(&mut self) {
1615 if self.is_owned && !<*mut nativeOfferFeatures>::is_null(self.inner) {
1616 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1620 /// Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
1622 pub extern "C" fn OfferFeatures_free(this_obj: OfferFeatures) { }
1624 /// Used only if an object of this type is returned as a trait impl by a method
1625 pub(crate) extern "C" fn OfferFeatures_free_void(this_ptr: *mut c_void) {
1626 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferFeatures) };
1629 impl OfferFeatures {
1630 pub(crate) fn get_native_ref(&self) -> &'static nativeOfferFeatures {
1631 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1633 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferFeatures {
1634 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1636 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1637 pub(crate) fn take_inner(mut self) -> *mut nativeOfferFeatures {
1638 assert!(self.is_owned);
1639 let ret = ObjOps::untweak_ptr(self.inner);
1640 self.inner = core::ptr::null_mut();
1645 use lightning::ln::features::InvoiceRequestFeatures as nativeInvoiceRequestFeaturesImport;
1646 pub(crate) type nativeInvoiceRequestFeatures = nativeInvoiceRequestFeaturesImport;
1648 /// Features used within an `invoice_request`.
1651 pub struct InvoiceRequestFeatures {
1652 /// A pointer to the opaque Rust object.
1654 /// Nearly everywhere, inner must be non-null, however in places where
1655 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1656 pub inner: *mut nativeInvoiceRequestFeatures,
1657 /// Indicates that this is the only struct which contains the same pointer.
1659 /// Rust functions which take ownership of an object provided via an argument require
1660 /// this to be true and invalidate the object pointed to by inner.
1664 impl Drop for InvoiceRequestFeatures {
1665 fn drop(&mut self) {
1666 if self.is_owned && !<*mut nativeInvoiceRequestFeatures>::is_null(self.inner) {
1667 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1671 /// Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
1673 pub extern "C" fn InvoiceRequestFeatures_free(this_obj: InvoiceRequestFeatures) { }
1675 /// Used only if an object of this type is returned as a trait impl by a method
1676 pub(crate) extern "C" fn InvoiceRequestFeatures_free_void(this_ptr: *mut c_void) {
1677 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceRequestFeatures) };
1680 impl InvoiceRequestFeatures {
1681 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceRequestFeatures {
1682 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1684 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceRequestFeatures {
1685 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1687 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1688 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceRequestFeatures {
1689 assert!(self.is_owned);
1690 let ret = ObjOps::untweak_ptr(self.inner);
1691 self.inner = core::ptr::null_mut();
1696 use lightning::ln::features::Bolt12InvoiceFeatures as nativeBolt12InvoiceFeaturesImport;
1697 pub(crate) type nativeBolt12InvoiceFeatures = nativeBolt12InvoiceFeaturesImport;
1699 /// Features used within an `invoice`.
1702 pub struct Bolt12InvoiceFeatures {
1703 /// A pointer to the opaque Rust object.
1705 /// Nearly everywhere, inner must be non-null, however in places where
1706 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1707 pub inner: *mut nativeBolt12InvoiceFeatures,
1708 /// Indicates that this is the only struct which contains the same pointer.
1710 /// Rust functions which take ownership of an object provided via an argument require
1711 /// this to be true and invalidate the object pointed to by inner.
1715 impl Drop for Bolt12InvoiceFeatures {
1716 fn drop(&mut self) {
1717 if self.is_owned && !<*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) {
1718 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1722 /// Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
1724 pub extern "C" fn Bolt12InvoiceFeatures_free(this_obj: Bolt12InvoiceFeatures) { }
1726 /// Used only if an object of this type is returned as a trait impl by a method
1727 pub(crate) extern "C" fn Bolt12InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1728 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt12InvoiceFeatures) };
1731 impl Bolt12InvoiceFeatures {
1732 pub(crate) fn get_native_ref(&self) -> &'static nativeBolt12InvoiceFeatures {
1733 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1735 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt12InvoiceFeatures {
1736 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1738 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1739 pub(crate) fn take_inner(mut self) -> *mut nativeBolt12InvoiceFeatures {
1740 assert!(self.is_owned);
1741 let ret = ObjOps::untweak_ptr(self.inner);
1742 self.inner = core::ptr::null_mut();
1747 use lightning::ln::features::BlindedHopFeatures as nativeBlindedHopFeaturesImport;
1748 pub(crate) type nativeBlindedHopFeatures = nativeBlindedHopFeaturesImport;
1750 /// Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
1753 pub struct BlindedHopFeatures {
1754 /// A pointer to the opaque Rust object.
1756 /// Nearly everywhere, inner must be non-null, however in places where
1757 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1758 pub inner: *mut nativeBlindedHopFeatures,
1759 /// Indicates that this is the only struct which contains the same pointer.
1761 /// Rust functions which take ownership of an object provided via an argument require
1762 /// this to be true and invalidate the object pointed to by inner.
1766 impl Drop for BlindedHopFeatures {
1767 fn drop(&mut self) {
1768 if self.is_owned && !<*mut nativeBlindedHopFeatures>::is_null(self.inner) {
1769 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1773 /// Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
1775 pub extern "C" fn BlindedHopFeatures_free(this_obj: BlindedHopFeatures) { }
1777 /// Used only if an object of this type is returned as a trait impl by a method
1778 pub(crate) extern "C" fn BlindedHopFeatures_free_void(this_ptr: *mut c_void) {
1779 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBlindedHopFeatures) };
1782 impl BlindedHopFeatures {
1783 pub(crate) fn get_native_ref(&self) -> &'static nativeBlindedHopFeatures {
1784 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1786 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBlindedHopFeatures {
1787 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1789 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1790 pub(crate) fn take_inner(mut self) -> *mut nativeBlindedHopFeatures {
1791 assert!(self.is_owned);
1792 let ret = ObjOps::untweak_ptr(self.inner);
1793 self.inner = core::ptr::null_mut();
1798 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
1799 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
1801 /// Features used within the channel_type field in an OpenChannel message.
1803 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
1804 /// semantics of our interaction with our peer.
1806 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
1807 /// the counterparty, only required features are allowed here.
1809 /// This is serialized differently from other feature types - it is not prefixed by a length, and
1810 /// thus must only appear inside a TLV where its length is known in advance.
1813 pub struct ChannelTypeFeatures {
1814 /// A pointer to the opaque Rust object.
1816 /// Nearly everywhere, inner must be non-null, however in places where
1817 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1818 pub inner: *mut nativeChannelTypeFeatures,
1819 /// Indicates that this is the only struct which contains the same pointer.
1821 /// Rust functions which take ownership of an object provided via an argument require
1822 /// this to be true and invalidate the object pointed to by inner.
1826 impl Drop for ChannelTypeFeatures {
1827 fn drop(&mut self) {
1828 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
1829 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1833 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
1835 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
1837 /// Used only if an object of this type is returned as a trait impl by a method
1838 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
1839 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures) };
1842 impl ChannelTypeFeatures {
1843 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
1844 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1846 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
1847 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1849 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1850 pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
1851 assert!(self.is_owned);
1852 let ret = ObjOps::untweak_ptr(self.inner);
1853 self.inner = core::ptr::null_mut();
1857 /// Create a blank Features with no features set
1860 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
1861 let mut ret = lightning::ln::features::InitFeatures::empty();
1862 crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1865 /// Returns true if this `Features` object contains unknown feature flags which are set as
1869 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1870 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1874 /// Create a blank Features with no features set
1877 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
1878 let mut ret = lightning::ln::features::NodeFeatures::empty();
1879 crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1882 /// Returns true if this `Features` object contains unknown feature flags which are set as
1886 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1887 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1891 /// Create a blank Features with no features set
1894 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
1895 let mut ret = lightning::ln::features::ChannelFeatures::empty();
1896 crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1899 /// Returns true if this `Features` object contains unknown feature flags which are set as
1903 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
1904 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1908 /// Create a blank Features with no features set
1911 pub extern "C" fn InvoiceFeatures_empty() -> crate::lightning::ln::features::InvoiceFeatures {
1912 let mut ret = lightning::ln::features::InvoiceFeatures::empty();
1913 crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1916 /// Returns true if this `Features` object contains unknown feature flags which are set as
1920 pub extern "C" fn InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1921 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1925 /// Create a blank Features with no features set
1928 pub extern "C" fn OfferFeatures_empty() -> crate::lightning::ln::features::OfferFeatures {
1929 let mut ret = lightning::ln::features::OfferFeatures::empty();
1930 crate::lightning::ln::features::OfferFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1933 /// Returns true if this `Features` object contains unknown feature flags which are set as
1937 pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::OfferFeatures) -> bool {
1938 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1942 /// Create a blank Features with no features set
1945 pub extern "C" fn InvoiceRequestFeatures_empty() -> crate::lightning::ln::features::InvoiceRequestFeatures {
1946 let mut ret = lightning::ln::features::InvoiceRequestFeatures::empty();
1947 crate::lightning::ln::features::InvoiceRequestFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1950 /// Returns true if this `Features` object contains unknown feature flags which are set as
1954 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
1955 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1959 /// Create a blank Features with no features set
1962 pub extern "C" fn Bolt12InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt12InvoiceFeatures {
1963 let mut ret = lightning::ln::features::Bolt12InvoiceFeatures::empty();
1964 crate::lightning::ln::features::Bolt12InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1967 /// Returns true if this `Features` object contains unknown feature flags which are set as
1971 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
1972 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1976 /// Create a blank Features with no features set
1979 pub extern "C" fn BlindedHopFeatures_empty() -> crate::lightning::ln::features::BlindedHopFeatures {
1980 let mut ret = lightning::ln::features::BlindedHopFeatures::empty();
1981 crate::lightning::ln::features::BlindedHopFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1984 /// Returns true if this `Features` object contains unknown feature flags which are set as
1988 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
1989 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1993 /// Create a blank Features with no features set
1996 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
1997 let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
1998 crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2001 /// Returns true if this `Features` object contains unknown feature flags which are set as
2005 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2006 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2011 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
2012 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
2013 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2016 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2017 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
2020 /// Read a InitFeatures from a byte array, created by InitFeatures_write
2021 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
2022 let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2023 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::native_into(e) }).into() };
2027 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
2028 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
2029 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2032 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2033 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
2036 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
2037 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
2038 let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2039 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::native_into(e) }).into() };
2043 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
2044 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
2045 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2048 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2049 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
2052 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
2053 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
2054 let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2055 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::native_into(e) }).into() };
2059 /// Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
2060 pub extern "C" fn InvoiceFeatures_write(obj: &crate::lightning::ln::features::InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
2061 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2064 pub(crate) extern "C" fn InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2065 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceFeatures) })
2068 /// Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
2069 pub extern "C" fn InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InvoiceFeaturesDecodeErrorZ {
2070 let res: Result<lightning::ln::features::InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2071 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::native_into(e) }).into() };
2075 /// Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
2076 pub extern "C" fn BlindedHopFeatures_write(obj: &crate::lightning::ln::features::BlindedHopFeatures) -> crate::c_types::derived::CVec_u8Z {
2077 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2080 pub(crate) extern "C" fn BlindedHopFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2081 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedHopFeatures) })
2084 /// Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
2085 pub extern "C" fn BlindedHopFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_BlindedHopFeaturesDecodeErrorZ {
2086 let res: Result<lightning::ln::features::BlindedHopFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2087 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::BlindedHopFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
2091 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
2092 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
2093 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2096 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2097 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
2100 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
2101 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
2102 let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2103 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::native_into(e) }).into() };