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 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
67 //! [messages]: crate::ln::msgs
69 use alloc::str::FromStr;
70 use core::ffi::c_void;
71 use core::convert::Infallible;
72 use bitcoin::hashes::Hash;
73 use crate::c_types::*;
74 #[cfg(feature="no-std")]
75 use alloc::{vec::Vec, boxed::Box};
79 use alloc::str::FromStr;
80 use core::ffi::c_void;
81 use core::convert::Infallible;
82 use bitcoin::hashes::Hash;
83 use crate::c_types::*;
84 #[cfg(feature="no-std")]
85 use alloc::{vec::Vec, boxed::Box};
87 /// Set this feature as optional.
89 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
90 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_optional()
93 /// Set this feature as required.
95 pub extern "C" fn InitFeatures_set_data_loss_protect_required(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_required()
99 /// Checks if this feature is supported.
102 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
103 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
107 /// Set this feature as optional.
109 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
110 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_optional()
113 /// Set this feature as required.
115 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(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_required()
119 /// Checks if this feature is supported.
122 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
123 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
127 /// Checks if this feature is required.
130 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
131 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
135 /// Checks if this feature is required.
138 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
139 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
143 /// Set this feature as optional.
145 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
146 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_optional()
149 /// Set this feature as required.
151 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(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_required()
155 /// Checks if this feature is supported.
158 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
159 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
163 /// Set this feature as optional.
165 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
166 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_optional()
169 /// Set this feature as required.
171 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(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_required()
175 /// Checks if this feature is supported.
178 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
179 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
183 /// Set this feature as optional.
185 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
186 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_optional()
189 /// Set this feature as required.
191 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(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_required()
195 /// Checks if this feature is supported.
198 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
199 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
203 /// Checks if this feature is required.
206 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
207 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
211 /// Checks if this feature is required.
214 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
215 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
219 /// Set this feature as optional.
221 pub extern "C" fn InitFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
222 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_optional()
225 /// Set this feature as required.
227 pub extern "C" fn InitFeatures_set_gossip_queries_required(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_required()
231 /// Checks if this feature is supported.
234 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
235 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
239 /// Set this feature as optional.
241 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
242 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_optional()
245 /// Set this feature as required.
247 pub extern "C" fn NodeFeatures_set_gossip_queries_required(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_required()
251 /// Checks if this feature is supported.
254 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
255 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
259 /// Checks if this feature is required.
262 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
263 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
267 /// Checks if this feature is required.
270 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
271 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
275 /// Set this feature as optional.
277 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
278 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_optional()
281 /// Set this feature as required.
283 pub extern "C" fn InitFeatures_set_variable_length_onion_required(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_required()
287 /// Checks if this feature is supported.
290 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
291 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
295 /// Set this feature as optional.
297 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
298 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_optional()
301 /// Set this feature as required.
303 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(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_required()
307 /// Checks if this feature is supported.
310 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
311 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
315 /// Set this feature as optional.
317 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
318 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_optional()
321 /// Set this feature as required.
323 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
324 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_required()
327 /// Checks if this feature is supported.
330 pub extern "C" fn InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
331 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
335 /// Checks if this feature is required.
338 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
339 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
343 /// Checks if this feature is required.
346 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
347 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
351 /// Checks if this feature is required.
354 pub extern "C" fn InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
355 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
359 /// Set this feature as optional.
361 pub extern "C" fn InitFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
362 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_optional()
365 /// Set this feature as required.
367 pub extern "C" fn InitFeatures_set_static_remote_key_required(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_required()
371 /// Checks if this feature is supported.
374 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
375 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
379 /// Set this feature as optional.
381 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
382 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_optional()
385 /// Set this feature as required.
387 pub extern "C" fn NodeFeatures_set_static_remote_key_required(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_required()
391 /// Checks if this feature is supported.
394 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
395 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
399 /// Set this feature as optional.
401 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
402 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_optional()
405 /// Set this feature as required.
407 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(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_required()
411 /// Checks if this feature is supported.
414 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
415 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
419 /// Checks if this feature is required.
422 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
423 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
427 /// Checks if this feature is required.
430 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
431 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
435 /// Checks if this feature is required.
438 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
439 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
443 /// Set this feature as optional.
445 pub extern "C" fn InitFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
446 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_optional()
449 /// Set this feature as required.
451 pub extern "C" fn InitFeatures_set_payment_secret_required(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_required()
455 /// Checks if this feature is supported.
458 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
459 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
463 /// Set this feature as optional.
465 pub extern "C" fn NodeFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
466 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_optional()
469 /// Set this feature as required.
471 pub extern "C" fn NodeFeatures_set_payment_secret_required(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_required()
475 /// Checks if this feature is supported.
478 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
479 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
483 /// Set this feature as optional.
485 pub extern "C" fn InvoiceFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
486 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_optional()
489 /// Set this feature as required.
491 pub extern "C" fn InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
492 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_required()
495 /// Checks if this feature is supported.
498 pub extern "C" fn InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
499 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
503 /// Checks if this feature is required.
506 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
507 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
511 /// Checks if this feature is required.
514 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
515 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
519 /// Checks if this feature is required.
522 pub extern "C" fn InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
523 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
527 /// Set this feature as optional.
529 pub extern "C" fn InitFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
530 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_optional()
533 /// Set this feature as required.
535 pub extern "C" fn InitFeatures_set_basic_mpp_required(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_required()
539 /// Checks if this feature is supported.
542 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
543 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
547 /// Set this feature as optional.
549 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
550 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_optional()
553 /// Set this feature as required.
555 pub extern "C" fn NodeFeatures_set_basic_mpp_required(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_required()
559 /// Checks if this feature is supported.
562 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
563 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
567 /// Set this feature as optional.
569 pub extern "C" fn InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
570 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_optional()
573 /// Set this feature as required.
575 pub extern "C" fn InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
576 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_required()
579 /// Checks if this feature is supported.
582 pub extern "C" fn InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
583 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
587 /// Set this feature as optional.
589 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
590 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_optional()
593 /// Set this feature as required.
595 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_required(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_required()
599 /// Checks if this feature is supported.
602 pub extern "C" fn Bolt12InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
603 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
607 /// Checks if this feature is required.
610 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
611 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
615 /// Checks if this feature is required.
618 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
619 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
623 /// Checks if this feature is required.
626 pub extern "C" fn InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
627 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
631 /// Checks if this feature is required.
634 pub extern "C" fn Bolt12InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
635 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
639 /// Set this feature as optional.
641 pub extern "C" fn InitFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
642 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_optional()
645 /// Set this feature as required.
647 pub extern "C" fn InitFeatures_set_wumbo_required(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_required()
651 /// Checks if this feature is supported.
654 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
655 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
659 /// Set this feature as optional.
661 pub extern "C" fn NodeFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
662 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_optional()
665 /// Set this feature as required.
667 pub extern "C" fn NodeFeatures_set_wumbo_required(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_required()
671 /// Checks if this feature is supported.
674 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
675 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
679 /// Checks if this feature is required.
682 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
683 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
687 /// Checks if this feature is required.
690 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
691 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
695 /// Set this feature as optional.
697 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
698 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
701 /// Set this feature as required.
703 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_required(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_zero_fee_htlc_tx_required()
707 /// Checks if this feature is supported.
710 pub extern "C" fn InitFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
711 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
715 /// Set this feature as optional.
717 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
718 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
721 /// Set this feature as required.
723 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_required(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_zero_fee_htlc_tx_required()
727 /// Checks if this feature is supported.
730 pub extern "C" fn NodeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
731 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
735 /// Set this feature as optional.
737 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
738 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
741 /// Set this feature as required.
743 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(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_zero_fee_htlc_tx_required()
747 /// Checks if this feature is supported.
750 pub extern "C" fn ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
751 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
755 /// Checks if this feature is required.
758 pub extern "C" fn InitFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
759 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
763 /// Checks if this feature is required.
766 pub extern "C" fn NodeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
767 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
771 /// Checks if this feature is required.
774 pub extern "C" fn ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
775 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
779 /// Set this feature as optional.
781 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
782 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_optional()
785 /// Set this feature as required.
787 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(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_shutdown_any_segwit_required()
791 /// Checks if this feature is supported.
794 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
795 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
799 /// Set this feature as optional.
801 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
802 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_optional()
805 /// Set this feature as required.
807 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(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_shutdown_any_segwit_required()
811 /// Checks if this feature is supported.
814 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
815 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
819 /// Checks if this feature is required.
822 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
823 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
827 /// Checks if this feature is required.
830 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
831 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
835 /// Set this feature as optional.
837 pub extern "C" fn InitFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
838 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_optional()
841 /// Set this feature as required.
843 pub extern "C" fn InitFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
844 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_required()
847 /// Checks if this feature is supported.
850 pub extern "C" fn InitFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
851 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
855 /// Set this feature as optional.
857 pub extern "C" fn NodeFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
858 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_optional()
861 /// Set this feature as required.
863 pub extern "C" fn NodeFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
864 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_required()
867 /// Checks if this feature is supported.
870 pub extern "C" fn NodeFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
871 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
875 /// Checks if this feature is required.
878 pub extern "C" fn InitFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
879 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
883 /// Checks if this feature is required.
886 pub extern "C" fn NodeFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
887 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
891 /// Set this feature as optional.
893 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
894 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
897 /// Set this feature as required.
899 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
900 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
903 /// Checks if this feature is supported.
906 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
907 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
911 /// Set this feature as optional.
913 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
914 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
917 /// Set this feature as required.
919 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
920 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
923 /// Checks if this feature is supported.
926 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
927 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
931 /// Checks if this feature is required.
934 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
935 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
939 /// Checks if this feature is required.
942 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
943 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
947 /// Set this feature as optional.
949 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
950 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
953 /// Set this feature as required.
955 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
956 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
959 /// Checks if this feature is supported.
962 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
963 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
967 /// Set this feature as optional.
969 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
970 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
973 /// Set this feature as required.
975 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
976 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
979 /// Checks if this feature is supported.
982 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
983 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
987 /// Set this feature as optional.
989 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
990 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
993 /// Set this feature as required.
995 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
996 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
999 /// Checks if this feature is supported.
1002 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1003 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1007 /// Checks if this feature is required.
1010 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1011 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1015 /// Checks if this feature is required.
1018 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1019 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1023 /// Checks if this feature is required.
1026 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1027 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1031 /// Set this feature as optional.
1033 pub extern "C" fn InvoiceFeatures_set_payment_metadata_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
1034 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_metadata_optional()
1037 /// Set this feature as required.
1039 pub extern "C" fn InvoiceFeatures_set_payment_metadata_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
1040 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_metadata_required()
1043 /// Checks if this feature is supported.
1046 pub extern "C" fn InvoiceFeatures_supports_payment_metadata(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1047 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_metadata();
1051 /// Checks if this feature is required.
1054 pub extern "C" fn InvoiceFeatures_requires_payment_metadata(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1055 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_metadata();
1059 /// Set this feature as optional.
1061 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1062 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
1065 /// Set this feature as required.
1067 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1068 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
1071 /// Checks if this feature is supported.
1074 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1075 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1079 /// Set this feature as optional.
1081 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1082 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
1085 /// Set this feature as required.
1087 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1088 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
1091 /// Checks if this feature is supported.
1094 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1095 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1099 /// Set this feature as optional.
1101 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1102 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
1105 /// Set this feature as required.
1107 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1108 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
1111 /// Checks if this feature is supported.
1114 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1115 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1119 /// Checks if this feature is required.
1122 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1123 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1127 /// Checks if this feature is required.
1130 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1131 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1135 /// Checks if this feature is required.
1138 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1139 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1143 /// Set this feature as optional.
1145 pub extern "C" fn NodeFeatures_set_keysend_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1146 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_optional()
1149 /// Set this feature as required.
1151 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1152 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
1155 /// Checks if this feature is supported.
1158 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1159 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
1163 /// Checks if this feature is required.
1166 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1167 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
1172 /// Checks if two InitFeaturess contain equal inner contents.
1173 /// This ignores pointers and is_owned flags and looks at the values in fields.
1174 /// Two objects with NULL inner values will be considered "equal" here.
1176 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
1177 if a.inner == b.inner { return true; }
1178 if a.inner.is_null() || b.inner.is_null() { return false; }
1179 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1181 /// Checks if two NodeFeaturess contain equal inner contents.
1182 /// This ignores pointers and is_owned flags and looks at the values in fields.
1183 /// Two objects with NULL inner values will be considered "equal" here.
1185 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
1186 if a.inner == b.inner { return true; }
1187 if a.inner.is_null() || b.inner.is_null() { return false; }
1188 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1190 /// Checks if two ChannelFeaturess contain equal inner contents.
1191 /// This ignores pointers and is_owned flags and looks at the values in fields.
1192 /// Two objects with NULL inner values will be considered "equal" here.
1194 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
1195 if a.inner == b.inner { return true; }
1196 if a.inner.is_null() || b.inner.is_null() { return false; }
1197 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1199 /// Checks if two InvoiceFeaturess contain equal inner contents.
1200 /// This ignores pointers and is_owned flags and looks at the values in fields.
1201 /// Two objects with NULL inner values will be considered "equal" here.
1203 pub extern "C" fn InvoiceFeatures_eq(a: &InvoiceFeatures, b: &InvoiceFeatures) -> bool {
1204 if a.inner == b.inner { return true; }
1205 if a.inner.is_null() || b.inner.is_null() { return false; }
1206 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1208 /// Checks if two OfferFeaturess contain equal inner contents.
1209 /// This ignores pointers and is_owned flags and looks at the values in fields.
1210 /// Two objects with NULL inner values will be considered "equal" here.
1212 pub extern "C" fn OfferFeatures_eq(a: &OfferFeatures, b: &OfferFeatures) -> bool {
1213 if a.inner == b.inner { return true; }
1214 if a.inner.is_null() || b.inner.is_null() { return false; }
1215 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1217 /// Checks if two InvoiceRequestFeaturess contain equal inner contents.
1218 /// This ignores pointers and is_owned flags and looks at the values in fields.
1219 /// Two objects with NULL inner values will be considered "equal" here.
1221 pub extern "C" fn InvoiceRequestFeatures_eq(a: &InvoiceRequestFeatures, b: &InvoiceRequestFeatures) -> bool {
1222 if a.inner == b.inner { return true; }
1223 if a.inner.is_null() || b.inner.is_null() { return false; }
1224 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1226 /// Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
1227 /// This ignores pointers and is_owned flags and looks at the values in fields.
1228 /// Two objects with NULL inner values will be considered "equal" here.
1230 pub extern "C" fn Bolt12InvoiceFeatures_eq(a: &Bolt12InvoiceFeatures, b: &Bolt12InvoiceFeatures) -> bool {
1231 if a.inner == b.inner { return true; }
1232 if a.inner.is_null() || b.inner.is_null() { return false; }
1233 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1235 /// Checks if two BlindedHopFeaturess contain equal inner contents.
1236 /// This ignores pointers and is_owned flags and looks at the values in fields.
1237 /// Two objects with NULL inner values will be considered "equal" here.
1239 pub extern "C" fn BlindedHopFeatures_eq(a: &BlindedHopFeatures, b: &BlindedHopFeatures) -> bool {
1240 if a.inner == b.inner { return true; }
1241 if a.inner.is_null() || b.inner.is_null() { return false; }
1242 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1244 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
1245 /// This ignores pointers and is_owned flags and looks at the values in fields.
1246 /// Two objects with NULL inner values will be considered "equal" here.
1248 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
1249 if a.inner == b.inner { return true; }
1250 if a.inner.is_null() || b.inner.is_null() { return false; }
1251 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1253 impl Clone for InitFeatures {
1254 fn clone(&self) -> Self {
1256 inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1257 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1263 /// Used only if an object of this type is returned as a trait impl by a method
1264 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1265 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
1268 /// Creates a copy of the InitFeatures
1269 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1272 impl Clone for NodeFeatures {
1273 fn clone(&self) -> Self {
1275 inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1276 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1282 /// Used only if an object of this type is returned as a trait impl by a method
1283 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1284 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
1287 /// Creates a copy of the NodeFeatures
1288 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1291 impl Clone for ChannelFeatures {
1292 fn clone(&self) -> Self {
1294 inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1295 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1301 /// Used only if an object of this type is returned as a trait impl by a method
1302 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1303 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
1306 /// Creates a copy of the ChannelFeatures
1307 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1310 impl Clone for InvoiceFeatures {
1311 fn clone(&self) -> Self {
1313 inner: if <*mut nativeInvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1314 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1320 /// Used only if an object of this type is returned as a trait impl by a method
1321 pub(crate) extern "C" fn InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1322 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceFeatures)).clone() })) as *mut c_void
1325 /// Creates a copy of the InvoiceFeatures
1326 pub extern "C" fn InvoiceFeatures_clone(orig: &InvoiceFeatures) -> InvoiceFeatures {
1329 impl Clone for OfferFeatures {
1330 fn clone(&self) -> Self {
1332 inner: if <*mut nativeOfferFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1333 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1339 /// Used only if an object of this type is returned as a trait impl by a method
1340 pub(crate) extern "C" fn OfferFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1341 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOfferFeatures)).clone() })) as *mut c_void
1344 /// Creates a copy of the OfferFeatures
1345 pub extern "C" fn OfferFeatures_clone(orig: &OfferFeatures) -> OfferFeatures {
1348 impl Clone for InvoiceRequestFeatures {
1349 fn clone(&self) -> Self {
1351 inner: if <*mut nativeInvoiceRequestFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1352 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1358 /// Used only if an object of this type is returned as a trait impl by a method
1359 pub(crate) extern "C" fn InvoiceRequestFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1360 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
1363 /// Creates a copy of the InvoiceRequestFeatures
1364 pub extern "C" fn InvoiceRequestFeatures_clone(orig: &InvoiceRequestFeatures) -> InvoiceRequestFeatures {
1367 impl Clone for Bolt12InvoiceFeatures {
1368 fn clone(&self) -> Self {
1370 inner: if <*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1371 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1377 /// Used only if an object of this type is returned as a trait impl by a method
1378 pub(crate) extern "C" fn Bolt12InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1379 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt12InvoiceFeatures)).clone() })) as *mut c_void
1382 /// Creates a copy of the Bolt12InvoiceFeatures
1383 pub extern "C" fn Bolt12InvoiceFeatures_clone(orig: &Bolt12InvoiceFeatures) -> Bolt12InvoiceFeatures {
1386 impl Clone for BlindedHopFeatures {
1387 fn clone(&self) -> Self {
1389 inner: if <*mut nativeBlindedHopFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1390 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1396 /// Used only if an object of this type is returned as a trait impl by a method
1397 pub(crate) extern "C" fn BlindedHopFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1398 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBlindedHopFeatures)).clone() })) as *mut c_void
1401 /// Creates a copy of the BlindedHopFeatures
1402 pub extern "C" fn BlindedHopFeatures_clone(orig: &BlindedHopFeatures) -> BlindedHopFeatures {
1405 impl Clone for ChannelTypeFeatures {
1406 fn clone(&self) -> Self {
1408 inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1409 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1415 /// Used only if an object of this type is returned as a trait impl by a method
1416 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1417 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
1420 /// Creates a copy of the ChannelTypeFeatures
1421 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1425 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1426 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1428 /// Features used within an `init` message.
1431 pub struct InitFeatures {
1432 /// A pointer to the opaque Rust object.
1434 /// Nearly everywhere, inner must be non-null, however in places where
1435 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1436 pub inner: *mut nativeInitFeatures,
1437 /// Indicates that this is the only struct which contains the same pointer.
1439 /// Rust functions which take ownership of an object provided via an argument require
1440 /// this to be true and invalidate the object pointed to by inner.
1444 impl Drop for InitFeatures {
1445 fn drop(&mut self) {
1446 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1447 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1451 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1453 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1455 /// Used only if an object of this type is returned as a trait impl by a method
1456 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1457 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInitFeatures) };
1461 pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1462 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1464 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1465 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1467 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1468 pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1469 assert!(self.is_owned);
1470 let ret = ObjOps::untweak_ptr(self.inner);
1471 self.inner = core::ptr::null_mut();
1476 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1477 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1479 /// Features used within a `node_announcement` message.
1482 pub struct NodeFeatures {
1483 /// A pointer to the opaque Rust object.
1485 /// Nearly everywhere, inner must be non-null, however in places where
1486 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1487 pub inner: *mut nativeNodeFeatures,
1488 /// Indicates that this is the only struct which contains the same pointer.
1490 /// Rust functions which take ownership of an object provided via an argument require
1491 /// this to be true and invalidate the object pointed to by inner.
1495 impl Drop for NodeFeatures {
1496 fn drop(&mut self) {
1497 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1498 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1502 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1504 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1506 /// Used only if an object of this type is returned as a trait impl by a method
1507 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1508 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeNodeFeatures) };
1512 pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1513 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1515 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1516 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1518 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1519 pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1520 assert!(self.is_owned);
1521 let ret = ObjOps::untweak_ptr(self.inner);
1522 self.inner = core::ptr::null_mut();
1527 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1528 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1530 /// Features used within a `channel_announcement` message.
1533 pub struct ChannelFeatures {
1534 /// A pointer to the opaque Rust object.
1536 /// Nearly everywhere, inner must be non-null, however in places where
1537 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1538 pub inner: *mut nativeChannelFeatures,
1539 /// Indicates that this is the only struct which contains the same pointer.
1541 /// Rust functions which take ownership of an object provided via an argument require
1542 /// this to be true and invalidate the object pointed to by inner.
1546 impl Drop for ChannelFeatures {
1547 fn drop(&mut self) {
1548 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1549 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1553 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1555 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1557 /// Used only if an object of this type is returned as a trait impl by a method
1558 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1559 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelFeatures) };
1562 impl ChannelFeatures {
1563 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1564 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1566 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1567 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1569 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1570 pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1571 assert!(self.is_owned);
1572 let ret = ObjOps::untweak_ptr(self.inner);
1573 self.inner = core::ptr::null_mut();
1578 use lightning::ln::features::InvoiceFeatures as nativeInvoiceFeaturesImport;
1579 pub(crate) type nativeInvoiceFeatures = nativeInvoiceFeaturesImport;
1581 /// Features used within an invoice.
1584 pub struct InvoiceFeatures {
1585 /// A pointer to the opaque Rust object.
1587 /// Nearly everywhere, inner must be non-null, however in places where
1588 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1589 pub inner: *mut nativeInvoiceFeatures,
1590 /// Indicates that this is the only struct which contains the same pointer.
1592 /// Rust functions which take ownership of an object provided via an argument require
1593 /// this to be true and invalidate the object pointed to by inner.
1597 impl Drop for InvoiceFeatures {
1598 fn drop(&mut self) {
1599 if self.is_owned && !<*mut nativeInvoiceFeatures>::is_null(self.inner) {
1600 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1604 /// Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
1606 pub extern "C" fn InvoiceFeatures_free(this_obj: InvoiceFeatures) { }
1608 /// Used only if an object of this type is returned as a trait impl by a method
1609 pub(crate) extern "C" fn InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1610 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceFeatures) };
1613 impl InvoiceFeatures {
1614 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceFeatures {
1615 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1617 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceFeatures {
1618 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1620 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1621 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceFeatures {
1622 assert!(self.is_owned);
1623 let ret = ObjOps::untweak_ptr(self.inner);
1624 self.inner = core::ptr::null_mut();
1629 use lightning::ln::features::OfferFeatures as nativeOfferFeaturesImport;
1630 pub(crate) type nativeOfferFeatures = nativeOfferFeaturesImport;
1632 /// Features used within an `offer`.
1635 pub struct OfferFeatures {
1636 /// A pointer to the opaque Rust object.
1638 /// Nearly everywhere, inner must be non-null, however in places where
1639 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1640 pub inner: *mut nativeOfferFeatures,
1641 /// Indicates that this is the only struct which contains the same pointer.
1643 /// Rust functions which take ownership of an object provided via an argument require
1644 /// this to be true and invalidate the object pointed to by inner.
1648 impl Drop for OfferFeatures {
1649 fn drop(&mut self) {
1650 if self.is_owned && !<*mut nativeOfferFeatures>::is_null(self.inner) {
1651 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1655 /// Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
1657 pub extern "C" fn OfferFeatures_free(this_obj: OfferFeatures) { }
1659 /// Used only if an object of this type is returned as a trait impl by a method
1660 pub(crate) extern "C" fn OfferFeatures_free_void(this_ptr: *mut c_void) {
1661 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferFeatures) };
1664 impl OfferFeatures {
1665 pub(crate) fn get_native_ref(&self) -> &'static nativeOfferFeatures {
1666 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1668 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferFeatures {
1669 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1671 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1672 pub(crate) fn take_inner(mut self) -> *mut nativeOfferFeatures {
1673 assert!(self.is_owned);
1674 let ret = ObjOps::untweak_ptr(self.inner);
1675 self.inner = core::ptr::null_mut();
1680 use lightning::ln::features::InvoiceRequestFeatures as nativeInvoiceRequestFeaturesImport;
1681 pub(crate) type nativeInvoiceRequestFeatures = nativeInvoiceRequestFeaturesImport;
1683 /// Features used within an `invoice_request`.
1686 pub struct InvoiceRequestFeatures {
1687 /// A pointer to the opaque Rust object.
1689 /// Nearly everywhere, inner must be non-null, however in places where
1690 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1691 pub inner: *mut nativeInvoiceRequestFeatures,
1692 /// Indicates that this is the only struct which contains the same pointer.
1694 /// Rust functions which take ownership of an object provided via an argument require
1695 /// this to be true and invalidate the object pointed to by inner.
1699 impl Drop for InvoiceRequestFeatures {
1700 fn drop(&mut self) {
1701 if self.is_owned && !<*mut nativeInvoiceRequestFeatures>::is_null(self.inner) {
1702 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1706 /// Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
1708 pub extern "C" fn InvoiceRequestFeatures_free(this_obj: InvoiceRequestFeatures) { }
1710 /// Used only if an object of this type is returned as a trait impl by a method
1711 pub(crate) extern "C" fn InvoiceRequestFeatures_free_void(this_ptr: *mut c_void) {
1712 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceRequestFeatures) };
1715 impl InvoiceRequestFeatures {
1716 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceRequestFeatures {
1717 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1719 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceRequestFeatures {
1720 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1722 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1723 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceRequestFeatures {
1724 assert!(self.is_owned);
1725 let ret = ObjOps::untweak_ptr(self.inner);
1726 self.inner = core::ptr::null_mut();
1731 use lightning::ln::features::Bolt12InvoiceFeatures as nativeBolt12InvoiceFeaturesImport;
1732 pub(crate) type nativeBolt12InvoiceFeatures = nativeBolt12InvoiceFeaturesImport;
1734 /// Features used within an `invoice`.
1737 pub struct Bolt12InvoiceFeatures {
1738 /// A pointer to the opaque Rust object.
1740 /// Nearly everywhere, inner must be non-null, however in places where
1741 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1742 pub inner: *mut nativeBolt12InvoiceFeatures,
1743 /// Indicates that this is the only struct which contains the same pointer.
1745 /// Rust functions which take ownership of an object provided via an argument require
1746 /// this to be true and invalidate the object pointed to by inner.
1750 impl Drop for Bolt12InvoiceFeatures {
1751 fn drop(&mut self) {
1752 if self.is_owned && !<*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) {
1753 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1757 /// Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
1759 pub extern "C" fn Bolt12InvoiceFeatures_free(this_obj: Bolt12InvoiceFeatures) { }
1761 /// Used only if an object of this type is returned as a trait impl by a method
1762 pub(crate) extern "C" fn Bolt12InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1763 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt12InvoiceFeatures) };
1766 impl Bolt12InvoiceFeatures {
1767 pub(crate) fn get_native_ref(&self) -> &'static nativeBolt12InvoiceFeatures {
1768 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1770 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt12InvoiceFeatures {
1771 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1773 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1774 pub(crate) fn take_inner(mut self) -> *mut nativeBolt12InvoiceFeatures {
1775 assert!(self.is_owned);
1776 let ret = ObjOps::untweak_ptr(self.inner);
1777 self.inner = core::ptr::null_mut();
1782 use lightning::ln::features::BlindedHopFeatures as nativeBlindedHopFeaturesImport;
1783 pub(crate) type nativeBlindedHopFeatures = nativeBlindedHopFeaturesImport;
1785 /// Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
1788 pub struct BlindedHopFeatures {
1789 /// A pointer to the opaque Rust object.
1791 /// Nearly everywhere, inner must be non-null, however in places where
1792 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1793 pub inner: *mut nativeBlindedHopFeatures,
1794 /// Indicates that this is the only struct which contains the same pointer.
1796 /// Rust functions which take ownership of an object provided via an argument require
1797 /// this to be true and invalidate the object pointed to by inner.
1801 impl Drop for BlindedHopFeatures {
1802 fn drop(&mut self) {
1803 if self.is_owned && !<*mut nativeBlindedHopFeatures>::is_null(self.inner) {
1804 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1808 /// Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
1810 pub extern "C" fn BlindedHopFeatures_free(this_obj: BlindedHopFeatures) { }
1812 /// Used only if an object of this type is returned as a trait impl by a method
1813 pub(crate) extern "C" fn BlindedHopFeatures_free_void(this_ptr: *mut c_void) {
1814 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBlindedHopFeatures) };
1817 impl BlindedHopFeatures {
1818 pub(crate) fn get_native_ref(&self) -> &'static nativeBlindedHopFeatures {
1819 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1821 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBlindedHopFeatures {
1822 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1824 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1825 pub(crate) fn take_inner(mut self) -> *mut nativeBlindedHopFeatures {
1826 assert!(self.is_owned);
1827 let ret = ObjOps::untweak_ptr(self.inner);
1828 self.inner = core::ptr::null_mut();
1833 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
1834 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
1836 /// Features used within the channel_type field in an OpenChannel message.
1838 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
1839 /// semantics of our interaction with our peer.
1841 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
1842 /// the counterparty, only required features are allowed here.
1844 /// This is serialized differently from other feature types - it is not prefixed by a length, and
1845 /// thus must only appear inside a TLV where its length is known in advance.
1848 pub struct ChannelTypeFeatures {
1849 /// A pointer to the opaque Rust object.
1851 /// Nearly everywhere, inner must be non-null, however in places where
1852 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1853 pub inner: *mut nativeChannelTypeFeatures,
1854 /// Indicates that this is the only struct which contains the same pointer.
1856 /// Rust functions which take ownership of an object provided via an argument require
1857 /// this to be true and invalidate the object pointed to by inner.
1861 impl Drop for ChannelTypeFeatures {
1862 fn drop(&mut self) {
1863 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
1864 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1868 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
1870 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
1872 /// Used only if an object of this type is returned as a trait impl by a method
1873 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
1874 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures) };
1877 impl ChannelTypeFeatures {
1878 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
1879 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1881 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
1882 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1884 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1885 pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
1886 assert!(self.is_owned);
1887 let ret = ObjOps::untweak_ptr(self.inner);
1888 self.inner = core::ptr::null_mut();
1892 /// Create a blank Features with no features set
1895 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
1896 let mut ret = lightning::ln::features::InitFeatures::empty();
1897 crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1900 /// Returns true if this `Features` object contains unknown feature flags which are set as
1904 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1905 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1909 /// Create a blank Features with no features set
1912 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
1913 let mut ret = lightning::ln::features::NodeFeatures::empty();
1914 crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1917 /// Returns true if this `Features` object contains unknown feature flags which are set as
1921 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1922 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1926 /// Create a blank Features with no features set
1929 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
1930 let mut ret = lightning::ln::features::ChannelFeatures::empty();
1931 crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1934 /// Returns true if this `Features` object contains unknown feature flags which are set as
1938 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
1939 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1943 /// Create a blank Features with no features set
1946 pub extern "C" fn InvoiceFeatures_empty() -> crate::lightning::ln::features::InvoiceFeatures {
1947 let mut ret = lightning::ln::features::InvoiceFeatures::empty();
1948 crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1951 /// Returns true if this `Features` object contains unknown feature flags which are set as
1955 pub extern "C" fn InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1956 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1960 /// Create a blank Features with no features set
1963 pub extern "C" fn OfferFeatures_empty() -> crate::lightning::ln::features::OfferFeatures {
1964 let mut ret = lightning::ln::features::OfferFeatures::empty();
1965 crate::lightning::ln::features::OfferFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1968 /// Returns true if this `Features` object contains unknown feature flags which are set as
1972 pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::OfferFeatures) -> bool {
1973 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1977 /// Create a blank Features with no features set
1980 pub extern "C" fn InvoiceRequestFeatures_empty() -> crate::lightning::ln::features::InvoiceRequestFeatures {
1981 let mut ret = lightning::ln::features::InvoiceRequestFeatures::empty();
1982 crate::lightning::ln::features::InvoiceRequestFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1985 /// Returns true if this `Features` object contains unknown feature flags which are set as
1989 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
1990 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1994 /// Create a blank Features with no features set
1997 pub extern "C" fn Bolt12InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt12InvoiceFeatures {
1998 let mut ret = lightning::ln::features::Bolt12InvoiceFeatures::empty();
1999 crate::lightning::ln::features::Bolt12InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2002 /// Returns true if this `Features` object contains unknown feature flags which are set as
2006 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2007 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2011 /// Create a blank Features with no features set
2014 pub extern "C" fn BlindedHopFeatures_empty() -> crate::lightning::ln::features::BlindedHopFeatures {
2015 let mut ret = lightning::ln::features::BlindedHopFeatures::empty();
2016 crate::lightning::ln::features::BlindedHopFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2019 /// Returns true if this `Features` object contains unknown feature flags which are set as
2023 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2024 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2028 /// Create a blank Features with no features set
2031 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
2032 let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
2033 crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2036 /// Returns true if this `Features` object contains unknown feature flags which are set as
2040 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2041 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2046 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
2047 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
2048 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2051 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2052 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
2055 /// Read a InitFeatures from a byte array, created by InitFeatures_write
2056 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
2057 let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2058 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() };
2062 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
2063 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
2064 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2067 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2068 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
2071 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
2072 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
2073 let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2074 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() };
2078 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
2079 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
2080 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2083 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2084 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
2087 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
2088 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
2089 let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2090 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() };
2094 /// Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
2095 pub extern "C" fn InvoiceFeatures_write(obj: &crate::lightning::ln::features::InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
2096 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2099 pub(crate) extern "C" fn InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2100 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceFeatures) })
2103 /// Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
2104 pub extern "C" fn InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InvoiceFeaturesDecodeErrorZ {
2105 let res: Result<lightning::ln::features::InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2106 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
2110 /// Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
2111 pub extern "C" fn BlindedHopFeatures_write(obj: &crate::lightning::ln::features::BlindedHopFeatures) -> crate::c_types::derived::CVec_u8Z {
2112 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2115 pub(crate) extern "C" fn BlindedHopFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2116 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedHopFeatures) })
2119 /// Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
2120 pub extern "C" fn BlindedHopFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_BlindedHopFeaturesDecodeErrorZ {
2121 let res: Result<lightning::ln::features::BlindedHopFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2122 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() };
2126 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
2127 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
2128 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2131 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2132 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
2135 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
2136 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
2137 let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2138 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() };