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).
47 //! - `ChannelType` - node supports the channel_type field in open/accept
48 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
49 //! - `SCIDPrivacy` - supply channel aliases for routing
50 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
51 //! - `PaymentMetadata` - include additional data in invoices which is passed to recipients in the
53 //! (see [BOLT-11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) for
55 //! - `ZeroConf` - supports accepting HTLCs and using channels prior to funding confirmation
57 //! [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message)
59 //! - `Keysend` - send funds to a node without an invoice
60 //! (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
61 //! - `AnchorsZeroFeeHtlcTx` - requires/supports that commitment transactions include anchor outputs
62 //! and HTLC transactions are pre-signed with zero fee (see
63 //! [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more
66 //! LDK knows about the following features, but does not support them:
67 //! - `AnchorsNonzeroFeeHtlcTx` - the initial version of anchor outputs, which was later found to be
68 //! vulnerable (see this
69 //! [mailing list post](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html)
70 //! for more information).
72 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
73 //! [messages]: crate::ln::msgs
75 use alloc::str::FromStr;
76 use core::ffi::c_void;
77 use core::convert::Infallible;
78 use bitcoin::hashes::Hash;
79 use crate::c_types::*;
80 #[cfg(feature="no-std")]
81 use alloc::{vec::Vec, boxed::Box};
85 use alloc::str::FromStr;
86 use core::ffi::c_void;
87 use core::convert::Infallible;
88 use bitcoin::hashes::Hash;
89 use crate::c_types::*;
90 #[cfg(feature="no-std")]
91 use alloc::{vec::Vec, boxed::Box};
93 /// Set this feature as optional.
95 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
96 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_optional()
99 /// Set this feature as required.
101 pub extern "C" fn InitFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
102 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_required()
105 /// Checks if this feature is supported.
108 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
109 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
113 /// Set this feature as optional.
115 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
116 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_optional()
119 /// Set this feature as required.
121 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
122 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_required()
125 /// Checks if this feature is supported.
128 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
129 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
133 /// Checks if this feature is required.
136 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
137 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
141 /// Checks if this feature is required.
144 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
145 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
149 /// Set this feature as optional.
151 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
152 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_optional()
155 /// Set this feature as required.
157 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
158 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_required()
161 /// Checks if this feature is supported.
164 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
165 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
169 /// Set this feature as optional.
171 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
172 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_optional()
175 /// Set this feature as required.
177 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
178 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_required()
181 /// Checks if this feature is supported.
184 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
185 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
189 /// Set this feature as optional.
191 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
192 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_optional()
195 /// Set this feature as required.
197 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
198 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_required()
201 /// Checks if this feature is supported.
204 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
205 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
209 /// Checks if this feature is required.
212 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
213 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
217 /// Checks if this feature is required.
220 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
221 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
225 /// Set this feature as optional.
227 pub extern "C" fn InitFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
228 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_optional()
231 /// Set this feature as required.
233 pub extern "C" fn InitFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
234 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_required()
237 /// Checks if this feature is supported.
240 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
241 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
245 /// Set this feature as optional.
247 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
248 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_optional()
251 /// Set this feature as required.
253 pub extern "C" fn NodeFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
254 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_required()
257 /// Checks if this feature is supported.
260 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
261 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
265 /// Checks if this feature is required.
268 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
269 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
273 /// Checks if this feature is required.
276 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
277 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
281 /// Set this feature as optional.
283 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
284 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_optional()
287 /// Set this feature as required.
289 pub extern "C" fn InitFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
290 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_required()
293 /// Checks if this feature is supported.
296 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
297 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
301 /// Set this feature as optional.
303 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
304 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_optional()
307 /// Set this feature as required.
309 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
310 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_required()
313 /// Checks if this feature is supported.
316 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
317 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
321 /// Set this feature as optional.
323 pub extern "C" fn Bolt11InvoiceFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
324 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_variable_length_onion_optional()
327 /// Set this feature as required.
329 pub extern "C" fn Bolt11InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
330 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_variable_length_onion_required()
333 /// Checks if this feature is supported.
336 pub extern "C" fn Bolt11InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
337 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
341 /// Checks if this feature is required.
344 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
345 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
349 /// Checks if this feature is required.
352 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
353 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
357 /// Checks if this feature is required.
360 pub extern "C" fn Bolt11InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
361 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
365 /// Set this feature as optional.
367 pub extern "C" fn InitFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
368 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_optional()
371 /// Set this feature as required.
373 pub extern "C" fn InitFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
374 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_required()
377 /// Checks if this feature is supported.
380 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
381 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
385 /// Set this feature as optional.
387 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
388 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_optional()
391 /// Set this feature as required.
393 pub extern "C" fn NodeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
394 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_required()
397 /// Checks if this feature is supported.
400 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
401 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
405 /// Set this feature as optional.
407 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
408 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_optional()
411 /// Set this feature as required.
413 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
414 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_required()
417 /// Checks if this feature is supported.
420 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
421 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
425 /// Checks if this feature is required.
428 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
429 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
433 /// Checks if this feature is required.
436 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
437 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
441 /// Checks if this feature is required.
444 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
445 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
449 /// Set this feature as optional.
451 pub extern "C" fn InitFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
452 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_optional()
455 /// Set this feature as required.
457 pub extern "C" fn InitFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
458 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_required()
461 /// Checks if this feature is supported.
464 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
465 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
469 /// Set this feature as optional.
471 pub extern "C" fn NodeFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
472 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_optional()
475 /// Set this feature as required.
477 pub extern "C" fn NodeFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
478 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_required()
481 /// Checks if this feature is supported.
484 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
485 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
489 /// Set this feature as optional.
491 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
492 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_secret_optional()
495 /// Set this feature as required.
497 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
498 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_secret_required()
501 /// Checks if this feature is supported.
504 pub extern "C" fn Bolt11InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
505 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
509 /// Checks if this feature is required.
512 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
513 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
517 /// Checks if this feature is required.
520 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
521 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
525 /// Checks if this feature is required.
528 pub extern "C" fn Bolt11InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
529 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
533 /// Set this feature as optional.
535 pub extern "C" fn InitFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
536 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_optional()
539 /// Set this feature as required.
541 pub extern "C" fn InitFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
542 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_required()
545 /// Checks if this feature is supported.
548 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
549 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
553 /// Set this feature as optional.
555 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
556 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_optional()
559 /// Set this feature as required.
561 pub extern "C" fn NodeFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
562 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_required()
565 /// Checks if this feature is supported.
568 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
569 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
573 /// Set this feature as optional.
575 pub extern "C" fn Bolt11InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
576 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_basic_mpp_optional()
579 /// Set this feature as required.
581 pub extern "C" fn Bolt11InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
582 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_basic_mpp_required()
585 /// Checks if this feature is supported.
588 pub extern "C" fn Bolt11InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
589 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
593 /// Set this feature as optional.
595 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
596 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_optional()
599 /// Set this feature as required.
601 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
602 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_required()
605 /// Checks if this feature is supported.
608 pub extern "C" fn Bolt12InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
609 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
613 /// Checks if this feature is required.
616 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
617 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
621 /// Checks if this feature is required.
624 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
625 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
629 /// Checks if this feature is required.
632 pub extern "C" fn Bolt11InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
633 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
637 /// Checks if this feature is required.
640 pub extern "C" fn Bolt12InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
641 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
645 /// Set this feature as optional.
647 pub extern "C" fn InitFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
648 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_optional()
651 /// Set this feature as required.
653 pub extern "C" fn InitFeatures_set_wumbo_required(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_wumbo_required()
657 /// Checks if this feature is supported.
660 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
661 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
665 /// Set this feature as optional.
667 pub extern "C" fn NodeFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
668 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_optional()
671 /// Set this feature as required.
673 pub extern "C" fn NodeFeatures_set_wumbo_required(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_wumbo_required()
677 /// Checks if this feature is supported.
680 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
681 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
685 /// Checks if this feature is required.
688 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
689 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
693 /// Checks if this feature is required.
696 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
697 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
701 /// Set this feature as optional.
703 pub extern "C" fn InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
704 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
707 /// Set this feature as required.
709 pub extern "C" fn InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(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_anchors_nonzero_fee_htlc_tx_required()
713 /// Checks if this feature is supported.
716 pub extern "C" fn InitFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
717 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
721 /// Set this feature as optional.
723 pub extern "C" fn NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
724 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
727 /// Set this feature as required.
729 pub extern "C" fn NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(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_anchors_nonzero_fee_htlc_tx_required()
733 /// Checks if this feature is supported.
736 pub extern "C" fn NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
737 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
741 /// Set this feature as optional.
743 pub extern "C" fn ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
744 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
747 /// Set this feature as required.
749 pub extern "C" fn ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
750 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
753 /// Checks if this feature is supported.
756 pub extern "C" fn ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
757 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
761 /// Checks if this feature is required.
764 pub extern "C" fn InitFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
765 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
769 /// Checks if this feature is required.
772 pub extern "C" fn NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
773 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
777 /// Checks if this feature is required.
780 pub extern "C" fn ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
781 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
785 /// Set this feature as optional.
787 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
788 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
791 /// Set this feature as required.
793 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
794 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
797 /// Checks if this feature is supported.
800 pub extern "C" fn InitFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
801 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
805 /// Set this feature as optional.
807 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
808 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
811 /// Set this feature as required.
813 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
814 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
817 /// Checks if this feature is supported.
820 pub extern "C" fn NodeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
821 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
825 /// Set this feature as optional.
827 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
828 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
831 /// Set this feature as required.
833 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
834 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
837 /// Checks if this feature is supported.
840 pub extern "C" fn ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
841 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
845 /// Checks if this feature is required.
848 pub extern "C" fn InitFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
849 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
853 /// Checks if this feature is required.
856 pub extern "C" fn NodeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
857 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
861 /// Checks if this feature is required.
864 pub extern "C" fn ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
865 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
869 /// Set this feature as optional.
871 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
872 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_optional()
875 /// Set this feature as required.
877 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
878 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_required()
881 /// Checks if this feature is supported.
884 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
885 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
889 /// Set this feature as optional.
891 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
892 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_optional()
895 /// Set this feature as required.
897 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
898 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_required()
901 /// Checks if this feature is supported.
904 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
905 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
909 /// Checks if this feature is required.
912 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
913 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
917 /// Checks if this feature is required.
920 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
921 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
925 /// Set this feature as optional.
927 pub extern "C" fn InitFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
928 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_optional()
931 /// Set this feature as required.
933 pub extern "C" fn InitFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
934 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_required()
937 /// Checks if this feature is supported.
940 pub extern "C" fn InitFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
941 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
945 /// Set this feature as optional.
947 pub extern "C" fn NodeFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
948 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_optional()
951 /// Set this feature as required.
953 pub extern "C" fn NodeFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
954 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_required()
957 /// Checks if this feature is supported.
960 pub extern "C" fn NodeFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
961 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
965 /// Checks if this feature is required.
968 pub extern "C" fn InitFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
969 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
973 /// Checks if this feature is required.
976 pub extern "C" fn NodeFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
977 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
981 /// Set this feature as optional.
983 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
984 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
987 /// Set this feature as required.
989 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
990 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
993 /// Checks if this feature is supported.
996 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
997 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
1001 /// Set this feature as optional.
1003 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1004 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
1007 /// Set this feature as required.
1009 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1010 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
1013 /// Checks if this feature is supported.
1016 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1017 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
1021 /// Checks if this feature is required.
1024 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1025 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
1029 /// Checks if this feature is required.
1032 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1033 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
1037 /// Set this feature as optional.
1039 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1040 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
1043 /// Set this feature as required.
1045 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1046 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
1049 /// Checks if this feature is supported.
1052 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1053 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1057 /// Set this feature as optional.
1059 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1060 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
1063 /// Set this feature as required.
1065 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1066 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
1069 /// Checks if this feature is supported.
1072 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1073 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1077 /// Set this feature as optional.
1079 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1080 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
1083 /// Set this feature as required.
1085 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1086 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
1089 /// Checks if this feature is supported.
1092 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1093 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1097 /// Checks if this feature is required.
1100 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1101 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1105 /// Checks if this feature is required.
1108 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1109 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1113 /// Checks if this feature is required.
1116 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1117 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1121 /// Set this feature as optional.
1123 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_metadata_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1124 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_metadata_optional()
1127 /// Set this feature as required.
1129 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_metadata_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1130 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_metadata_required()
1133 /// Checks if this feature is supported.
1136 pub extern "C" fn Bolt11InvoiceFeatures_supports_payment_metadata(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1137 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_metadata();
1141 /// Checks if this feature is required.
1144 pub extern "C" fn Bolt11InvoiceFeatures_requires_payment_metadata(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1145 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_metadata();
1149 /// Set this feature as optional.
1151 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1152 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
1155 /// Set this feature as required.
1157 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1158 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
1161 /// Checks if this feature is supported.
1164 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1165 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1169 /// Set this feature as optional.
1171 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1172 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
1175 /// Set this feature as required.
1177 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1178 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
1181 /// Checks if this feature is supported.
1184 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1185 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1189 /// Set this feature as optional.
1191 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1192 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
1195 /// Set this feature as required.
1197 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1198 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
1201 /// Checks if this feature is supported.
1204 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1205 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1209 /// Checks if this feature is required.
1212 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1213 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1217 /// Checks if this feature is required.
1220 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1221 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1225 /// Checks if this feature is required.
1228 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1229 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1233 /// Set this feature as optional.
1235 pub extern "C" fn NodeFeatures_set_keysend_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1236 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_optional()
1239 /// Set this feature as required.
1241 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1242 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
1245 /// Checks if this feature is supported.
1248 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1249 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
1253 /// Checks if this feature is required.
1256 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1257 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
1262 /// Checks if two InitFeaturess contain equal inner contents.
1263 /// This ignores pointers and is_owned flags and looks at the values in fields.
1264 /// Two objects with NULL inner values will be considered "equal" here.
1266 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
1267 if a.inner == b.inner { return true; }
1268 if a.inner.is_null() || b.inner.is_null() { return false; }
1269 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1271 /// Checks if two NodeFeaturess contain equal inner contents.
1272 /// This ignores pointers and is_owned flags and looks at the values in fields.
1273 /// Two objects with NULL inner values will be considered "equal" here.
1275 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
1276 if a.inner == b.inner { return true; }
1277 if a.inner.is_null() || b.inner.is_null() { return false; }
1278 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1280 /// Checks if two ChannelFeaturess contain equal inner contents.
1281 /// This ignores pointers and is_owned flags and looks at the values in fields.
1282 /// Two objects with NULL inner values will be considered "equal" here.
1284 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
1285 if a.inner == b.inner { return true; }
1286 if a.inner.is_null() || b.inner.is_null() { return false; }
1287 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1289 /// Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
1290 /// This ignores pointers and is_owned flags and looks at the values in fields.
1291 /// Two objects with NULL inner values will be considered "equal" here.
1293 pub extern "C" fn Bolt11InvoiceFeatures_eq(a: &Bolt11InvoiceFeatures, b: &Bolt11InvoiceFeatures) -> bool {
1294 if a.inner == b.inner { return true; }
1295 if a.inner.is_null() || b.inner.is_null() { return false; }
1296 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1298 /// Checks if two OfferFeaturess contain equal inner contents.
1299 /// This ignores pointers and is_owned flags and looks at the values in fields.
1300 /// Two objects with NULL inner values will be considered "equal" here.
1302 pub extern "C" fn OfferFeatures_eq(a: &OfferFeatures, b: &OfferFeatures) -> bool {
1303 if a.inner == b.inner { return true; }
1304 if a.inner.is_null() || b.inner.is_null() { return false; }
1305 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1307 /// Checks if two InvoiceRequestFeaturess contain equal inner contents.
1308 /// This ignores pointers and is_owned flags and looks at the values in fields.
1309 /// Two objects with NULL inner values will be considered "equal" here.
1311 pub extern "C" fn InvoiceRequestFeatures_eq(a: &InvoiceRequestFeatures, b: &InvoiceRequestFeatures) -> bool {
1312 if a.inner == b.inner { return true; }
1313 if a.inner.is_null() || b.inner.is_null() { return false; }
1314 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1316 /// Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
1317 /// This ignores pointers and is_owned flags and looks at the values in fields.
1318 /// Two objects with NULL inner values will be considered "equal" here.
1320 pub extern "C" fn Bolt12InvoiceFeatures_eq(a: &Bolt12InvoiceFeatures, b: &Bolt12InvoiceFeatures) -> bool {
1321 if a.inner == b.inner { return true; }
1322 if a.inner.is_null() || b.inner.is_null() { return false; }
1323 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1325 /// Checks if two BlindedHopFeaturess contain equal inner contents.
1326 /// This ignores pointers and is_owned flags and looks at the values in fields.
1327 /// Two objects with NULL inner values will be considered "equal" here.
1329 pub extern "C" fn BlindedHopFeatures_eq(a: &BlindedHopFeatures, b: &BlindedHopFeatures) -> bool {
1330 if a.inner == b.inner { return true; }
1331 if a.inner.is_null() || b.inner.is_null() { return false; }
1332 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1334 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
1335 /// This ignores pointers and is_owned flags and looks at the values in fields.
1336 /// Two objects with NULL inner values will be considered "equal" here.
1338 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
1339 if a.inner == b.inner { return true; }
1340 if a.inner.is_null() || b.inner.is_null() { return false; }
1341 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1343 impl Clone for InitFeatures {
1344 fn clone(&self) -> Self {
1346 inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1347 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1353 /// Used only if an object of this type is returned as a trait impl by a method
1354 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1355 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
1358 /// Creates a copy of the InitFeatures
1359 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1362 impl Clone for NodeFeatures {
1363 fn clone(&self) -> Self {
1365 inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1366 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1372 /// Used only if an object of this type is returned as a trait impl by a method
1373 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1374 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
1377 /// Creates a copy of the NodeFeatures
1378 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1381 impl Clone for ChannelFeatures {
1382 fn clone(&self) -> Self {
1384 inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1385 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1391 /// Used only if an object of this type is returned as a trait impl by a method
1392 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1393 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
1396 /// Creates a copy of the ChannelFeatures
1397 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1400 impl Clone for Bolt11InvoiceFeatures {
1401 fn clone(&self) -> Self {
1403 inner: if <*mut nativeBolt11InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1404 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1410 /// Used only if an object of this type is returned as a trait impl by a method
1411 pub(crate) extern "C" fn Bolt11InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1412 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt11InvoiceFeatures)).clone() })) as *mut c_void
1415 /// Creates a copy of the Bolt11InvoiceFeatures
1416 pub extern "C" fn Bolt11InvoiceFeatures_clone(orig: &Bolt11InvoiceFeatures) -> Bolt11InvoiceFeatures {
1419 impl Clone for OfferFeatures {
1420 fn clone(&self) -> Self {
1422 inner: if <*mut nativeOfferFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1423 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1429 /// Used only if an object of this type is returned as a trait impl by a method
1430 pub(crate) extern "C" fn OfferFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1431 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOfferFeatures)).clone() })) as *mut c_void
1434 /// Creates a copy of the OfferFeatures
1435 pub extern "C" fn OfferFeatures_clone(orig: &OfferFeatures) -> OfferFeatures {
1438 impl Clone for InvoiceRequestFeatures {
1439 fn clone(&self) -> Self {
1441 inner: if <*mut nativeInvoiceRequestFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1442 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1448 /// Used only if an object of this type is returned as a trait impl by a method
1449 pub(crate) extern "C" fn InvoiceRequestFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1450 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
1453 /// Creates a copy of the InvoiceRequestFeatures
1454 pub extern "C" fn InvoiceRequestFeatures_clone(orig: &InvoiceRequestFeatures) -> InvoiceRequestFeatures {
1457 impl Clone for Bolt12InvoiceFeatures {
1458 fn clone(&self) -> Self {
1460 inner: if <*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1461 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1467 /// Used only if an object of this type is returned as a trait impl by a method
1468 pub(crate) extern "C" fn Bolt12InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1469 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt12InvoiceFeatures)).clone() })) as *mut c_void
1472 /// Creates a copy of the Bolt12InvoiceFeatures
1473 pub extern "C" fn Bolt12InvoiceFeatures_clone(orig: &Bolt12InvoiceFeatures) -> Bolt12InvoiceFeatures {
1476 impl Clone for BlindedHopFeatures {
1477 fn clone(&self) -> Self {
1479 inner: if <*mut nativeBlindedHopFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1480 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1486 /// Used only if an object of this type is returned as a trait impl by a method
1487 pub(crate) extern "C" fn BlindedHopFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1488 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBlindedHopFeatures)).clone() })) as *mut c_void
1491 /// Creates a copy of the BlindedHopFeatures
1492 pub extern "C" fn BlindedHopFeatures_clone(orig: &BlindedHopFeatures) -> BlindedHopFeatures {
1495 impl Clone for ChannelTypeFeatures {
1496 fn clone(&self) -> Self {
1498 inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1499 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1505 /// Used only if an object of this type is returned as a trait impl by a method
1506 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1507 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
1510 /// Creates a copy of the ChannelTypeFeatures
1511 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1515 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1516 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1518 /// Features used within an `init` message.
1521 pub struct InitFeatures {
1522 /// A pointer to the opaque Rust object.
1524 /// Nearly everywhere, inner must be non-null, however in places where
1525 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1526 pub inner: *mut nativeInitFeatures,
1527 /// Indicates that this is the only struct which contains the same pointer.
1529 /// Rust functions which take ownership of an object provided via an argument require
1530 /// this to be true and invalidate the object pointed to by inner.
1534 impl Drop for InitFeatures {
1535 fn drop(&mut self) {
1536 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1537 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1541 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1543 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1545 /// Used only if an object of this type is returned as a trait impl by a method
1546 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1547 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInitFeatures) };
1551 pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1552 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1554 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1555 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1557 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1558 pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1559 assert!(self.is_owned);
1560 let ret = ObjOps::untweak_ptr(self.inner);
1561 self.inner = core::ptr::null_mut();
1566 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1567 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1569 /// Features used within a `node_announcement` message.
1572 pub struct NodeFeatures {
1573 /// A pointer to the opaque Rust object.
1575 /// Nearly everywhere, inner must be non-null, however in places where
1576 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1577 pub inner: *mut nativeNodeFeatures,
1578 /// Indicates that this is the only struct which contains the same pointer.
1580 /// Rust functions which take ownership of an object provided via an argument require
1581 /// this to be true and invalidate the object pointed to by inner.
1585 impl Drop for NodeFeatures {
1586 fn drop(&mut self) {
1587 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1588 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1592 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1594 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1596 /// Used only if an object of this type is returned as a trait impl by a method
1597 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1598 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeNodeFeatures) };
1602 pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1603 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1605 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1606 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1608 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1609 pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1610 assert!(self.is_owned);
1611 let ret = ObjOps::untweak_ptr(self.inner);
1612 self.inner = core::ptr::null_mut();
1617 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1618 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1620 /// Features used within a `channel_announcement` message.
1623 pub struct ChannelFeatures {
1624 /// A pointer to the opaque Rust object.
1626 /// Nearly everywhere, inner must be non-null, however in places where
1627 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1628 pub inner: *mut nativeChannelFeatures,
1629 /// Indicates that this is the only struct which contains the same pointer.
1631 /// Rust functions which take ownership of an object provided via an argument require
1632 /// this to be true and invalidate the object pointed to by inner.
1636 impl Drop for ChannelFeatures {
1637 fn drop(&mut self) {
1638 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1639 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1643 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1645 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1647 /// Used only if an object of this type is returned as a trait impl by a method
1648 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1649 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelFeatures) };
1652 impl ChannelFeatures {
1653 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1654 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1656 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1657 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1659 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1660 pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1661 assert!(self.is_owned);
1662 let ret = ObjOps::untweak_ptr(self.inner);
1663 self.inner = core::ptr::null_mut();
1668 use lightning::ln::features::Bolt11InvoiceFeatures as nativeBolt11InvoiceFeaturesImport;
1669 pub(crate) type nativeBolt11InvoiceFeatures = nativeBolt11InvoiceFeaturesImport;
1671 /// Features used within an invoice.
1674 pub struct Bolt11InvoiceFeatures {
1675 /// A pointer to the opaque Rust object.
1677 /// Nearly everywhere, inner must be non-null, however in places where
1678 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1679 pub inner: *mut nativeBolt11InvoiceFeatures,
1680 /// Indicates that this is the only struct which contains the same pointer.
1682 /// Rust functions which take ownership of an object provided via an argument require
1683 /// this to be true and invalidate the object pointed to by inner.
1687 impl Drop for Bolt11InvoiceFeatures {
1688 fn drop(&mut self) {
1689 if self.is_owned && !<*mut nativeBolt11InvoiceFeatures>::is_null(self.inner) {
1690 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1694 /// Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
1696 pub extern "C" fn Bolt11InvoiceFeatures_free(this_obj: Bolt11InvoiceFeatures) { }
1698 /// Used only if an object of this type is returned as a trait impl by a method
1699 pub(crate) extern "C" fn Bolt11InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1700 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt11InvoiceFeatures) };
1703 impl Bolt11InvoiceFeatures {
1704 pub(crate) fn get_native_ref(&self) -> &'static nativeBolt11InvoiceFeatures {
1705 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1707 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt11InvoiceFeatures {
1708 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1710 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1711 pub(crate) fn take_inner(mut self) -> *mut nativeBolt11InvoiceFeatures {
1712 assert!(self.is_owned);
1713 let ret = ObjOps::untweak_ptr(self.inner);
1714 self.inner = core::ptr::null_mut();
1719 use lightning::ln::features::OfferFeatures as nativeOfferFeaturesImport;
1720 pub(crate) type nativeOfferFeatures = nativeOfferFeaturesImport;
1722 /// Features used within an `offer`.
1725 pub struct OfferFeatures {
1726 /// A pointer to the opaque Rust object.
1728 /// Nearly everywhere, inner must be non-null, however in places where
1729 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1730 pub inner: *mut nativeOfferFeatures,
1731 /// Indicates that this is the only struct which contains the same pointer.
1733 /// Rust functions which take ownership of an object provided via an argument require
1734 /// this to be true and invalidate the object pointed to by inner.
1738 impl Drop for OfferFeatures {
1739 fn drop(&mut self) {
1740 if self.is_owned && !<*mut nativeOfferFeatures>::is_null(self.inner) {
1741 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1745 /// Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
1747 pub extern "C" fn OfferFeatures_free(this_obj: OfferFeatures) { }
1749 /// Used only if an object of this type is returned as a trait impl by a method
1750 pub(crate) extern "C" fn OfferFeatures_free_void(this_ptr: *mut c_void) {
1751 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferFeatures) };
1754 impl OfferFeatures {
1755 pub(crate) fn get_native_ref(&self) -> &'static nativeOfferFeatures {
1756 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1758 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferFeatures {
1759 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1761 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1762 pub(crate) fn take_inner(mut self) -> *mut nativeOfferFeatures {
1763 assert!(self.is_owned);
1764 let ret = ObjOps::untweak_ptr(self.inner);
1765 self.inner = core::ptr::null_mut();
1770 use lightning::ln::features::InvoiceRequestFeatures as nativeInvoiceRequestFeaturesImport;
1771 pub(crate) type nativeInvoiceRequestFeatures = nativeInvoiceRequestFeaturesImport;
1773 /// Features used within an `invoice_request`.
1776 pub struct InvoiceRequestFeatures {
1777 /// A pointer to the opaque Rust object.
1779 /// Nearly everywhere, inner must be non-null, however in places where
1780 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1781 pub inner: *mut nativeInvoiceRequestFeatures,
1782 /// Indicates that this is the only struct which contains the same pointer.
1784 /// Rust functions which take ownership of an object provided via an argument require
1785 /// this to be true and invalidate the object pointed to by inner.
1789 impl Drop for InvoiceRequestFeatures {
1790 fn drop(&mut self) {
1791 if self.is_owned && !<*mut nativeInvoiceRequestFeatures>::is_null(self.inner) {
1792 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1796 /// Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
1798 pub extern "C" fn InvoiceRequestFeatures_free(this_obj: InvoiceRequestFeatures) { }
1800 /// Used only if an object of this type is returned as a trait impl by a method
1801 pub(crate) extern "C" fn InvoiceRequestFeatures_free_void(this_ptr: *mut c_void) {
1802 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceRequestFeatures) };
1805 impl InvoiceRequestFeatures {
1806 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceRequestFeatures {
1807 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1809 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceRequestFeatures {
1810 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1812 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1813 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceRequestFeatures {
1814 assert!(self.is_owned);
1815 let ret = ObjOps::untweak_ptr(self.inner);
1816 self.inner = core::ptr::null_mut();
1821 use lightning::ln::features::Bolt12InvoiceFeatures as nativeBolt12InvoiceFeaturesImport;
1822 pub(crate) type nativeBolt12InvoiceFeatures = nativeBolt12InvoiceFeaturesImport;
1824 /// Features used within an `invoice`.
1827 pub struct Bolt12InvoiceFeatures {
1828 /// A pointer to the opaque Rust object.
1830 /// Nearly everywhere, inner must be non-null, however in places where
1831 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1832 pub inner: *mut nativeBolt12InvoiceFeatures,
1833 /// Indicates that this is the only struct which contains the same pointer.
1835 /// Rust functions which take ownership of an object provided via an argument require
1836 /// this to be true and invalidate the object pointed to by inner.
1840 impl Drop for Bolt12InvoiceFeatures {
1841 fn drop(&mut self) {
1842 if self.is_owned && !<*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) {
1843 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1847 /// Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
1849 pub extern "C" fn Bolt12InvoiceFeatures_free(this_obj: Bolt12InvoiceFeatures) { }
1851 /// Used only if an object of this type is returned as a trait impl by a method
1852 pub(crate) extern "C" fn Bolt12InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1853 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt12InvoiceFeatures) };
1856 impl Bolt12InvoiceFeatures {
1857 pub(crate) fn get_native_ref(&self) -> &'static nativeBolt12InvoiceFeatures {
1858 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1860 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt12InvoiceFeatures {
1861 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1863 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1864 pub(crate) fn take_inner(mut self) -> *mut nativeBolt12InvoiceFeatures {
1865 assert!(self.is_owned);
1866 let ret = ObjOps::untweak_ptr(self.inner);
1867 self.inner = core::ptr::null_mut();
1872 use lightning::ln::features::BlindedHopFeatures as nativeBlindedHopFeaturesImport;
1873 pub(crate) type nativeBlindedHopFeatures = nativeBlindedHopFeaturesImport;
1875 /// Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
1878 pub struct BlindedHopFeatures {
1879 /// A pointer to the opaque Rust object.
1881 /// Nearly everywhere, inner must be non-null, however in places where
1882 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1883 pub inner: *mut nativeBlindedHopFeatures,
1884 /// Indicates that this is the only struct which contains the same pointer.
1886 /// Rust functions which take ownership of an object provided via an argument require
1887 /// this to be true and invalidate the object pointed to by inner.
1891 impl Drop for BlindedHopFeatures {
1892 fn drop(&mut self) {
1893 if self.is_owned && !<*mut nativeBlindedHopFeatures>::is_null(self.inner) {
1894 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1898 /// Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
1900 pub extern "C" fn BlindedHopFeatures_free(this_obj: BlindedHopFeatures) { }
1902 /// Used only if an object of this type is returned as a trait impl by a method
1903 pub(crate) extern "C" fn BlindedHopFeatures_free_void(this_ptr: *mut c_void) {
1904 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBlindedHopFeatures) };
1907 impl BlindedHopFeatures {
1908 pub(crate) fn get_native_ref(&self) -> &'static nativeBlindedHopFeatures {
1909 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1911 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBlindedHopFeatures {
1912 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1914 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1915 pub(crate) fn take_inner(mut self) -> *mut nativeBlindedHopFeatures {
1916 assert!(self.is_owned);
1917 let ret = ObjOps::untweak_ptr(self.inner);
1918 self.inner = core::ptr::null_mut();
1923 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
1924 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
1926 /// Features used within the channel_type field in an OpenChannel message.
1928 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
1929 /// semantics of our interaction with our peer.
1931 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
1932 /// the counterparty, only required features are allowed here.
1934 /// This is serialized differently from other feature types - it is not prefixed by a length, and
1935 /// thus must only appear inside a TLV where its length is known in advance.
1938 pub struct ChannelTypeFeatures {
1939 /// A pointer to the opaque Rust object.
1941 /// Nearly everywhere, inner must be non-null, however in places where
1942 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1943 pub inner: *mut nativeChannelTypeFeatures,
1944 /// Indicates that this is the only struct which contains the same pointer.
1946 /// Rust functions which take ownership of an object provided via an argument require
1947 /// this to be true and invalidate the object pointed to by inner.
1951 impl Drop for ChannelTypeFeatures {
1952 fn drop(&mut self) {
1953 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
1954 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1958 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
1960 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
1962 /// Used only if an object of this type is returned as a trait impl by a method
1963 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
1964 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures) };
1967 impl ChannelTypeFeatures {
1968 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
1969 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1971 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
1972 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1974 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1975 pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
1976 assert!(self.is_owned);
1977 let ret = ObjOps::untweak_ptr(self.inner);
1978 self.inner = core::ptr::null_mut();
1982 /// Create a blank Features with no features set
1985 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
1986 let mut ret = lightning::ln::features::InitFeatures::empty();
1987 crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1990 /// Returns true if this `Features` object contains required features unknown by `other`.
1993 pub extern "C" fn InitFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InitFeatures, other: &crate::lightning::ln::features::InitFeatures) -> bool {
1994 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
1998 /// Returns true if this `Features` object contains unknown feature flags which are set as
2002 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
2003 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2007 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2008 /// by [bLIP 2] or if it is a known `T` feature.
2010 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2011 /// be set instead (i.e., `bit - 1`).
2013 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2016 pub extern "C" fn InitFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::InitFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2017 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_required_custom_bit(bit);
2018 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2022 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2023 /// by [bLIP 2] or if it is a known `T` feature.
2025 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2026 /// set instead (i.e., `bit + 1`).
2028 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2031 pub extern "C" fn InitFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::InitFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2032 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_optional_custom_bit(bit);
2033 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2037 /// Create a blank Features with no features set
2040 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
2041 let mut ret = lightning::ln::features::NodeFeatures::empty();
2042 crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2045 /// Returns true if this `Features` object contains required features unknown by `other`.
2048 pub extern "C" fn NodeFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::NodeFeatures, other: &crate::lightning::ln::features::NodeFeatures) -> bool {
2049 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2053 /// Returns true if this `Features` object contains unknown feature flags which are set as
2057 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
2058 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2062 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2063 /// by [bLIP 2] or if it is a known `T` feature.
2065 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2066 /// be set instead (i.e., `bit - 1`).
2068 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2071 pub extern "C" fn NodeFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::NodeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2072 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_required_custom_bit(bit);
2073 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2077 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2078 /// by [bLIP 2] or if it is a known `T` feature.
2080 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2081 /// set instead (i.e., `bit + 1`).
2083 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2086 pub extern "C" fn NodeFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::NodeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2087 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_optional_custom_bit(bit);
2088 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2092 /// Create a blank Features with no features set
2095 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
2096 let mut ret = lightning::ln::features::ChannelFeatures::empty();
2097 crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2100 /// Returns true if this `Features` object contains required features unknown by `other`.
2103 pub extern "C" fn ChannelFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelFeatures, other: &crate::lightning::ln::features::ChannelFeatures) -> bool {
2104 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2108 /// Returns true if this `Features` object contains unknown feature flags which are set as
2112 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
2113 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2117 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2118 /// by [bLIP 2] or if it is a known `T` feature.
2120 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2121 /// be set instead (i.e., `bit - 1`).
2123 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2126 pub extern "C" fn ChannelFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2127 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_required_custom_bit(bit);
2128 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2132 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2133 /// by [bLIP 2] or if it is a known `T` feature.
2135 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2136 /// set instead (i.e., `bit + 1`).
2138 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2141 pub extern "C" fn ChannelFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2142 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_optional_custom_bit(bit);
2143 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2147 /// Create a blank Features with no features set
2150 pub extern "C" fn Bolt11InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt11InvoiceFeatures {
2151 let mut ret = lightning::ln::features::Bolt11InvoiceFeatures::empty();
2152 crate::lightning::ln::features::Bolt11InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2155 /// Returns true if this `Features` object contains required features unknown by `other`.
2158 pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures, other: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
2159 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2163 /// Returns true if this `Features` object contains unknown feature flags which are set as
2167 pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
2168 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2172 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2173 /// by [bLIP 2] or if it is a known `T` feature.
2175 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2176 /// be set instead (i.e., `bit - 1`).
2178 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2181 pub extern "C" fn Bolt11InvoiceFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2182 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_required_custom_bit(bit);
2183 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2187 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2188 /// by [bLIP 2] or if it is a known `T` feature.
2190 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2191 /// set instead (i.e., `bit + 1`).
2193 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2196 pub extern "C" fn Bolt11InvoiceFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2197 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_optional_custom_bit(bit);
2198 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2202 /// Create a blank Features with no features set
2205 pub extern "C" fn OfferFeatures_empty() -> crate::lightning::ln::features::OfferFeatures {
2206 let mut ret = lightning::ln::features::OfferFeatures::empty();
2207 crate::lightning::ln::features::OfferFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2210 /// Returns true if this `Features` object contains required features unknown by `other`.
2213 pub extern "C" fn OfferFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::OfferFeatures, other: &crate::lightning::ln::features::OfferFeatures) -> bool {
2214 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2218 /// Returns true if this `Features` object contains unknown feature flags which are set as
2222 pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::OfferFeatures) -> bool {
2223 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2227 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2228 /// by [bLIP 2] or if it is a known `T` feature.
2230 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2231 /// be set instead (i.e., `bit - 1`).
2233 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2236 pub extern "C" fn OfferFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::OfferFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2237 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_required_custom_bit(bit);
2238 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2242 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2243 /// by [bLIP 2] or if it is a known `T` feature.
2245 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2246 /// set instead (i.e., `bit + 1`).
2248 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2251 pub extern "C" fn OfferFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::OfferFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2252 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_optional_custom_bit(bit);
2253 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2257 /// Create a blank Features with no features set
2260 pub extern "C" fn InvoiceRequestFeatures_empty() -> crate::lightning::ln::features::InvoiceRequestFeatures {
2261 let mut ret = lightning::ln::features::InvoiceRequestFeatures::empty();
2262 crate::lightning::ln::features::InvoiceRequestFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2265 /// Returns true if this `Features` object contains required features unknown by `other`.
2268 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures, other: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
2269 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2273 /// Returns true if this `Features` object contains unknown feature flags which are set as
2277 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
2278 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2282 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2283 /// by [bLIP 2] or if it is a known `T` feature.
2285 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2286 /// be set instead (i.e., `bit - 1`).
2288 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2291 pub extern "C" fn InvoiceRequestFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::InvoiceRequestFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2292 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_required_custom_bit(bit);
2293 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2297 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2298 /// by [bLIP 2] or if it is a known `T` feature.
2300 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2301 /// set instead (i.e., `bit + 1`).
2303 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2306 pub extern "C" fn InvoiceRequestFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::InvoiceRequestFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2307 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_optional_custom_bit(bit);
2308 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2312 /// Create a blank Features with no features set
2315 pub extern "C" fn Bolt12InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt12InvoiceFeatures {
2316 let mut ret = lightning::ln::features::Bolt12InvoiceFeatures::empty();
2317 crate::lightning::ln::features::Bolt12InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2320 /// Returns true if this `Features` object contains required features unknown by `other`.
2323 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures, other: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2324 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2328 /// Returns true if this `Features` object contains unknown feature flags which are set as
2332 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2333 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2337 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2338 /// by [bLIP 2] or if it is a known `T` feature.
2340 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2341 /// be set instead (i.e., `bit - 1`).
2343 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2346 pub extern "C" fn Bolt12InvoiceFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2347 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_required_custom_bit(bit);
2348 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2352 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2353 /// by [bLIP 2] or if it is a known `T` feature.
2355 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2356 /// set instead (i.e., `bit + 1`).
2358 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2361 pub extern "C" fn Bolt12InvoiceFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2362 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_optional_custom_bit(bit);
2363 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2367 /// Create a blank Features with no features set
2370 pub extern "C" fn BlindedHopFeatures_empty() -> crate::lightning::ln::features::BlindedHopFeatures {
2371 let mut ret = lightning::ln::features::BlindedHopFeatures::empty();
2372 crate::lightning::ln::features::BlindedHopFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2375 /// Returns true if this `Features` object contains required features unknown by `other`.
2378 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::BlindedHopFeatures, other: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2379 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2383 /// Returns true if this `Features` object contains unknown feature flags which are set as
2387 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2388 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2392 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2393 /// by [bLIP 2] or if it is a known `T` feature.
2395 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2396 /// be set instead (i.e., `bit - 1`).
2398 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2401 pub extern "C" fn BlindedHopFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::BlindedHopFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2402 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_required_custom_bit(bit);
2403 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2407 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2408 /// by [bLIP 2] or if it is a known `T` feature.
2410 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2411 /// set instead (i.e., `bit + 1`).
2413 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2416 pub extern "C" fn BlindedHopFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::BlindedHopFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2417 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_optional_custom_bit(bit);
2418 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2422 /// Create a blank Features with no features set
2425 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
2426 let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
2427 crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2430 /// Returns true if this `Features` object contains required features unknown by `other`.
2433 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures, other: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2434 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2438 /// Returns true if this `Features` object contains unknown feature flags which are set as
2442 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2443 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2447 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2448 /// by [bLIP 2] or if it is a known `T` feature.
2450 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2451 /// be set instead (i.e., `bit - 1`).
2453 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2456 pub extern "C" fn ChannelTypeFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2457 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_required_custom_bit(bit);
2458 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2462 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2463 /// by [bLIP 2] or if it is a known `T` feature.
2465 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2466 /// set instead (i.e., `bit + 1`).
2468 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2471 pub extern "C" fn ChannelTypeFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2472 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_optional_custom_bit(bit);
2473 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2478 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
2479 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
2480 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2483 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2484 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
2487 /// Read a InitFeatures from a byte array, created by InitFeatures_write
2488 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
2489 let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2490 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() };
2494 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
2495 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
2496 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2499 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2500 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
2503 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
2504 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
2505 let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2506 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() };
2510 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
2511 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
2512 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2515 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2516 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
2519 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
2520 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
2521 let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2522 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() };
2526 /// Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
2527 pub extern "C" fn Bolt11InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
2528 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2531 pub(crate) extern "C" fn Bolt11InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2532 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt11InvoiceFeatures) })
2535 /// Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
2536 pub extern "C" fn Bolt11InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_Bolt11InvoiceFeaturesDecodeErrorZ {
2537 let res: Result<lightning::ln::features::Bolt11InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2538 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::Bolt11InvoiceFeatures { 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() };
2542 /// Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
2543 pub extern "C" fn Bolt12InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
2544 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2547 pub(crate) extern "C" fn Bolt12InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2548 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt12InvoiceFeatures) })
2551 /// Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
2552 pub extern "C" fn Bolt12InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_Bolt12InvoiceFeaturesDecodeErrorZ {
2553 let res: Result<lightning::ln::features::Bolt12InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2554 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::Bolt12InvoiceFeatures { 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() };
2558 /// Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
2559 pub extern "C" fn BlindedHopFeatures_write(obj: &crate::lightning::ln::features::BlindedHopFeatures) -> crate::c_types::derived::CVec_u8Z {
2560 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2563 pub(crate) extern "C" fn BlindedHopFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2564 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedHopFeatures) })
2567 /// Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
2568 pub extern "C" fn BlindedHopFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_BlindedHopFeaturesDecodeErrorZ {
2569 let res: Result<lightning::ln::features::BlindedHopFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2570 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() };
2574 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
2575 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
2576 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2579 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2580 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
2583 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
2584 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
2585 let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2586 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() };