1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
4 // This file is licensed under the license available in the LICENSE or LICENSE.md
5 // file in the root of this repository or, if no such file exists, the same
6 // license as that which applies to the original source files from which this
7 // source was automatically generated.
9 //! Feature flag definitions for the Lightning protocol according to [BOLT #9].
11 //! Lightning nodes advertise a supported set of operation through feature flags. Features are
12 //! applicable for a specific context as indicated in some [messages]. [`Features`] encapsulates
13 //! behavior for specifying and checking feature flags for a particular context. Each feature is
14 //! defined internally by a trait specifying the corresponding flags (i.e., even and odd bits).
16 //! Whether a feature is considered \"known\" or \"unknown\" is relative to the implementation, whereas
17 //! the term \"supports\" is used in reference to a particular set of [`Features`]. That is, a node
18 //! supports a feature if it advertises the feature (as either required or optional) to its peers.
19 //! And the implementation can interpret a feature if the feature is known to it.
21 //! The following features are currently required in the LDK:
22 //! - `VariableLengthOnion` - requires/supports variable-length routing onion payloads
23 //! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for more information).
24 //! - `StaticRemoteKey` - requires/supports static key for remote output
25 //! (see [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more information).
27 //! The following features are currently supported in the LDK:
28 //! - `DataLossProtect` - requires/supports that a node which has somehow fallen behind, e.g., has been restored from an old backup,
29 //! can detect that it has fallen behind
30 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
31 //! - `InitialRoutingSync` - requires/supports that the sending node needs a complete routing information dump
32 //! (see [BOLT-7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#initial-sync) for more information).
33 //! - `UpfrontShutdownScript` - commits to a shutdown scriptpubkey when opening a channel
34 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message) for more information).
35 //! - `GossipQueries` - requires/supports more sophisticated gossip control
36 //! (see [BOLT-7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md) for more information).
37 //! - `PaymentSecret` - requires/supports that a node supports payment_secret field
38 //! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for more information).
39 //! - `BasicMPP` - requires/supports that a node can receive basic multi-part payments
40 //! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#basic-multi-part-payments) for more information).
41 //! - `Wumbo` - requires/supports that a node create large channels. Called `option_support_large_channel` in the spec.
42 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message) for more information).
43 //! - `ShutdownAnySegwit` - requires/supports that future segwit versions are allowed in `shutdown`
44 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
45 //! - `OnionMessages` - requires/supports forwarding onion messages
46 //! (see [BOLT-7](https://github.com/lightning/bolts/pull/759/files) for more information).
48 //! - `ChannelType` - node supports the channel_type field in open/accept
49 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
50 //! - `SCIDPrivacy` - supply channel aliases for routing
51 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
52 //! - `Keysend` - send funds to a node without an invoice
53 //! (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
55 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
56 //! [messages]: crate::ln::msgs
58 use alloc::str::FromStr;
59 use core::ffi::c_void;
60 use core::convert::Infallible;
61 use bitcoin::hashes::Hash;
62 use crate::c_types::*;
63 #[cfg(feature="no-std")]
64 use alloc::{vec::Vec, boxed::Box};
68 use alloc::str::FromStr;
69 use core::ffi::c_void;
70 use core::convert::Infallible;
71 use bitcoin::hashes::Hash;
72 use crate::c_types::*;
73 #[cfg(feature="no-std")]
74 use alloc::{vec::Vec, boxed::Box};
76 /// Set this feature as optional.
78 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
79 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_optional()
82 /// Set this feature as required.
84 pub extern "C" fn InitFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
85 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_required()
88 /// Checks if this feature is supported.
91 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
92 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
96 /// Set this feature as optional.
98 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
99 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_optional()
102 /// Set this feature as required.
104 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
105 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_required()
108 /// Checks if this feature is supported.
111 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
112 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
116 /// Checks if this feature is required.
119 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
120 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
124 /// Checks if this feature is required.
127 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
128 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
132 /// Set this feature as optional.
134 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
135 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_optional()
138 /// Set this feature as required.
140 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
141 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_required()
144 /// Checks if this feature is supported.
147 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
148 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
152 /// Set this feature as optional.
154 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
155 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_optional()
158 /// Set this feature as required.
160 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
161 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_required()
164 /// Checks if this feature is supported.
167 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
168 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
172 /// Set this feature as optional.
174 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
175 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_optional()
178 /// Set this feature as required.
180 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
181 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_required()
184 /// Checks if this feature is supported.
187 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
188 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
192 /// Checks if this feature is required.
195 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
196 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
200 /// Checks if this feature is required.
203 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
204 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
208 /// Set this feature as optional.
210 pub extern "C" fn InitFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
211 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_optional()
214 /// Set this feature as required.
216 pub extern "C" fn InitFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
217 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_required()
220 /// Checks if this feature is supported.
223 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
224 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
228 /// Set this feature as optional.
230 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
231 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_optional()
234 /// Set this feature as required.
236 pub extern "C" fn NodeFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
237 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_required()
240 /// Checks if this feature is supported.
243 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
244 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
248 /// Checks if this feature is required.
251 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
252 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
256 /// Checks if this feature is required.
259 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
260 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
264 /// Set this feature as optional.
266 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
267 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_optional()
270 /// Set this feature as required.
272 pub extern "C" fn InitFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
273 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_required()
276 /// Checks if this feature is supported.
279 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
280 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
284 /// Set this feature as optional.
286 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
287 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_optional()
290 /// Set this feature as required.
292 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
293 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_required()
296 /// Checks if this feature is supported.
299 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
300 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
304 /// Set this feature as optional.
306 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
307 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_optional()
310 /// Set this feature as required.
312 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
313 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_required()
316 /// Checks if this feature is supported.
319 pub extern "C" fn InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
320 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
324 /// Checks if this feature is required.
327 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
328 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
332 /// Checks if this feature is required.
335 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
336 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
340 /// Checks if this feature is required.
343 pub extern "C" fn InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
344 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
348 /// Set this feature as optional.
350 pub extern "C" fn InitFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
351 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_optional()
354 /// Set this feature as required.
356 pub extern "C" fn InitFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
357 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_required()
360 /// Checks if this feature is supported.
363 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
364 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
368 /// Set this feature as optional.
370 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
371 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_optional()
374 /// Set this feature as required.
376 pub extern "C" fn NodeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
377 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_required()
380 /// Checks if this feature is supported.
383 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
384 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
388 /// Set this feature as optional.
390 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
391 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_optional()
394 /// Set this feature as required.
396 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
397 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_required()
400 /// Checks if this feature is supported.
403 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
404 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
408 /// Checks if this feature is required.
411 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
412 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
416 /// Checks if this feature is required.
419 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
420 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
424 /// Checks if this feature is required.
427 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
428 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
432 /// Set this feature as optional.
434 pub extern "C" fn InitFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
435 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_optional()
438 /// Set this feature as required.
440 pub extern "C" fn InitFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
441 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_required()
444 /// Checks if this feature is supported.
447 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
448 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
452 /// Set this feature as optional.
454 pub extern "C" fn NodeFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
455 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_optional()
458 /// Set this feature as required.
460 pub extern "C" fn NodeFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
461 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_required()
464 /// Checks if this feature is supported.
467 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
468 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
472 /// Set this feature as optional.
474 pub extern "C" fn InvoiceFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
475 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_optional()
478 /// Set this feature as required.
480 pub extern "C" fn InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
481 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_required()
484 /// Checks if this feature is supported.
487 pub extern "C" fn InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
488 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
492 /// Checks if this feature is required.
495 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
496 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
500 /// Checks if this feature is required.
503 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
504 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
508 /// Checks if this feature is required.
511 pub extern "C" fn InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
512 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
516 /// Set this feature as optional.
518 pub extern "C" fn InitFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
519 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_optional()
522 /// Set this feature as required.
524 pub extern "C" fn InitFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
525 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_required()
528 /// Checks if this feature is supported.
531 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
532 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
536 /// Set this feature as optional.
538 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
539 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_optional()
542 /// Set this feature as required.
544 pub extern "C" fn NodeFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
545 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_required()
548 /// Checks if this feature is supported.
551 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
552 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
556 /// Set this feature as optional.
558 pub extern "C" fn InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
559 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_optional()
562 /// Set this feature as required.
564 pub extern "C" fn InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
565 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_required()
568 /// Checks if this feature is supported.
571 pub extern "C" fn InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
572 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
576 /// Checks if this feature is required.
579 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
580 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
584 /// Checks if this feature is required.
587 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
588 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
592 /// Checks if this feature is required.
595 pub extern "C" fn InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
596 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
600 /// Set this feature as optional.
602 pub extern "C" fn InitFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
603 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_optional()
606 /// Set this feature as required.
608 pub extern "C" fn InitFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
609 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_required()
612 /// Checks if this feature is supported.
615 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
616 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
620 /// Set this feature as optional.
622 pub extern "C" fn NodeFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
623 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_optional()
626 /// Set this feature as required.
628 pub extern "C" fn NodeFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
629 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_required()
632 /// Checks if this feature is supported.
635 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
636 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
640 /// Checks if this feature is required.
643 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
644 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
648 /// Checks if this feature is required.
651 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
652 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
656 /// Set this feature as optional.
658 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
659 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_optional()
662 /// Set this feature as required.
664 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
665 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_required()
668 /// Checks if this feature is supported.
671 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
672 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
676 /// Set this feature as optional.
678 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
679 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_optional()
682 /// Set this feature as required.
684 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
685 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_required()
688 /// Checks if this feature is supported.
691 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
692 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
696 /// Checks if this feature is required.
699 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
700 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
704 /// Checks if this feature is required.
707 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
708 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
712 /// Set this feature as optional.
714 pub extern "C" fn InitFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
715 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_optional()
718 /// Set this feature as required.
720 pub extern "C" fn InitFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
721 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_required()
724 /// Checks if this feature is supported.
727 pub extern "C" fn InitFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
728 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
732 /// Set this feature as optional.
734 pub extern "C" fn NodeFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
735 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_optional()
738 /// Set this feature as required.
740 pub extern "C" fn NodeFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
741 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_required()
744 /// Checks if this feature is supported.
747 pub extern "C" fn NodeFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
748 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
752 /// Checks if this feature is required.
755 pub extern "C" fn InitFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
756 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
760 /// Checks if this feature is required.
763 pub extern "C" fn NodeFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
764 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
768 /// Set this feature as optional.
770 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
771 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
774 /// Set this feature as required.
776 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
777 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
780 /// Checks if this feature is supported.
783 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
784 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
788 /// Set this feature as optional.
790 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
791 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
794 /// Set this feature as required.
796 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
797 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
800 /// Checks if this feature is supported.
803 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
804 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
808 /// Checks if this feature is required.
811 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
812 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
816 /// Checks if this feature is required.
819 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
820 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
824 /// Set this feature as optional.
826 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
827 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
830 /// Set this feature as required.
832 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
833 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
836 /// Checks if this feature is supported.
839 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
840 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
844 /// Set this feature as optional.
846 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
847 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
850 /// Set this feature as required.
852 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
853 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
856 /// Checks if this feature is supported.
859 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
860 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
864 /// Set this feature as optional.
866 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
867 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
870 /// Set this feature as required.
872 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
873 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
876 /// Checks if this feature is supported.
879 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
880 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
884 /// Checks if this feature is required.
887 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
888 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
892 /// Checks if this feature is required.
895 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
896 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
900 /// Checks if this feature is required.
903 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
904 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
908 /// Set this feature as optional.
910 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
911 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
914 /// Set this feature as required.
916 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
917 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
920 /// Checks if this feature is supported.
923 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
924 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
928 /// Set this feature as optional.
930 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
931 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
934 /// Set this feature as required.
936 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
937 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
940 /// Checks if this feature is supported.
943 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
944 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
948 /// Set this feature as optional.
950 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
951 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
954 /// Set this feature as required.
956 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
957 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
960 /// Checks if this feature is supported.
963 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
964 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
968 /// Checks if this feature is required.
971 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
972 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
976 /// Checks if this feature is required.
979 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
980 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
984 /// Checks if this feature is required.
987 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
988 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
992 /// Set this feature as optional.
994 pub extern "C" fn NodeFeatures_set_keysend_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
995 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_optional()
998 /// Set this feature as required.
1000 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1001 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
1004 /// Checks if this feature is supported.
1007 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1008 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
1012 /// Checks if this feature is required.
1015 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1016 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
1021 /// Checks if two InitFeaturess contain equal inner contents.
1022 /// This ignores pointers and is_owned flags and looks at the values in fields.
1023 /// Two objects with NULL inner values will be considered "equal" here.
1025 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
1026 if a.inner == b.inner { return true; }
1027 if a.inner.is_null() || b.inner.is_null() { return false; }
1028 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1030 /// Checks if two NodeFeaturess contain equal inner contents.
1031 /// This ignores pointers and is_owned flags and looks at the values in fields.
1032 /// Two objects with NULL inner values will be considered "equal" here.
1034 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
1035 if a.inner == b.inner { return true; }
1036 if a.inner.is_null() || b.inner.is_null() { return false; }
1037 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1039 /// Checks if two ChannelFeaturess contain equal inner contents.
1040 /// This ignores pointers and is_owned flags and looks at the values in fields.
1041 /// Two objects with NULL inner values will be considered "equal" here.
1043 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
1044 if a.inner == b.inner { return true; }
1045 if a.inner.is_null() || b.inner.is_null() { return false; }
1046 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1048 /// Checks if two InvoiceFeaturess contain equal inner contents.
1049 /// This ignores pointers and is_owned flags and looks at the values in fields.
1050 /// Two objects with NULL inner values will be considered "equal" here.
1052 pub extern "C" fn InvoiceFeatures_eq(a: &InvoiceFeatures, b: &InvoiceFeatures) -> bool {
1053 if a.inner == b.inner { return true; }
1054 if a.inner.is_null() || b.inner.is_null() { return false; }
1055 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1057 /// Checks if two OfferFeaturess contain equal inner contents.
1058 /// This ignores pointers and is_owned flags and looks at the values in fields.
1059 /// Two objects with NULL inner values will be considered "equal" here.
1061 pub extern "C" fn OfferFeatures_eq(a: &OfferFeatures, b: &OfferFeatures) -> bool {
1062 if a.inner == b.inner { return true; }
1063 if a.inner.is_null() || b.inner.is_null() { return false; }
1064 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1066 /// Checks if two InvoiceRequestFeaturess contain equal inner contents.
1067 /// This ignores pointers and is_owned flags and looks at the values in fields.
1068 /// Two objects with NULL inner values will be considered "equal" here.
1070 pub extern "C" fn InvoiceRequestFeatures_eq(a: &InvoiceRequestFeatures, b: &InvoiceRequestFeatures) -> bool {
1071 if a.inner == b.inner { return true; }
1072 if a.inner.is_null() || b.inner.is_null() { return false; }
1073 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1075 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
1076 /// This ignores pointers and is_owned flags and looks at the values in fields.
1077 /// Two objects with NULL inner values will be considered "equal" here.
1079 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
1080 if a.inner == b.inner { return true; }
1081 if a.inner.is_null() || b.inner.is_null() { return false; }
1082 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1084 impl Clone for InitFeatures {
1085 fn clone(&self) -> Self {
1087 inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1088 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1094 /// Used only if an object of this type is returned as a trait impl by a method
1095 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1096 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
1099 /// Creates a copy of the InitFeatures
1100 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1103 impl Clone for NodeFeatures {
1104 fn clone(&self) -> Self {
1106 inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1107 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1113 /// Used only if an object of this type is returned as a trait impl by a method
1114 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1115 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
1118 /// Creates a copy of the NodeFeatures
1119 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1122 impl Clone for ChannelFeatures {
1123 fn clone(&self) -> Self {
1125 inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1126 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1132 /// Used only if an object of this type is returned as a trait impl by a method
1133 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1134 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
1137 /// Creates a copy of the ChannelFeatures
1138 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1141 impl Clone for InvoiceFeatures {
1142 fn clone(&self) -> Self {
1144 inner: if <*mut nativeInvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1145 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1151 /// Used only if an object of this type is returned as a trait impl by a method
1152 pub(crate) extern "C" fn InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1153 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceFeatures)).clone() })) as *mut c_void
1156 /// Creates a copy of the InvoiceFeatures
1157 pub extern "C" fn InvoiceFeatures_clone(orig: &InvoiceFeatures) -> InvoiceFeatures {
1160 impl Clone for OfferFeatures {
1161 fn clone(&self) -> Self {
1163 inner: if <*mut nativeOfferFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1164 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1170 /// Used only if an object of this type is returned as a trait impl by a method
1171 pub(crate) extern "C" fn OfferFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1172 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOfferFeatures)).clone() })) as *mut c_void
1175 /// Creates a copy of the OfferFeatures
1176 pub extern "C" fn OfferFeatures_clone(orig: &OfferFeatures) -> OfferFeatures {
1179 impl Clone for InvoiceRequestFeatures {
1180 fn clone(&self) -> Self {
1182 inner: if <*mut nativeInvoiceRequestFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1183 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1189 /// Used only if an object of this type is returned as a trait impl by a method
1190 pub(crate) extern "C" fn InvoiceRequestFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1191 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
1194 /// Creates a copy of the InvoiceRequestFeatures
1195 pub extern "C" fn InvoiceRequestFeatures_clone(orig: &InvoiceRequestFeatures) -> InvoiceRequestFeatures {
1198 impl Clone for ChannelTypeFeatures {
1199 fn clone(&self) -> Self {
1201 inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1202 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1208 /// Used only if an object of this type is returned as a trait impl by a method
1209 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1210 Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
1213 /// Creates a copy of the ChannelTypeFeatures
1214 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1218 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1219 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1221 /// Features used within an `init` message.
1224 pub struct InitFeatures {
1225 /// A pointer to the opaque Rust object.
1227 /// Nearly everywhere, inner must be non-null, however in places where
1228 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1229 pub inner: *mut nativeInitFeatures,
1230 /// Indicates that this is the only struct which contains the same pointer.
1232 /// Rust functions which take ownership of an object provided via an argument require
1233 /// this to be true and invalidate the object pointed to by inner.
1237 impl Drop for InitFeatures {
1238 fn drop(&mut self) {
1239 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1240 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1244 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1246 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1248 /// Used only if an object of this type is returned as a trait impl by a method
1249 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1250 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInitFeatures) };
1254 pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1255 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1257 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1258 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1260 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1261 pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1262 assert!(self.is_owned);
1263 let ret = ObjOps::untweak_ptr(self.inner);
1264 self.inner = core::ptr::null_mut();
1269 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1270 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1272 /// Features used within a `node_announcement` message.
1275 pub struct NodeFeatures {
1276 /// A pointer to the opaque Rust object.
1278 /// Nearly everywhere, inner must be non-null, however in places where
1279 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1280 pub inner: *mut nativeNodeFeatures,
1281 /// Indicates that this is the only struct which contains the same pointer.
1283 /// Rust functions which take ownership of an object provided via an argument require
1284 /// this to be true and invalidate the object pointed to by inner.
1288 impl Drop for NodeFeatures {
1289 fn drop(&mut self) {
1290 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1291 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1295 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1297 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1299 /// Used only if an object of this type is returned as a trait impl by a method
1300 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1301 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeNodeFeatures) };
1305 pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1306 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1308 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1309 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1311 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1312 pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1313 assert!(self.is_owned);
1314 let ret = ObjOps::untweak_ptr(self.inner);
1315 self.inner = core::ptr::null_mut();
1320 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1321 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1323 /// Features used within a `channel_announcement` message.
1326 pub struct ChannelFeatures {
1327 /// A pointer to the opaque Rust object.
1329 /// Nearly everywhere, inner must be non-null, however in places where
1330 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1331 pub inner: *mut nativeChannelFeatures,
1332 /// Indicates that this is the only struct which contains the same pointer.
1334 /// Rust functions which take ownership of an object provided via an argument require
1335 /// this to be true and invalidate the object pointed to by inner.
1339 impl Drop for ChannelFeatures {
1340 fn drop(&mut self) {
1341 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1342 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1346 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1348 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1350 /// Used only if an object of this type is returned as a trait impl by a method
1351 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1352 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelFeatures) };
1355 impl ChannelFeatures {
1356 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1357 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1359 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1360 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1362 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1363 pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1364 assert!(self.is_owned);
1365 let ret = ObjOps::untweak_ptr(self.inner);
1366 self.inner = core::ptr::null_mut();
1371 use lightning::ln::features::InvoiceFeatures as nativeInvoiceFeaturesImport;
1372 pub(crate) type nativeInvoiceFeatures = nativeInvoiceFeaturesImport;
1374 /// Features used within an invoice.
1377 pub struct InvoiceFeatures {
1378 /// A pointer to the opaque Rust object.
1380 /// Nearly everywhere, inner must be non-null, however in places where
1381 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1382 pub inner: *mut nativeInvoiceFeatures,
1383 /// Indicates that this is the only struct which contains the same pointer.
1385 /// Rust functions which take ownership of an object provided via an argument require
1386 /// this to be true and invalidate the object pointed to by inner.
1390 impl Drop for InvoiceFeatures {
1391 fn drop(&mut self) {
1392 if self.is_owned && !<*mut nativeInvoiceFeatures>::is_null(self.inner) {
1393 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1397 /// Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
1399 pub extern "C" fn InvoiceFeatures_free(this_obj: InvoiceFeatures) { }
1401 /// Used only if an object of this type is returned as a trait impl by a method
1402 pub(crate) extern "C" fn InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1403 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceFeatures) };
1406 impl InvoiceFeatures {
1407 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceFeatures {
1408 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1410 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceFeatures {
1411 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1413 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1414 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceFeatures {
1415 assert!(self.is_owned);
1416 let ret = ObjOps::untweak_ptr(self.inner);
1417 self.inner = core::ptr::null_mut();
1422 use lightning::ln::features::OfferFeatures as nativeOfferFeaturesImport;
1423 pub(crate) type nativeOfferFeatures = nativeOfferFeaturesImport;
1425 /// Features used within an `offer`.
1428 pub struct OfferFeatures {
1429 /// A pointer to the opaque Rust object.
1431 /// Nearly everywhere, inner must be non-null, however in places where
1432 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1433 pub inner: *mut nativeOfferFeatures,
1434 /// Indicates that this is the only struct which contains the same pointer.
1436 /// Rust functions which take ownership of an object provided via an argument require
1437 /// this to be true and invalidate the object pointed to by inner.
1441 impl Drop for OfferFeatures {
1442 fn drop(&mut self) {
1443 if self.is_owned && !<*mut nativeOfferFeatures>::is_null(self.inner) {
1444 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1448 /// Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
1450 pub extern "C" fn OfferFeatures_free(this_obj: OfferFeatures) { }
1452 /// Used only if an object of this type is returned as a trait impl by a method
1453 pub(crate) extern "C" fn OfferFeatures_free_void(this_ptr: *mut c_void) {
1454 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferFeatures) };
1457 impl OfferFeatures {
1458 pub(crate) fn get_native_ref(&self) -> &'static nativeOfferFeatures {
1459 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1461 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferFeatures {
1462 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1464 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1465 pub(crate) fn take_inner(mut self) -> *mut nativeOfferFeatures {
1466 assert!(self.is_owned);
1467 let ret = ObjOps::untweak_ptr(self.inner);
1468 self.inner = core::ptr::null_mut();
1473 use lightning::ln::features::InvoiceRequestFeatures as nativeInvoiceRequestFeaturesImport;
1474 pub(crate) type nativeInvoiceRequestFeatures = nativeInvoiceRequestFeaturesImport;
1476 /// Features used within an `invoice_request`.
1479 pub struct InvoiceRequestFeatures {
1480 /// A pointer to the opaque Rust object.
1482 /// Nearly everywhere, inner must be non-null, however in places where
1483 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1484 pub inner: *mut nativeInvoiceRequestFeatures,
1485 /// Indicates that this is the only struct which contains the same pointer.
1487 /// Rust functions which take ownership of an object provided via an argument require
1488 /// this to be true and invalidate the object pointed to by inner.
1492 impl Drop for InvoiceRequestFeatures {
1493 fn drop(&mut self) {
1494 if self.is_owned && !<*mut nativeInvoiceRequestFeatures>::is_null(self.inner) {
1495 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1499 /// Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
1501 pub extern "C" fn InvoiceRequestFeatures_free(this_obj: InvoiceRequestFeatures) { }
1503 /// Used only if an object of this type is returned as a trait impl by a method
1504 pub(crate) extern "C" fn InvoiceRequestFeatures_free_void(this_ptr: *mut c_void) {
1505 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceRequestFeatures) };
1508 impl InvoiceRequestFeatures {
1509 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceRequestFeatures {
1510 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1512 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceRequestFeatures {
1513 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1515 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1516 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceRequestFeatures {
1517 assert!(self.is_owned);
1518 let ret = ObjOps::untweak_ptr(self.inner);
1519 self.inner = core::ptr::null_mut();
1524 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
1525 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
1527 /// Features used within the channel_type field in an OpenChannel message.
1529 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
1530 /// semantics of our interaction with our peer.
1532 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
1533 /// the counterparty, only required features are allowed here.
1535 /// This is serialized differently from other feature types - it is not prefixed by a length, and
1536 /// thus must only appear inside a TLV where its length is known in advance.
1539 pub struct ChannelTypeFeatures {
1540 /// A pointer to the opaque Rust object.
1542 /// Nearly everywhere, inner must be non-null, however in places where
1543 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1544 pub inner: *mut nativeChannelTypeFeatures,
1545 /// Indicates that this is the only struct which contains the same pointer.
1547 /// Rust functions which take ownership of an object provided via an argument require
1548 /// this to be true and invalidate the object pointed to by inner.
1552 impl Drop for ChannelTypeFeatures {
1553 fn drop(&mut self) {
1554 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
1555 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1559 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
1561 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
1563 /// Used only if an object of this type is returned as a trait impl by a method
1564 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
1565 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures) };
1568 impl ChannelTypeFeatures {
1569 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
1570 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1572 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
1573 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1575 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1576 pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
1577 assert!(self.is_owned);
1578 let ret = ObjOps::untweak_ptr(self.inner);
1579 self.inner = core::ptr::null_mut();
1583 /// Create a blank Features with no features set
1586 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
1587 let mut ret = lightning::ln::features::InitFeatures::empty();
1588 crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1591 /// Returns true if this `Features` object contains unknown feature flags which are set as
1595 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1596 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1600 /// Create a blank Features with no features set
1603 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
1604 let mut ret = lightning::ln::features::NodeFeatures::empty();
1605 crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1608 /// Returns true if this `Features` object contains unknown feature flags which are set as
1612 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1613 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1617 /// Create a blank Features with no features set
1620 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
1621 let mut ret = lightning::ln::features::ChannelFeatures::empty();
1622 crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1625 /// Returns true if this `Features` object contains unknown feature flags which are set as
1629 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
1630 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1634 /// Create a blank Features with no features set
1637 pub extern "C" fn InvoiceFeatures_empty() -> crate::lightning::ln::features::InvoiceFeatures {
1638 let mut ret = lightning::ln::features::InvoiceFeatures::empty();
1639 crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1642 /// Returns true if this `Features` object contains unknown feature flags which are set as
1646 pub extern "C" fn InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1647 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1651 /// Create a blank Features with no features set
1654 pub extern "C" fn OfferFeatures_empty() -> crate::lightning::ln::features::OfferFeatures {
1655 let mut ret = lightning::ln::features::OfferFeatures::empty();
1656 crate::lightning::ln::features::OfferFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1659 /// Returns true if this `Features` object contains unknown feature flags which are set as
1663 pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::OfferFeatures) -> bool {
1664 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1668 /// Create a blank Features with no features set
1671 pub extern "C" fn InvoiceRequestFeatures_empty() -> crate::lightning::ln::features::InvoiceRequestFeatures {
1672 let mut ret = lightning::ln::features::InvoiceRequestFeatures::empty();
1673 crate::lightning::ln::features::InvoiceRequestFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1676 /// Returns true if this `Features` object contains unknown feature flags which are set as
1680 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
1681 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1685 /// Create a blank Features with no features set
1688 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
1689 let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
1690 crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1693 /// Returns true if this `Features` object contains unknown feature flags which are set as
1697 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1698 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1703 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
1704 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
1705 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1708 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1709 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
1712 /// Read a InitFeatures from a byte array, created by InitFeatures_write
1713 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
1714 let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1715 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() };
1719 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
1720 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
1721 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1724 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1725 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
1728 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
1729 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
1730 let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1731 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() };
1735 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
1736 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
1737 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1740 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1741 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
1744 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
1745 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
1746 let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1747 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() };
1751 /// Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
1752 pub extern "C" fn InvoiceFeatures_write(obj: &crate::lightning::ln::features::InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
1753 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1756 pub(crate) extern "C" fn InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1757 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceFeatures) })
1760 /// Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
1761 pub extern "C" fn InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InvoiceFeaturesDecodeErrorZ {
1762 let res: Result<lightning::ln::features::InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1763 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() };
1767 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
1768 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
1769 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1772 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1773 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
1776 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
1777 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
1778 let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1779 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() };
1783 /// Serialize the OfferFeatures object into a byte array which can be read by OfferFeatures_read
1784 pub extern "C" fn OfferFeatures_write(obj: &crate::lightning::ln::features::OfferFeatures) -> crate::c_types::derived::CVec_u8Z {
1785 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1788 pub(crate) extern "C" fn OfferFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1789 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeOfferFeatures) })
1792 /// Read a OfferFeatures from a byte array, created by OfferFeatures_write
1793 pub extern "C" fn OfferFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_OfferFeaturesDecodeErrorZ {
1794 let res: Result<lightning::ln::features::OfferFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1795 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::OfferFeatures { 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() };
1799 /// Serialize the InvoiceRequestFeatures object into a byte array which can be read by InvoiceRequestFeatures_read
1800 pub extern "C" fn InvoiceRequestFeatures_write(obj: &crate::lightning::ln::features::InvoiceRequestFeatures) -> crate::c_types::derived::CVec_u8Z {
1801 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1804 pub(crate) extern "C" fn InvoiceRequestFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1805 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceRequestFeatures) })
1808 /// Read a InvoiceRequestFeatures from a byte array, created by InvoiceRequestFeatures_write
1809 pub extern "C" fn InvoiceRequestFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InvoiceRequestFeaturesDecodeErrorZ {
1810 let res: Result<lightning::ln::features::InvoiceRequestFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1811 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::InvoiceRequestFeatures { 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() };