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 //! - `AnchorsZeroFeeHtlcTx` - requires/supports that commitment transactions include anchor outputs
44 //! and HTLC transactions are pre-signed with zero fee (see
45 //! [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more
47 //! - `RouteBlinding` - requires/supports that a node can relay payments over blinded paths
48 //! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#route-blinding) for more information).
49 //! - `ShutdownAnySegwit` - requires/supports that future segwit versions are allowed in `shutdown`
50 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
51 //! - `OnionMessages` - requires/supports forwarding onion messages
52 //! (see [BOLT-7](https://github.com/lightning/bolts/pull/759/files) for more information).
53 //! - `ChannelType` - node supports the channel_type field in open/accept
54 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
55 //! - `SCIDPrivacy` - supply channel aliases for routing
56 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
57 //! - `PaymentMetadata` - include additional data in invoices which is passed to recipients in the
59 //! (see [BOLT-11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) for
61 //! - `ZeroConf` - supports accepting HTLCs and using channels prior to funding confirmation
63 //! [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message)
65 //! - `Keysend` - send funds to a node without an invoice
66 //! (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
68 //! LDK knows about the following features, but does not support them:
69 //! - `AnchorsNonzeroFeeHtlcTx` - the initial version of anchor outputs, which was later found to be
70 //! vulnerable (see this
71 //! [mailing list post](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html)
72 //! for more information).
74 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
75 //! [messages]: crate::ln::msgs
77 use alloc::str::FromStr;
78 use alloc::string::String;
79 use core::ffi::c_void;
80 use core::convert::Infallible;
81 use bitcoin::hashes::Hash;
82 use crate::c_types::*;
83 #[cfg(feature="no-std")]
84 use alloc::{vec::Vec, boxed::Box};
88 use alloc::str::FromStr;
89 use alloc::string::String;
90 use core::ffi::c_void;
91 use core::convert::Infallible;
92 use bitcoin::hashes::Hash;
93 use crate::c_types::*;
94 #[cfg(feature="no-std")]
95 use alloc::{vec::Vec, boxed::Box};
97 /// Set this feature as optional.
99 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
100 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_optional()
103 /// Set this feature as required.
105 pub extern "C" fn InitFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
106 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_required()
109 /// Checks if this feature is supported.
112 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
113 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
117 /// Set this feature as optional.
119 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
120 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_optional()
123 /// Set this feature as required.
125 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
126 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_required()
129 /// Checks if this feature is supported.
132 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
133 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
137 /// Checks if this feature is required.
140 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
141 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
145 /// Checks if this feature is required.
148 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
149 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
153 /// Set this feature as optional.
155 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
156 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_optional()
159 /// Set this feature as required.
161 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
162 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_required()
165 /// Checks if this feature is supported.
168 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
169 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
173 /// Set this feature as optional.
175 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
176 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_optional()
179 /// Set this feature as required.
181 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
182 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_required()
185 /// Checks if this feature is supported.
188 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
189 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
193 /// Set this feature as optional.
195 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
196 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_optional()
199 /// Set this feature as required.
201 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
202 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_required()
205 /// Checks if this feature is supported.
208 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
209 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
213 /// Checks if this feature is required.
216 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
217 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
221 /// Checks if this feature is required.
224 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
225 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
229 /// Set this feature as optional.
231 pub extern "C" fn InitFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
232 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_optional()
235 /// Set this feature as required.
237 pub extern "C" fn InitFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
238 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_required()
241 /// Checks if this feature is supported.
244 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
245 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
249 /// Set this feature as optional.
251 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
252 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_optional()
255 /// Set this feature as required.
257 pub extern "C" fn NodeFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
258 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_required()
261 /// Checks if this feature is supported.
264 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
265 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
269 /// Checks if this feature is required.
272 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
273 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
277 /// Checks if this feature is required.
280 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
281 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
285 /// Set this feature as optional.
287 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
288 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_optional()
291 /// Set this feature as required.
293 pub extern "C" fn InitFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
294 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_required()
297 /// Checks if this feature is supported.
300 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
301 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
305 /// Set this feature as optional.
307 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
308 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_optional()
311 /// Set this feature as required.
313 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
314 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_required()
317 /// Checks if this feature is supported.
320 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
321 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
325 /// Set this feature as optional.
327 pub extern "C" fn Bolt11InvoiceFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
328 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_variable_length_onion_optional()
331 /// Set this feature as required.
333 pub extern "C" fn Bolt11InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
334 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_variable_length_onion_required()
337 /// Checks if this feature is supported.
340 pub extern "C" fn Bolt11InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
341 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
345 /// Checks if this feature is required.
348 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
349 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
353 /// Checks if this feature is required.
356 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
357 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
361 /// Checks if this feature is required.
364 pub extern "C" fn Bolt11InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
365 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
369 /// Set this feature as optional.
371 pub extern "C" fn InitFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
372 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_optional()
375 /// Set this feature as required.
377 pub extern "C" fn InitFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
378 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_required()
381 /// Checks if this feature is supported.
384 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
385 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
389 /// Set this feature as optional.
391 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
392 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_optional()
395 /// Set this feature as required.
397 pub extern "C" fn NodeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
398 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_required()
401 /// Checks if this feature is supported.
404 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
405 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
409 /// Set this feature as optional.
411 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
412 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_optional()
415 /// Set this feature as required.
417 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
418 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_required()
421 /// Checks if this feature is supported.
424 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
425 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
429 /// Checks if this feature is required.
432 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
433 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
437 /// Checks if this feature is required.
440 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
441 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
445 /// Checks if this feature is required.
448 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
449 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
453 /// Set this feature as optional.
455 pub extern "C" fn InitFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
456 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_optional()
459 /// Set this feature as required.
461 pub extern "C" fn InitFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
462 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_required()
465 /// Checks if this feature is supported.
468 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
469 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
473 /// Set this feature as optional.
475 pub extern "C" fn NodeFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
476 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_optional()
479 /// Set this feature as required.
481 pub extern "C" fn NodeFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
482 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_required()
485 /// Checks if this feature is supported.
488 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
489 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
493 /// Set this feature as optional.
495 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
496 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_secret_optional()
499 /// Set this feature as required.
501 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
502 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_secret_required()
505 /// Checks if this feature is supported.
508 pub extern "C" fn Bolt11InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
509 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
513 /// Checks if this feature is required.
516 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
517 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
521 /// Checks if this feature is required.
524 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
525 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
529 /// Checks if this feature is required.
532 pub extern "C" fn Bolt11InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
533 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
537 /// Set this feature as optional.
539 pub extern "C" fn InitFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
540 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_optional()
543 /// Set this feature as required.
545 pub extern "C" fn InitFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
546 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_required()
549 /// Checks if this feature is supported.
552 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
553 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
557 /// Set this feature as optional.
559 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
560 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_optional()
563 /// Set this feature as required.
565 pub extern "C" fn NodeFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
566 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_required()
569 /// Checks if this feature is supported.
572 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
573 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
577 /// Set this feature as optional.
579 pub extern "C" fn Bolt11InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
580 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_basic_mpp_optional()
583 /// Set this feature as required.
585 pub extern "C" fn Bolt11InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
586 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_basic_mpp_required()
589 /// Checks if this feature is supported.
592 pub extern "C" fn Bolt11InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
593 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
597 /// Set this feature as optional.
599 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
600 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_optional()
603 /// Set this feature as required.
605 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
606 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_required()
609 /// Checks if this feature is supported.
612 pub extern "C" fn Bolt12InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
613 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
617 /// Checks if this feature is required.
620 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
621 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
625 /// Checks if this feature is required.
628 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
629 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
633 /// Checks if this feature is required.
636 pub extern "C" fn Bolt11InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
637 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
641 /// Checks if this feature is required.
644 pub extern "C" fn Bolt12InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
645 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
649 /// Set this feature as optional.
651 pub extern "C" fn InitFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
652 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_optional()
655 /// Set this feature as required.
657 pub extern "C" fn InitFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
658 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_required()
661 /// Checks if this feature is supported.
664 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
665 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
669 /// Set this feature as optional.
671 pub extern "C" fn NodeFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
672 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_optional()
675 /// Set this feature as required.
677 pub extern "C" fn NodeFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
678 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_required()
681 /// Checks if this feature is supported.
684 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
685 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
689 /// Checks if this feature is required.
692 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
693 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
697 /// Checks if this feature is required.
700 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
701 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
705 /// Set this feature as optional.
707 pub extern "C" fn InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
708 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
711 /// Set this feature as required.
713 pub extern "C" fn InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
714 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
717 /// Checks if this feature is supported.
720 pub extern "C" fn InitFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
721 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
725 /// Set this feature as optional.
727 pub extern "C" fn NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
728 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
731 /// Set this feature as required.
733 pub extern "C" fn NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
734 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
737 /// Checks if this feature is supported.
740 pub extern "C" fn NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
741 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
745 /// Set this feature as optional.
747 pub extern "C" fn ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
748 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
751 /// Set this feature as required.
753 pub extern "C" fn ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
754 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
757 /// Checks if this feature is supported.
760 pub extern "C" fn ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
761 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
765 /// Checks if this feature is required.
768 pub extern "C" fn InitFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
769 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
773 /// Checks if this feature is required.
776 pub extern "C" fn NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
777 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
781 /// Checks if this feature is required.
784 pub extern "C" fn ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
785 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
789 /// Set this feature as optional.
791 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
792 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
795 /// Set this feature as required.
797 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
798 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
801 /// Checks if this feature is supported.
804 pub extern "C" fn InitFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
805 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
809 /// Set this feature as optional.
811 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
812 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
815 /// Set this feature as required.
817 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
818 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
821 /// Checks if this feature is supported.
824 pub extern "C" fn NodeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
825 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
829 /// Set this feature as optional.
831 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
832 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
835 /// Set this feature as required.
837 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
838 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
841 /// Checks if this feature is supported.
844 pub extern "C" fn ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
845 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
849 /// Checks if this feature is required.
852 pub extern "C" fn InitFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
853 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
857 /// Checks if this feature is required.
860 pub extern "C" fn NodeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
861 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
865 /// Checks if this feature is required.
868 pub extern "C" fn ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
869 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
873 /// Set this feature as optional.
875 pub extern "C" fn InitFeatures_set_route_blinding_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
876 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_route_blinding_optional()
879 /// Set this feature as required.
881 pub extern "C" fn InitFeatures_set_route_blinding_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
882 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_route_blinding_required()
885 /// Checks if this feature is supported.
888 pub extern "C" fn InitFeatures_supports_route_blinding(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
889 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_route_blinding();
893 /// Set this feature as optional.
895 pub extern "C" fn NodeFeatures_set_route_blinding_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
896 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_route_blinding_optional()
899 /// Set this feature as required.
901 pub extern "C" fn NodeFeatures_set_route_blinding_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
902 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_route_blinding_required()
905 /// Checks if this feature is supported.
908 pub extern "C" fn NodeFeatures_supports_route_blinding(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
909 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_route_blinding();
913 /// Checks if this feature is required.
916 pub extern "C" fn InitFeatures_requires_route_blinding(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
917 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_route_blinding();
921 /// Checks if this feature is required.
924 pub extern "C" fn NodeFeatures_requires_route_blinding(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
925 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_route_blinding();
929 /// Set this feature as optional.
931 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
932 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_optional()
935 /// Set this feature as required.
937 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
938 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_required()
941 /// Checks if this feature is supported.
944 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
945 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
949 /// Set this feature as optional.
951 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
952 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_optional()
955 /// Set this feature as required.
957 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
958 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_required()
961 /// Checks if this feature is supported.
964 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
965 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
969 /// Checks if this feature is required.
972 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
973 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
977 /// Checks if this feature is required.
980 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
981 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
985 /// Set this feature as optional.
987 pub extern "C" fn InitFeatures_set_taproot_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
988 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_taproot_optional()
991 /// Set this feature as required.
993 pub extern "C" fn InitFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
994 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_taproot_required()
997 /// Checks if this feature is supported.
1000 pub extern "C" fn InitFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1001 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
1005 /// Set this feature as optional.
1007 pub extern "C" fn NodeFeatures_set_taproot_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1008 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_taproot_optional()
1011 /// Set this feature as required.
1013 pub extern "C" fn NodeFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1014 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_taproot_required()
1017 /// Checks if this feature is supported.
1020 pub extern "C" fn NodeFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1021 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
1025 /// Set this feature as optional.
1027 pub extern "C" fn ChannelTypeFeatures_set_taproot_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1028 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_taproot_optional()
1031 /// Set this feature as required.
1033 pub extern "C" fn ChannelTypeFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1034 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_taproot_required()
1037 /// Checks if this feature is supported.
1040 pub extern "C" fn ChannelTypeFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1041 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
1045 /// Checks if this feature is required.
1048 pub extern "C" fn InitFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1049 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
1053 /// Checks if this feature is required.
1056 pub extern "C" fn NodeFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1057 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
1061 /// Checks if this feature is required.
1064 pub extern "C" fn ChannelTypeFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1065 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
1069 /// Set this feature as optional.
1071 pub extern "C" fn InitFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1072 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_optional()
1075 /// Set this feature as required.
1077 pub extern "C" fn InitFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1078 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_required()
1081 /// Checks if this feature is supported.
1084 pub extern "C" fn InitFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1085 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
1089 /// Set this feature as optional.
1091 pub extern "C" fn NodeFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1092 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_optional()
1095 /// Set this feature as required.
1097 pub extern "C" fn NodeFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1098 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_required()
1101 /// Checks if this feature is supported.
1104 pub extern "C" fn NodeFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1105 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
1109 /// Checks if this feature is required.
1112 pub extern "C" fn InitFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1113 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
1117 /// Checks if this feature is required.
1120 pub extern "C" fn NodeFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1121 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
1125 /// Set this feature as optional.
1127 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1128 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
1131 /// Set this feature as required.
1133 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1134 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
1137 /// Checks if this feature is supported.
1140 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1141 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
1145 /// Set this feature as optional.
1147 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1148 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
1151 /// Set this feature as required.
1153 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1154 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
1157 /// Checks if this feature is supported.
1160 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1161 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
1165 /// Checks if this feature is required.
1168 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1169 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
1173 /// Checks if this feature is required.
1176 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1177 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
1181 /// Set this feature as optional.
1183 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1184 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
1187 /// Set this feature as required.
1189 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1190 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
1193 /// Checks if this feature is supported.
1196 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1197 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1201 /// Set this feature as optional.
1203 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1204 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
1207 /// Set this feature as required.
1209 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1210 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
1213 /// Checks if this feature is supported.
1216 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1217 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1221 /// Set this feature as optional.
1223 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1224 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
1227 /// Set this feature as required.
1229 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1230 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
1233 /// Checks if this feature is supported.
1236 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1237 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1241 /// Checks if this feature is required.
1244 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1245 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1249 /// Checks if this feature is required.
1252 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1253 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1257 /// Checks if this feature is required.
1260 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1261 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1265 /// Set this feature as optional.
1267 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_metadata_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1268 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_metadata_optional()
1271 /// Set this feature as required.
1273 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_metadata_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1274 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_metadata_required()
1277 /// Checks if this feature is supported.
1280 pub extern "C" fn Bolt11InvoiceFeatures_supports_payment_metadata(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1281 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_metadata();
1285 /// Checks if this feature is required.
1288 pub extern "C" fn Bolt11InvoiceFeatures_requires_payment_metadata(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1289 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_metadata();
1293 /// Set this feature as optional.
1295 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1296 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
1299 /// Set this feature as required.
1301 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1302 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
1305 /// Checks if this feature is supported.
1308 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1309 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1313 /// Set this feature as optional.
1315 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1316 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
1319 /// Set this feature as required.
1321 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1322 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
1325 /// Checks if this feature is supported.
1328 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1329 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1333 /// Set this feature as optional.
1335 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1336 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
1339 /// Set this feature as required.
1341 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1342 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
1345 /// Checks if this feature is supported.
1348 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1349 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1353 /// Checks if this feature is required.
1356 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1357 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1361 /// Checks if this feature is required.
1364 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1365 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1369 /// Checks if this feature is required.
1372 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1373 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1377 /// Set this feature as optional.
1379 pub extern "C" fn NodeFeatures_set_keysend_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1380 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_optional()
1383 /// Set this feature as required.
1385 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1386 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
1389 /// Checks if this feature is supported.
1392 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1393 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
1397 /// Checks if this feature is required.
1400 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1401 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
1406 /// Checks if two InitFeaturess contain equal inner contents.
1407 /// This ignores pointers and is_owned flags and looks at the values in fields.
1408 /// Two objects with NULL inner values will be considered "equal" here.
1410 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
1411 if a.inner == b.inner { return true; }
1412 if a.inner.is_null() || b.inner.is_null() { return false; }
1413 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1415 /// Checks if two NodeFeaturess contain equal inner contents.
1416 /// This ignores pointers and is_owned flags and looks at the values in fields.
1417 /// Two objects with NULL inner values will be considered "equal" here.
1419 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
1420 if a.inner == b.inner { return true; }
1421 if a.inner.is_null() || b.inner.is_null() { return false; }
1422 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1424 /// Checks if two ChannelFeaturess contain equal inner contents.
1425 /// This ignores pointers and is_owned flags and looks at the values in fields.
1426 /// Two objects with NULL inner values will be considered "equal" here.
1428 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
1429 if a.inner == b.inner { return true; }
1430 if a.inner.is_null() || b.inner.is_null() { return false; }
1431 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1433 /// Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
1434 /// This ignores pointers and is_owned flags and looks at the values in fields.
1435 /// Two objects with NULL inner values will be considered "equal" here.
1437 pub extern "C" fn Bolt11InvoiceFeatures_eq(a: &Bolt11InvoiceFeatures, b: &Bolt11InvoiceFeatures) -> bool {
1438 if a.inner == b.inner { return true; }
1439 if a.inner.is_null() || b.inner.is_null() { return false; }
1440 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1442 /// Checks if two OfferFeaturess contain equal inner contents.
1443 /// This ignores pointers and is_owned flags and looks at the values in fields.
1444 /// Two objects with NULL inner values will be considered "equal" here.
1446 pub extern "C" fn OfferFeatures_eq(a: &OfferFeatures, b: &OfferFeatures) -> bool {
1447 if a.inner == b.inner { return true; }
1448 if a.inner.is_null() || b.inner.is_null() { return false; }
1449 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1451 /// Checks if two InvoiceRequestFeaturess contain equal inner contents.
1452 /// This ignores pointers and is_owned flags and looks at the values in fields.
1453 /// Two objects with NULL inner values will be considered "equal" here.
1455 pub extern "C" fn InvoiceRequestFeatures_eq(a: &InvoiceRequestFeatures, b: &InvoiceRequestFeatures) -> bool {
1456 if a.inner == b.inner { return true; }
1457 if a.inner.is_null() || b.inner.is_null() { return false; }
1458 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1460 /// Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
1461 /// This ignores pointers and is_owned flags and looks at the values in fields.
1462 /// Two objects with NULL inner values will be considered "equal" here.
1464 pub extern "C" fn Bolt12InvoiceFeatures_eq(a: &Bolt12InvoiceFeatures, b: &Bolt12InvoiceFeatures) -> bool {
1465 if a.inner == b.inner { return true; }
1466 if a.inner.is_null() || b.inner.is_null() { return false; }
1467 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1469 /// Checks if two BlindedHopFeaturess contain equal inner contents.
1470 /// This ignores pointers and is_owned flags and looks at the values in fields.
1471 /// Two objects with NULL inner values will be considered "equal" here.
1473 pub extern "C" fn BlindedHopFeatures_eq(a: &BlindedHopFeatures, b: &BlindedHopFeatures) -> bool {
1474 if a.inner == b.inner { return true; }
1475 if a.inner.is_null() || b.inner.is_null() { return false; }
1476 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1478 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
1479 /// This ignores pointers and is_owned flags and looks at the values in fields.
1480 /// Two objects with NULL inner values will be considered "equal" here.
1482 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
1483 if a.inner == b.inner { return true; }
1484 if a.inner.is_null() || b.inner.is_null() { return false; }
1485 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1487 impl Clone for InitFeatures {
1488 fn clone(&self) -> Self {
1490 inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1491 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1497 /// Used only if an object of this type is returned as a trait impl by a method
1498 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1499 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeInitFeatures)).clone() })) as *mut c_void
1502 /// Creates a copy of the InitFeatures
1503 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1506 impl Clone for NodeFeatures {
1507 fn clone(&self) -> Self {
1509 inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1510 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1516 /// Used only if an object of this type is returned as a trait impl by a method
1517 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1518 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeNodeFeatures)).clone() })) as *mut c_void
1521 /// Creates a copy of the NodeFeatures
1522 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1525 impl Clone for ChannelFeatures {
1526 fn clone(&self) -> Self {
1528 inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1529 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1535 /// Used only if an object of this type is returned as a trait impl by a method
1536 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1537 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeChannelFeatures)).clone() })) as *mut c_void
1540 /// Creates a copy of the ChannelFeatures
1541 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1544 impl Clone for Bolt11InvoiceFeatures {
1545 fn clone(&self) -> Self {
1547 inner: if <*mut nativeBolt11InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1548 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1554 /// Used only if an object of this type is returned as a trait impl by a method
1555 pub(crate) extern "C" fn Bolt11InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1556 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt11InvoiceFeatures)).clone() })) as *mut c_void
1559 /// Creates a copy of the Bolt11InvoiceFeatures
1560 pub extern "C" fn Bolt11InvoiceFeatures_clone(orig: &Bolt11InvoiceFeatures) -> Bolt11InvoiceFeatures {
1563 impl Clone for OfferFeatures {
1564 fn clone(&self) -> Self {
1566 inner: if <*mut nativeOfferFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1567 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1573 /// Used only if an object of this type is returned as a trait impl by a method
1574 pub(crate) extern "C" fn OfferFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1575 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeOfferFeatures)).clone() })) as *mut c_void
1578 /// Creates a copy of the OfferFeatures
1579 pub extern "C" fn OfferFeatures_clone(orig: &OfferFeatures) -> OfferFeatures {
1582 impl Clone for InvoiceRequestFeatures {
1583 fn clone(&self) -> Self {
1585 inner: if <*mut nativeInvoiceRequestFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1586 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1592 /// Used only if an object of this type is returned as a trait impl by a method
1593 pub(crate) extern "C" fn InvoiceRequestFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1594 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
1597 /// Creates a copy of the InvoiceRequestFeatures
1598 pub extern "C" fn InvoiceRequestFeatures_clone(orig: &InvoiceRequestFeatures) -> InvoiceRequestFeatures {
1601 impl Clone for Bolt12InvoiceFeatures {
1602 fn clone(&self) -> Self {
1604 inner: if <*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1605 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1611 /// Used only if an object of this type is returned as a trait impl by a method
1612 pub(crate) extern "C" fn Bolt12InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1613 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt12InvoiceFeatures)).clone() })) as *mut c_void
1616 /// Creates a copy of the Bolt12InvoiceFeatures
1617 pub extern "C" fn Bolt12InvoiceFeatures_clone(orig: &Bolt12InvoiceFeatures) -> Bolt12InvoiceFeatures {
1620 impl Clone for BlindedHopFeatures {
1621 fn clone(&self) -> Self {
1623 inner: if <*mut nativeBlindedHopFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1624 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1630 /// Used only if an object of this type is returned as a trait impl by a method
1631 pub(crate) extern "C" fn BlindedHopFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1632 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBlindedHopFeatures)).clone() })) as *mut c_void
1635 /// Creates a copy of the BlindedHopFeatures
1636 pub extern "C" fn BlindedHopFeatures_clone(orig: &BlindedHopFeatures) -> BlindedHopFeatures {
1639 impl Clone for ChannelTypeFeatures {
1640 fn clone(&self) -> Self {
1642 inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1643 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1649 /// Used only if an object of this type is returned as a trait impl by a method
1650 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1651 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeChannelTypeFeatures)).clone() })) as *mut c_void
1654 /// Creates a copy of the ChannelTypeFeatures
1655 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1658 /// Generates a non-cryptographic 64-bit hash of the InitFeatures.
1660 pub extern "C" fn InitFeatures_hash(o: &InitFeatures) -> u64 {
1661 if o.inner.is_null() { return 0; }
1662 // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1663 #[allow(deprecated)]
1664 let mut hasher = core::hash::SipHasher::new();
1665 core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1666 core::hash::Hasher::finish(&hasher)
1668 /// Generates a non-cryptographic 64-bit hash of the NodeFeatures.
1670 pub extern "C" fn NodeFeatures_hash(o: &NodeFeatures) -> u64 {
1671 if o.inner.is_null() { return 0; }
1672 // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1673 #[allow(deprecated)]
1674 let mut hasher = core::hash::SipHasher::new();
1675 core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1676 core::hash::Hasher::finish(&hasher)
1678 /// Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
1680 pub extern "C" fn ChannelFeatures_hash(o: &ChannelFeatures) -> u64 {
1681 if o.inner.is_null() { return 0; }
1682 // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1683 #[allow(deprecated)]
1684 let mut hasher = core::hash::SipHasher::new();
1685 core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1686 core::hash::Hasher::finish(&hasher)
1688 /// Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
1690 pub extern "C" fn Bolt11InvoiceFeatures_hash(o: &Bolt11InvoiceFeatures) -> u64 {
1691 if o.inner.is_null() { return 0; }
1692 // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1693 #[allow(deprecated)]
1694 let mut hasher = core::hash::SipHasher::new();
1695 core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1696 core::hash::Hasher::finish(&hasher)
1698 /// Generates a non-cryptographic 64-bit hash of the OfferFeatures.
1700 pub extern "C" fn OfferFeatures_hash(o: &OfferFeatures) -> u64 {
1701 if o.inner.is_null() { return 0; }
1702 // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1703 #[allow(deprecated)]
1704 let mut hasher = core::hash::SipHasher::new();
1705 core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1706 core::hash::Hasher::finish(&hasher)
1708 /// Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
1710 pub extern "C" fn InvoiceRequestFeatures_hash(o: &InvoiceRequestFeatures) -> u64 {
1711 if o.inner.is_null() { return 0; }
1712 // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1713 #[allow(deprecated)]
1714 let mut hasher = core::hash::SipHasher::new();
1715 core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1716 core::hash::Hasher::finish(&hasher)
1718 /// Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
1720 pub extern "C" fn Bolt12InvoiceFeatures_hash(o: &Bolt12InvoiceFeatures) -> u64 {
1721 if o.inner.is_null() { return 0; }
1722 // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1723 #[allow(deprecated)]
1724 let mut hasher = core::hash::SipHasher::new();
1725 core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1726 core::hash::Hasher::finish(&hasher)
1728 /// Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
1730 pub extern "C" fn BlindedHopFeatures_hash(o: &BlindedHopFeatures) -> u64 {
1731 if o.inner.is_null() { return 0; }
1732 // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1733 #[allow(deprecated)]
1734 let mut hasher = core::hash::SipHasher::new();
1735 core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1736 core::hash::Hasher::finish(&hasher)
1738 /// Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
1740 pub extern "C" fn ChannelTypeFeatures_hash(o: &ChannelTypeFeatures) -> u64 {
1741 if o.inner.is_null() { return 0; }
1742 // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1743 #[allow(deprecated)]
1744 let mut hasher = core::hash::SipHasher::new();
1745 core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1746 core::hash::Hasher::finish(&hasher)
1748 /// Get a string which allows debug introspection of a InitFeatures object
1749 pub extern "C" fn InitFeatures_debug_str_void(o: *const c_void) -> Str {
1750 alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::InitFeatures }).into()}
1751 /// Get a string which allows debug introspection of a NodeFeatures object
1752 pub extern "C" fn NodeFeatures_debug_str_void(o: *const c_void) -> Str {
1753 alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::NodeFeatures }).into()}
1754 /// Get a string which allows debug introspection of a ChannelFeatures object
1755 pub extern "C" fn ChannelFeatures_debug_str_void(o: *const c_void) -> Str {
1756 alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::ChannelFeatures }).into()}
1757 /// Get a string which allows debug introspection of a Bolt11InvoiceFeatures object
1758 pub extern "C" fn Bolt11InvoiceFeatures_debug_str_void(o: *const c_void) -> Str {
1759 alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::Bolt11InvoiceFeatures }).into()}
1760 /// Get a string which allows debug introspection of a OfferFeatures object
1761 pub extern "C" fn OfferFeatures_debug_str_void(o: *const c_void) -> Str {
1762 alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::OfferFeatures }).into()}
1763 /// Get a string which allows debug introspection of a InvoiceRequestFeatures object
1764 pub extern "C" fn InvoiceRequestFeatures_debug_str_void(o: *const c_void) -> Str {
1765 alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::InvoiceRequestFeatures }).into()}
1766 /// Get a string which allows debug introspection of a Bolt12InvoiceFeatures object
1767 pub extern "C" fn Bolt12InvoiceFeatures_debug_str_void(o: *const c_void) -> Str {
1768 alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::Bolt12InvoiceFeatures }).into()}
1769 /// Get a string which allows debug introspection of a BlindedHopFeatures object
1770 pub extern "C" fn BlindedHopFeatures_debug_str_void(o: *const c_void) -> Str {
1771 alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::BlindedHopFeatures }).into()}
1772 /// Get a string which allows debug introspection of a ChannelTypeFeatures object
1773 pub extern "C" fn ChannelTypeFeatures_debug_str_void(o: *const c_void) -> Str {
1774 alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::ChannelTypeFeatures }).into()}
1776 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1777 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1779 /// Features used within an `init` message.
1782 pub struct InitFeatures {
1783 /// A pointer to the opaque Rust object.
1785 /// Nearly everywhere, inner must be non-null, however in places where
1786 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1787 pub inner: *mut nativeInitFeatures,
1788 /// Indicates that this is the only struct which contains the same pointer.
1790 /// Rust functions which take ownership of an object provided via an argument require
1791 /// this to be true and invalidate the object pointed to by inner.
1795 impl Drop for InitFeatures {
1796 fn drop(&mut self) {
1797 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1798 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1802 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1804 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1806 /// Used only if an object of this type is returned as a trait impl by a method
1807 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1808 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInitFeatures) };
1812 pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1813 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1815 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1816 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1818 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1819 pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1820 assert!(self.is_owned);
1821 let ret = ObjOps::untweak_ptr(self.inner);
1822 self.inner = core::ptr::null_mut();
1827 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1828 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1830 /// Features used within a `node_announcement` message.
1833 pub struct NodeFeatures {
1834 /// A pointer to the opaque Rust object.
1836 /// Nearly everywhere, inner must be non-null, however in places where
1837 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1838 pub inner: *mut nativeNodeFeatures,
1839 /// Indicates that this is the only struct which contains the same pointer.
1841 /// Rust functions which take ownership of an object provided via an argument require
1842 /// this to be true and invalidate the object pointed to by inner.
1846 impl Drop for NodeFeatures {
1847 fn drop(&mut self) {
1848 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1849 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1853 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1855 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1857 /// Used only if an object of this type is returned as a trait impl by a method
1858 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1859 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeNodeFeatures) };
1863 pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1864 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1866 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1867 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1869 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1870 pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1871 assert!(self.is_owned);
1872 let ret = ObjOps::untweak_ptr(self.inner);
1873 self.inner = core::ptr::null_mut();
1878 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1879 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1881 /// Features used within a `channel_announcement` message.
1884 pub struct ChannelFeatures {
1885 /// A pointer to the opaque Rust object.
1887 /// Nearly everywhere, inner must be non-null, however in places where
1888 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1889 pub inner: *mut nativeChannelFeatures,
1890 /// Indicates that this is the only struct which contains the same pointer.
1892 /// Rust functions which take ownership of an object provided via an argument require
1893 /// this to be true and invalidate the object pointed to by inner.
1897 impl Drop for ChannelFeatures {
1898 fn drop(&mut self) {
1899 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1900 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1904 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1906 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1908 /// Used only if an object of this type is returned as a trait impl by a method
1909 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1910 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelFeatures) };
1913 impl ChannelFeatures {
1914 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1915 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1917 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1918 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1920 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1921 pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1922 assert!(self.is_owned);
1923 let ret = ObjOps::untweak_ptr(self.inner);
1924 self.inner = core::ptr::null_mut();
1929 use lightning::ln::features::Bolt11InvoiceFeatures as nativeBolt11InvoiceFeaturesImport;
1930 pub(crate) type nativeBolt11InvoiceFeatures = nativeBolt11InvoiceFeaturesImport;
1932 /// Features used within an invoice.
1935 pub struct Bolt11InvoiceFeatures {
1936 /// A pointer to the opaque Rust object.
1938 /// Nearly everywhere, inner must be non-null, however in places where
1939 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1940 pub inner: *mut nativeBolt11InvoiceFeatures,
1941 /// Indicates that this is the only struct which contains the same pointer.
1943 /// Rust functions which take ownership of an object provided via an argument require
1944 /// this to be true and invalidate the object pointed to by inner.
1948 impl Drop for Bolt11InvoiceFeatures {
1949 fn drop(&mut self) {
1950 if self.is_owned && !<*mut nativeBolt11InvoiceFeatures>::is_null(self.inner) {
1951 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1955 /// Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
1957 pub extern "C" fn Bolt11InvoiceFeatures_free(this_obj: Bolt11InvoiceFeatures) { }
1959 /// Used only if an object of this type is returned as a trait impl by a method
1960 pub(crate) extern "C" fn Bolt11InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1961 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt11InvoiceFeatures) };
1964 impl Bolt11InvoiceFeatures {
1965 pub(crate) fn get_native_ref(&self) -> &'static nativeBolt11InvoiceFeatures {
1966 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1968 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt11InvoiceFeatures {
1969 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1971 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1972 pub(crate) fn take_inner(mut self) -> *mut nativeBolt11InvoiceFeatures {
1973 assert!(self.is_owned);
1974 let ret = ObjOps::untweak_ptr(self.inner);
1975 self.inner = core::ptr::null_mut();
1980 use lightning::ln::features::OfferFeatures as nativeOfferFeaturesImport;
1981 pub(crate) type nativeOfferFeatures = nativeOfferFeaturesImport;
1983 /// Features used within an `offer`.
1986 pub struct OfferFeatures {
1987 /// A pointer to the opaque Rust object.
1989 /// Nearly everywhere, inner must be non-null, however in places where
1990 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1991 pub inner: *mut nativeOfferFeatures,
1992 /// Indicates that this is the only struct which contains the same pointer.
1994 /// Rust functions which take ownership of an object provided via an argument require
1995 /// this to be true and invalidate the object pointed to by inner.
1999 impl Drop for OfferFeatures {
2000 fn drop(&mut self) {
2001 if self.is_owned && !<*mut nativeOfferFeatures>::is_null(self.inner) {
2002 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2006 /// Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
2008 pub extern "C" fn OfferFeatures_free(this_obj: OfferFeatures) { }
2010 /// Used only if an object of this type is returned as a trait impl by a method
2011 pub(crate) extern "C" fn OfferFeatures_free_void(this_ptr: *mut c_void) {
2012 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferFeatures) };
2015 impl OfferFeatures {
2016 pub(crate) fn get_native_ref(&self) -> &'static nativeOfferFeatures {
2017 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2019 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferFeatures {
2020 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2022 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2023 pub(crate) fn take_inner(mut self) -> *mut nativeOfferFeatures {
2024 assert!(self.is_owned);
2025 let ret = ObjOps::untweak_ptr(self.inner);
2026 self.inner = core::ptr::null_mut();
2031 use lightning::ln::features::InvoiceRequestFeatures as nativeInvoiceRequestFeaturesImport;
2032 pub(crate) type nativeInvoiceRequestFeatures = nativeInvoiceRequestFeaturesImport;
2034 /// Features used within an `invoice_request`.
2037 pub struct InvoiceRequestFeatures {
2038 /// A pointer to the opaque Rust object.
2040 /// Nearly everywhere, inner must be non-null, however in places where
2041 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2042 pub inner: *mut nativeInvoiceRequestFeatures,
2043 /// Indicates that this is the only struct which contains the same pointer.
2045 /// Rust functions which take ownership of an object provided via an argument require
2046 /// this to be true and invalidate the object pointed to by inner.
2050 impl Drop for InvoiceRequestFeatures {
2051 fn drop(&mut self) {
2052 if self.is_owned && !<*mut nativeInvoiceRequestFeatures>::is_null(self.inner) {
2053 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2057 /// Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
2059 pub extern "C" fn InvoiceRequestFeatures_free(this_obj: InvoiceRequestFeatures) { }
2061 /// Used only if an object of this type is returned as a trait impl by a method
2062 pub(crate) extern "C" fn InvoiceRequestFeatures_free_void(this_ptr: *mut c_void) {
2063 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceRequestFeatures) };
2066 impl InvoiceRequestFeatures {
2067 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceRequestFeatures {
2068 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2070 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceRequestFeatures {
2071 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2073 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2074 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceRequestFeatures {
2075 assert!(self.is_owned);
2076 let ret = ObjOps::untweak_ptr(self.inner);
2077 self.inner = core::ptr::null_mut();
2082 use lightning::ln::features::Bolt12InvoiceFeatures as nativeBolt12InvoiceFeaturesImport;
2083 pub(crate) type nativeBolt12InvoiceFeatures = nativeBolt12InvoiceFeaturesImport;
2085 /// Features used within an `invoice`.
2088 pub struct Bolt12InvoiceFeatures {
2089 /// A pointer to the opaque Rust object.
2091 /// Nearly everywhere, inner must be non-null, however in places where
2092 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2093 pub inner: *mut nativeBolt12InvoiceFeatures,
2094 /// Indicates that this is the only struct which contains the same pointer.
2096 /// Rust functions which take ownership of an object provided via an argument require
2097 /// this to be true and invalidate the object pointed to by inner.
2101 impl Drop for Bolt12InvoiceFeatures {
2102 fn drop(&mut self) {
2103 if self.is_owned && !<*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) {
2104 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2108 /// Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
2110 pub extern "C" fn Bolt12InvoiceFeatures_free(this_obj: Bolt12InvoiceFeatures) { }
2112 /// Used only if an object of this type is returned as a trait impl by a method
2113 pub(crate) extern "C" fn Bolt12InvoiceFeatures_free_void(this_ptr: *mut c_void) {
2114 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt12InvoiceFeatures) };
2117 impl Bolt12InvoiceFeatures {
2118 pub(crate) fn get_native_ref(&self) -> &'static nativeBolt12InvoiceFeatures {
2119 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2121 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt12InvoiceFeatures {
2122 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2124 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2125 pub(crate) fn take_inner(mut self) -> *mut nativeBolt12InvoiceFeatures {
2126 assert!(self.is_owned);
2127 let ret = ObjOps::untweak_ptr(self.inner);
2128 self.inner = core::ptr::null_mut();
2133 use lightning::ln::features::BlindedHopFeatures as nativeBlindedHopFeaturesImport;
2134 pub(crate) type nativeBlindedHopFeatures = nativeBlindedHopFeaturesImport;
2136 /// Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
2139 pub struct BlindedHopFeatures {
2140 /// A pointer to the opaque Rust object.
2142 /// Nearly everywhere, inner must be non-null, however in places where
2143 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2144 pub inner: *mut nativeBlindedHopFeatures,
2145 /// Indicates that this is the only struct which contains the same pointer.
2147 /// Rust functions which take ownership of an object provided via an argument require
2148 /// this to be true and invalidate the object pointed to by inner.
2152 impl Drop for BlindedHopFeatures {
2153 fn drop(&mut self) {
2154 if self.is_owned && !<*mut nativeBlindedHopFeatures>::is_null(self.inner) {
2155 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2159 /// Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
2161 pub extern "C" fn BlindedHopFeatures_free(this_obj: BlindedHopFeatures) { }
2163 /// Used only if an object of this type is returned as a trait impl by a method
2164 pub(crate) extern "C" fn BlindedHopFeatures_free_void(this_ptr: *mut c_void) {
2165 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBlindedHopFeatures) };
2168 impl BlindedHopFeatures {
2169 pub(crate) fn get_native_ref(&self) -> &'static nativeBlindedHopFeatures {
2170 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2172 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBlindedHopFeatures {
2173 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2175 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2176 pub(crate) fn take_inner(mut self) -> *mut nativeBlindedHopFeatures {
2177 assert!(self.is_owned);
2178 let ret = ObjOps::untweak_ptr(self.inner);
2179 self.inner = core::ptr::null_mut();
2184 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
2185 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
2187 /// Features used within the channel_type field in an OpenChannel message.
2189 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
2190 /// semantics of our interaction with our peer.
2192 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
2193 /// the counterparty, only required features are allowed here.
2195 /// This is serialized differently from other feature types - it is not prefixed by a length, and
2196 /// thus must only appear inside a TLV where its length is known in advance.
2199 pub struct ChannelTypeFeatures {
2200 /// A pointer to the opaque Rust object.
2202 /// Nearly everywhere, inner must be non-null, however in places where
2203 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2204 pub inner: *mut nativeChannelTypeFeatures,
2205 /// Indicates that this is the only struct which contains the same pointer.
2207 /// Rust functions which take ownership of an object provided via an argument require
2208 /// this to be true and invalidate the object pointed to by inner.
2212 impl Drop for ChannelTypeFeatures {
2213 fn drop(&mut self) {
2214 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
2215 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2219 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
2221 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
2223 /// Used only if an object of this type is returned as a trait impl by a method
2224 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
2225 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures) };
2228 impl ChannelTypeFeatures {
2229 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
2230 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2232 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
2233 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2235 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2236 pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
2237 assert!(self.is_owned);
2238 let ret = ObjOps::untweak_ptr(self.inner);
2239 self.inner = core::ptr::null_mut();
2243 /// Create a blank Features with no features set
2246 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
2247 let mut ret = lightning::ln::features::InitFeatures::empty();
2248 crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2251 /// Returns true if this `Features` object contains required features unknown by `other`.
2254 pub extern "C" fn InitFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InitFeatures, other: &crate::lightning::ln::features::InitFeatures) -> bool {
2255 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2259 /// Returns true if this `Features` object contains unknown feature flags which are set as
2263 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
2264 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2268 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2271 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2272 /// be set instead (i.e., `bit - 1`).
2274 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2277 pub extern "C" fn InitFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::InitFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2278 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_required_feature_bit(bit);
2279 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2283 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2286 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2287 /// set instead (i.e., `bit + 1`).
2289 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2292 pub extern "C" fn InitFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::InitFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2293 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_optional_feature_bit(bit);
2294 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2298 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2299 /// by [bLIP 2] or if it is a known `T` feature.
2301 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2302 /// be set instead (i.e., `bit - 1`).
2304 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2307 pub extern "C" fn InitFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::InitFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2308 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_required_custom_bit(bit);
2309 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2313 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2314 /// by [bLIP 2] or if it is a known `T` feature.
2316 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2317 /// set instead (i.e., `bit + 1`).
2319 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2322 pub extern "C" fn InitFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::InitFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2323 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_optional_custom_bit(bit);
2324 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2328 /// Create a blank Features with no features set
2331 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
2332 let mut ret = lightning::ln::features::NodeFeatures::empty();
2333 crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2336 /// Returns true if this `Features` object contains required features unknown by `other`.
2339 pub extern "C" fn NodeFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::NodeFeatures, other: &crate::lightning::ln::features::NodeFeatures) -> bool {
2340 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2344 /// Returns true if this `Features` object contains unknown feature flags which are set as
2348 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
2349 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2353 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2356 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2357 /// be set instead (i.e., `bit - 1`).
2359 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2362 pub extern "C" fn NodeFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::NodeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2363 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_required_feature_bit(bit);
2364 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2368 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2371 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2372 /// set instead (i.e., `bit + 1`).
2374 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2377 pub extern "C" fn NodeFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::NodeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2378 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_optional_feature_bit(bit);
2379 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2383 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2384 /// by [bLIP 2] or if it is a known `T` feature.
2386 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2387 /// be set instead (i.e., `bit - 1`).
2389 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2392 pub extern "C" fn NodeFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::NodeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2393 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_required_custom_bit(bit);
2394 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2398 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2399 /// by [bLIP 2] or if it is a known `T` feature.
2401 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2402 /// set instead (i.e., `bit + 1`).
2404 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2407 pub extern "C" fn NodeFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::NodeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2408 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_optional_custom_bit(bit);
2409 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2413 /// Create a blank Features with no features set
2416 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
2417 let mut ret = lightning::ln::features::ChannelFeatures::empty();
2418 crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2421 /// Returns true if this `Features` object contains required features unknown by `other`.
2424 pub extern "C" fn ChannelFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelFeatures, other: &crate::lightning::ln::features::ChannelFeatures) -> bool {
2425 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2429 /// Returns true if this `Features` object contains unknown feature flags which are set as
2433 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
2434 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2438 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2441 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2442 /// be set instead (i.e., `bit - 1`).
2444 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2447 pub extern "C" fn ChannelFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::ChannelFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2448 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_required_feature_bit(bit);
2449 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2453 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2456 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2457 /// set instead (i.e., `bit + 1`).
2459 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2462 pub extern "C" fn ChannelFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::ChannelFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2463 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_optional_feature_bit(bit);
2464 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2468 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2469 /// by [bLIP 2] or if it is a known `T` feature.
2471 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2472 /// be set instead (i.e., `bit - 1`).
2474 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2477 pub extern "C" fn ChannelFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2478 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_required_custom_bit(bit);
2479 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2483 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2484 /// by [bLIP 2] or if it is a known `T` feature.
2486 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2487 /// set instead (i.e., `bit + 1`).
2489 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2492 pub extern "C" fn ChannelFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2493 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_optional_custom_bit(bit);
2494 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2498 /// Create a blank Features with no features set
2501 pub extern "C" fn Bolt11InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt11InvoiceFeatures {
2502 let mut ret = lightning::ln::features::Bolt11InvoiceFeatures::empty();
2503 crate::lightning::ln::features::Bolt11InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2506 /// Returns true if this `Features` object contains required features unknown by `other`.
2509 pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures, other: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
2510 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2514 /// Returns true if this `Features` object contains unknown feature flags which are set as
2518 pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
2519 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2523 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2526 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2527 /// be set instead (i.e., `bit - 1`).
2529 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2532 pub extern "C" fn Bolt11InvoiceFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2533 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_required_feature_bit(bit);
2534 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2538 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2541 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2542 /// set instead (i.e., `bit + 1`).
2544 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2547 pub extern "C" fn Bolt11InvoiceFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2548 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_optional_feature_bit(bit);
2549 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2553 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2554 /// by [bLIP 2] or if it is a known `T` feature.
2556 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2557 /// be set instead (i.e., `bit - 1`).
2559 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2562 pub extern "C" fn Bolt11InvoiceFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2563 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_required_custom_bit(bit);
2564 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2568 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2569 /// by [bLIP 2] or if it is a known `T` feature.
2571 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2572 /// set instead (i.e., `bit + 1`).
2574 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2577 pub extern "C" fn Bolt11InvoiceFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2578 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_optional_custom_bit(bit);
2579 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2583 /// Create a blank Features with no features set
2586 pub extern "C" fn OfferFeatures_empty() -> crate::lightning::ln::features::OfferFeatures {
2587 let mut ret = lightning::ln::features::OfferFeatures::empty();
2588 crate::lightning::ln::features::OfferFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2591 /// Returns true if this `Features` object contains required features unknown by `other`.
2594 pub extern "C" fn OfferFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::OfferFeatures, other: &crate::lightning::ln::features::OfferFeatures) -> bool {
2595 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2599 /// Returns true if this `Features` object contains unknown feature flags which are set as
2603 pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::OfferFeatures) -> bool {
2604 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2608 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2611 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2612 /// be set instead (i.e., `bit - 1`).
2614 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2617 pub extern "C" fn OfferFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::OfferFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2618 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_required_feature_bit(bit);
2619 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2623 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2626 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2627 /// set instead (i.e., `bit + 1`).
2629 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2632 pub extern "C" fn OfferFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::OfferFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2633 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_optional_feature_bit(bit);
2634 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2638 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2639 /// by [bLIP 2] or if it is a known `T` feature.
2641 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2642 /// be set instead (i.e., `bit - 1`).
2644 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2647 pub extern "C" fn OfferFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::OfferFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2648 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_required_custom_bit(bit);
2649 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2653 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2654 /// by [bLIP 2] or if it is a known `T` feature.
2656 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2657 /// set instead (i.e., `bit + 1`).
2659 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2662 pub extern "C" fn OfferFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::OfferFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2663 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_optional_custom_bit(bit);
2664 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2668 /// Create a blank Features with no features set
2671 pub extern "C" fn InvoiceRequestFeatures_empty() -> crate::lightning::ln::features::InvoiceRequestFeatures {
2672 let mut ret = lightning::ln::features::InvoiceRequestFeatures::empty();
2673 crate::lightning::ln::features::InvoiceRequestFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2676 /// Returns true if this `Features` object contains required features unknown by `other`.
2679 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures, other: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
2680 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2684 /// Returns true if this `Features` object contains unknown feature flags which are set as
2688 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
2689 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2693 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2696 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2697 /// be set instead (i.e., `bit - 1`).
2699 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2702 pub extern "C" fn InvoiceRequestFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::InvoiceRequestFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2703 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_required_feature_bit(bit);
2704 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2708 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2711 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2712 /// set instead (i.e., `bit + 1`).
2714 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2717 pub extern "C" fn InvoiceRequestFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::InvoiceRequestFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2718 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_optional_feature_bit(bit);
2719 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2723 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2724 /// by [bLIP 2] or if it is a known `T` feature.
2726 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2727 /// be set instead (i.e., `bit - 1`).
2729 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2732 pub extern "C" fn InvoiceRequestFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::InvoiceRequestFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2733 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_required_custom_bit(bit);
2734 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2738 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2739 /// by [bLIP 2] or if it is a known `T` feature.
2741 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2742 /// set instead (i.e., `bit + 1`).
2744 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2747 pub extern "C" fn InvoiceRequestFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::InvoiceRequestFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2748 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_optional_custom_bit(bit);
2749 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2753 /// Create a blank Features with no features set
2756 pub extern "C" fn Bolt12InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt12InvoiceFeatures {
2757 let mut ret = lightning::ln::features::Bolt12InvoiceFeatures::empty();
2758 crate::lightning::ln::features::Bolt12InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2761 /// Returns true if this `Features` object contains required features unknown by `other`.
2764 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures, other: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2765 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2769 /// Returns true if this `Features` object contains unknown feature flags which are set as
2773 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2774 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2778 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2781 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2782 /// be set instead (i.e., `bit - 1`).
2784 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2787 pub extern "C" fn Bolt12InvoiceFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2788 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_required_feature_bit(bit);
2789 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2793 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2796 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2797 /// set instead (i.e., `bit + 1`).
2799 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2802 pub extern "C" fn Bolt12InvoiceFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2803 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_optional_feature_bit(bit);
2804 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2808 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2809 /// by [bLIP 2] or if it is a known `T` feature.
2811 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2812 /// be set instead (i.e., `bit - 1`).
2814 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2817 pub extern "C" fn Bolt12InvoiceFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2818 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_required_custom_bit(bit);
2819 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2823 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2824 /// by [bLIP 2] or if it is a known `T` feature.
2826 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2827 /// set instead (i.e., `bit + 1`).
2829 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2832 pub extern "C" fn Bolt12InvoiceFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2833 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_optional_custom_bit(bit);
2834 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2838 /// Create a blank Features with no features set
2841 pub extern "C" fn BlindedHopFeatures_empty() -> crate::lightning::ln::features::BlindedHopFeatures {
2842 let mut ret = lightning::ln::features::BlindedHopFeatures::empty();
2843 crate::lightning::ln::features::BlindedHopFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2846 /// Returns true if this `Features` object contains required features unknown by `other`.
2849 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::BlindedHopFeatures, other: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2850 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2854 /// Returns true if this `Features` object contains unknown feature flags which are set as
2858 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2859 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2863 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2866 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2867 /// be set instead (i.e., `bit - 1`).
2869 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2872 pub extern "C" fn BlindedHopFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::BlindedHopFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2873 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_required_feature_bit(bit);
2874 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2878 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2881 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2882 /// set instead (i.e., `bit + 1`).
2884 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2887 pub extern "C" fn BlindedHopFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::BlindedHopFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2888 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_optional_feature_bit(bit);
2889 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2893 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2894 /// by [bLIP 2] or if it is a known `T` feature.
2896 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2897 /// be set instead (i.e., `bit - 1`).
2899 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2902 pub extern "C" fn BlindedHopFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::BlindedHopFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2903 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_required_custom_bit(bit);
2904 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2908 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2909 /// by [bLIP 2] or if it is a known `T` feature.
2911 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2912 /// set instead (i.e., `bit + 1`).
2914 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2917 pub extern "C" fn BlindedHopFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::BlindedHopFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2918 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_optional_custom_bit(bit);
2919 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2923 /// Create a blank Features with no features set
2926 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
2927 let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
2928 crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2931 /// Returns true if this `Features` object contains required features unknown by `other`.
2934 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures, other: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2935 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2939 /// Returns true if this `Features` object contains unknown feature flags which are set as
2943 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2944 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2948 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2951 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2952 /// be set instead (i.e., `bit - 1`).
2954 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2957 pub extern "C" fn ChannelTypeFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2958 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_required_feature_bit(bit);
2959 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2963 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2966 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2967 /// set instead (i.e., `bit + 1`).
2969 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2972 pub extern "C" fn ChannelTypeFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2973 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_optional_feature_bit(bit);
2974 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2978 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2979 /// by [bLIP 2] or if it is a known `T` feature.
2981 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2982 /// be set instead (i.e., `bit - 1`).
2984 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2987 pub extern "C" fn ChannelTypeFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2988 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_required_custom_bit(bit);
2989 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2993 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2994 /// by [bLIP 2] or if it is a known `T` feature.
2996 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2997 /// set instead (i.e., `bit + 1`).
2999 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
3002 pub extern "C" fn ChannelTypeFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
3003 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_optional_custom_bit(bit);
3004 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
3009 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
3010 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
3011 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3014 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3015 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
3018 /// Read a InitFeatures from a byte array, created by InitFeatures_write
3019 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
3020 let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3021 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() };
3025 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
3026 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
3027 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3030 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3031 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
3034 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
3035 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
3036 let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3037 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() };
3041 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
3042 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
3043 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3046 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3047 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
3050 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
3051 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
3052 let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3053 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() };
3057 /// Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
3058 pub extern "C" fn Bolt11InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
3059 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3062 pub(crate) extern "C" fn Bolt11InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3063 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt11InvoiceFeatures) })
3066 /// Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
3067 pub extern "C" fn Bolt11InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_Bolt11InvoiceFeaturesDecodeErrorZ {
3068 let res: Result<lightning::ln::features::Bolt11InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3069 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::Bolt11InvoiceFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
3073 /// Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
3074 pub extern "C" fn Bolt12InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
3075 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3078 pub(crate) extern "C" fn Bolt12InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3079 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt12InvoiceFeatures) })
3082 /// Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
3083 pub extern "C" fn Bolt12InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_Bolt12InvoiceFeaturesDecodeErrorZ {
3084 let res: Result<lightning::ln::features::Bolt12InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3085 let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::Bolt12InvoiceFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
3089 /// Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
3090 pub extern "C" fn BlindedHopFeatures_write(obj: &crate::lightning::ln::features::BlindedHopFeatures) -> crate::c_types::derived::CVec_u8Z {
3091 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3094 pub(crate) extern "C" fn BlindedHopFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3095 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedHopFeatures) })
3098 /// Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
3099 pub extern "C" fn BlindedHopFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_BlindedHopFeaturesDecodeErrorZ {
3100 let res: Result<lightning::ln::features::BlindedHopFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3101 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() };
3105 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
3106 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
3107 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3110 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3111 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
3114 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
3115 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
3116 let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3117 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() };