1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
4 // This file is licensed under the license available in the LICENSE or LICENSE.md
5 // file in the root of this repository or, if no such file exists, the same
6 // license as that which applies to the original source files from which this
7 // source was automatically generated.
9 //! Feature flag definitions for the Lightning protocol according to [BOLT #9].
11 //! Lightning nodes advertise a supported set of operation through feature flags. Features are
12 //! applicable for a specific context as indicated in some [messages]. [`Features`] encapsulates
13 //! behavior for specifying and checking feature flags for a particular context. Each feature is
14 //! defined internally by a trait specifying the corresponding flags (i.e., even and odd bits).
16 //! Whether a feature is considered \"known\" or \"unknown\" is relative to the implementation, whereas
17 //! the term \"supports\" is used in reference to a particular set of [`Features`]. That is, a node
18 //! supports a feature if it advertises the feature (as either required or optional) to its peers.
19 //! And the implementation can interpret a feature if the feature is known to it.
21 //! The following features are currently required in the LDK:
22 //! - `VariableLengthOnion` - requires/supports variable-length routing onion payloads
23 //! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for more information).
24 //! - `StaticRemoteKey` - requires/supports static key for remote output
25 //! (see [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more information).
27 //! The following features are currently supported in the LDK:
28 //! - `DataLossProtect` - requires/supports that a node which has somehow fallen behind, e.g., has been restored from an old backup,
29 //! can detect that it has fallen behind
30 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
31 //! - `InitialRoutingSync` - requires/supports that the sending node needs a complete routing information dump
32 //! (see [BOLT-7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#initial-sync) for more information).
33 //! - `UpfrontShutdownScript` - commits to a shutdown scriptpubkey when opening a channel
34 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message) for more information).
35 //! - `GossipQueries` - requires/supports more sophisticated gossip control
36 //! (see [BOLT-7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md) for more information).
37 //! - `PaymentSecret` - requires/supports that a node supports payment_secret field
38 //! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for more information).
39 //! - `BasicMPP` - requires/supports that a node can receive basic multi-part payments
40 //! (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#basic-multi-part-payments) for more information).
41 //! - `Wumbo` - requires/supports that a node create large channels. Called `option_support_large_channel` in the spec.
42 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message) for more information).
43 //! - `ShutdownAnySegwit` - requires/supports that future segwit versions are allowed in `shutdown`
44 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
45 //! - `OnionMessages` - requires/supports forwarding onion messages
46 //! (see [BOLT-7](https://github.com/lightning/bolts/pull/759/files) for more information).
47 //! - `ChannelType` - node supports the channel_type field in open/accept
48 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
49 //! - `SCIDPrivacy` - supply channel aliases for routing
50 //! (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
51 //! - `PaymentMetadata` - include additional data in invoices which is passed to recipients in the
53 //! (see [BOLT-11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) for
55 //! - `ZeroConf` - supports accepting HTLCs and using channels prior to funding confirmation
57 //! [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message)
59 //! - `Keysend` - send funds to a node without an invoice
60 //! (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
61 //! - `AnchorsZeroFeeHtlcTx` - requires/supports that commitment transactions include anchor outputs
62 //! and HTLC transactions are pre-signed with zero fee (see
63 //! [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more
66 //! LDK knows about the following features, but does not support them:
67 //! - `AnchorsNonzeroFeeHtlcTx` - the initial version of anchor outputs, which was later found to be
68 //! vulnerable (see this
69 //! [mailing list post](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html)
70 //! for more information).
72 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
73 //! [messages]: crate::ln::msgs
75 use alloc::str::FromStr;
76 use alloc::string::String;
77 use core::ffi::c_void;
78 use core::convert::Infallible;
79 use bitcoin::hashes::Hash;
80 use crate::c_types::*;
81 #[cfg(feature="no-std")]
82 use alloc::{vec::Vec, boxed::Box};
86 use alloc::str::FromStr;
87 use alloc::string::String;
88 use core::ffi::c_void;
89 use core::convert::Infallible;
90 use bitcoin::hashes::Hash;
91 use crate::c_types::*;
92 #[cfg(feature="no-std")]
93 use alloc::{vec::Vec, boxed::Box};
95 /// Set this feature as optional.
97 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
98 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_optional()
101 /// Set this feature as required.
103 pub extern "C" fn InitFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
104 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_required()
107 /// Checks if this feature is supported.
110 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
111 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
115 /// Set this feature as optional.
117 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
118 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_optional()
121 /// Set this feature as required.
123 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
124 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_required()
127 /// Checks if this feature is supported.
130 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
131 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
135 /// Checks if this feature is required.
138 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
139 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
143 /// Checks if this feature is required.
146 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
147 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
151 /// Set this feature as optional.
153 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
154 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_optional()
157 /// Set this feature as required.
159 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
160 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_required()
163 /// Checks if this feature is supported.
166 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
167 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
171 /// Set this feature as optional.
173 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
174 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_optional()
177 /// Set this feature as required.
179 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
180 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_required()
183 /// Checks if this feature is supported.
186 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
187 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
191 /// Set this feature as optional.
193 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
194 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_optional()
197 /// Set this feature as required.
199 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
200 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_required()
203 /// Checks if this feature is supported.
206 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
207 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
211 /// Checks if this feature is required.
214 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
215 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
219 /// Checks if this feature is required.
222 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
223 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
227 /// Set this feature as optional.
229 pub extern "C" fn InitFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
230 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_optional()
233 /// Set this feature as required.
235 pub extern "C" fn InitFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
236 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_required()
239 /// Checks if this feature is supported.
242 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
243 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
247 /// Set this feature as optional.
249 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
250 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_optional()
253 /// Set this feature as required.
255 pub extern "C" fn NodeFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
256 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_required()
259 /// Checks if this feature is supported.
262 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
263 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
267 /// Checks if this feature is required.
270 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
271 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
275 /// Checks if this feature is required.
278 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
279 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
283 /// Set this feature as optional.
285 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
286 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_optional()
289 /// Set this feature as required.
291 pub extern "C" fn InitFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
292 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_required()
295 /// Checks if this feature is supported.
298 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
299 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
303 /// Set this feature as optional.
305 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
306 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_optional()
309 /// Set this feature as required.
311 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
312 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_required()
315 /// Checks if this feature is supported.
318 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
319 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
323 /// Set this feature as optional.
325 pub extern "C" fn Bolt11InvoiceFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
326 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_variable_length_onion_optional()
329 /// Set this feature as required.
331 pub extern "C" fn Bolt11InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
332 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_variable_length_onion_required()
335 /// Checks if this feature is supported.
338 pub extern "C" fn Bolt11InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
339 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
343 /// Checks if this feature is required.
346 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
347 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
351 /// Checks if this feature is required.
354 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
355 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
359 /// Checks if this feature is required.
362 pub extern "C" fn Bolt11InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
363 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
367 /// Set this feature as optional.
369 pub extern "C" fn InitFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
370 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_optional()
373 /// Set this feature as required.
375 pub extern "C" fn InitFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
376 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_required()
379 /// Checks if this feature is supported.
382 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
383 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
387 /// Set this feature as optional.
389 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
390 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_optional()
393 /// Set this feature as required.
395 pub extern "C" fn NodeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
396 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_required()
399 /// Checks if this feature is supported.
402 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
403 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
407 /// Set this feature as optional.
409 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
410 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_optional()
413 /// Set this feature as required.
415 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
416 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_required()
419 /// Checks if this feature is supported.
422 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
423 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
427 /// Checks if this feature is required.
430 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
431 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
435 /// Checks if this feature is required.
438 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
439 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
443 /// Checks if this feature is required.
446 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
447 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
451 /// Set this feature as optional.
453 pub extern "C" fn InitFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
454 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_optional()
457 /// Set this feature as required.
459 pub extern "C" fn InitFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
460 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_required()
463 /// Checks if this feature is supported.
466 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
467 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
471 /// Set this feature as optional.
473 pub extern "C" fn NodeFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
474 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_optional()
477 /// Set this feature as required.
479 pub extern "C" fn NodeFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
480 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_required()
483 /// Checks if this feature is supported.
486 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
487 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
491 /// Set this feature as optional.
493 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
494 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_secret_optional()
497 /// Set this feature as required.
499 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
500 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_secret_required()
503 /// Checks if this feature is supported.
506 pub extern "C" fn Bolt11InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
507 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
511 /// Checks if this feature is required.
514 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
515 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
519 /// Checks if this feature is required.
522 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
523 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
527 /// Checks if this feature is required.
530 pub extern "C" fn Bolt11InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
531 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
535 /// Set this feature as optional.
537 pub extern "C" fn InitFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
538 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_optional()
541 /// Set this feature as required.
543 pub extern "C" fn InitFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
544 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_required()
547 /// Checks if this feature is supported.
550 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
551 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
555 /// Set this feature as optional.
557 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
558 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_optional()
561 /// Set this feature as required.
563 pub extern "C" fn NodeFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
564 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_required()
567 /// Checks if this feature is supported.
570 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
571 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
575 /// Set this feature as optional.
577 pub extern "C" fn Bolt11InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
578 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_basic_mpp_optional()
581 /// Set this feature as required.
583 pub extern "C" fn Bolt11InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
584 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_basic_mpp_required()
587 /// Checks if this feature is supported.
590 pub extern "C" fn Bolt11InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
591 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
595 /// Set this feature as optional.
597 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
598 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_optional()
601 /// Set this feature as required.
603 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
604 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_required()
607 /// Checks if this feature is supported.
610 pub extern "C" fn Bolt12InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
611 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
615 /// Checks if this feature is required.
618 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
619 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
623 /// Checks if this feature is required.
626 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
627 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
631 /// Checks if this feature is required.
634 pub extern "C" fn Bolt11InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
635 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
639 /// Checks if this feature is required.
642 pub extern "C" fn Bolt12InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
643 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
647 /// Set this feature as optional.
649 pub extern "C" fn InitFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
650 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_optional()
653 /// Set this feature as required.
655 pub extern "C" fn InitFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
656 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_required()
659 /// Checks if this feature is supported.
662 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
663 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
667 /// Set this feature as optional.
669 pub extern "C" fn NodeFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
670 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_optional()
673 /// Set this feature as required.
675 pub extern "C" fn NodeFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
676 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_required()
679 /// Checks if this feature is supported.
682 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
683 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
687 /// Checks if this feature is required.
690 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
691 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
695 /// Checks if this feature is required.
698 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
699 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
703 /// Set this feature as optional.
705 pub extern "C" fn InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
706 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
709 /// Set this feature as required.
711 pub extern "C" fn InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
712 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
715 /// Checks if this feature is supported.
718 pub extern "C" fn InitFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
719 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
723 /// Set this feature as optional.
725 pub extern "C" fn NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
726 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
729 /// Set this feature as required.
731 pub extern "C" fn NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
732 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
735 /// Checks if this feature is supported.
738 pub extern "C" fn NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
739 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
743 /// Set this feature as optional.
745 pub extern "C" fn ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
746 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
749 /// Set this feature as required.
751 pub extern "C" fn ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
752 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
755 /// Checks if this feature is supported.
758 pub extern "C" fn ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
759 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
763 /// Checks if this feature is required.
766 pub extern "C" fn InitFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
767 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
771 /// Checks if this feature is required.
774 pub extern "C" fn NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
775 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
779 /// Checks if this feature is required.
782 pub extern "C" fn ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
783 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
787 /// Set this feature as optional.
789 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
790 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
793 /// Set this feature as required.
795 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
796 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
799 /// Checks if this feature is supported.
802 pub extern "C" fn InitFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
803 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
807 /// Set this feature as optional.
809 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
810 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
813 /// Set this feature as required.
815 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
816 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
819 /// Checks if this feature is supported.
822 pub extern "C" fn NodeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
823 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
827 /// Set this feature as optional.
829 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
830 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
833 /// Set this feature as required.
835 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
836 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
839 /// Checks if this feature is supported.
842 pub extern "C" fn ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
843 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
847 /// Checks if this feature is required.
850 pub extern "C" fn InitFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
851 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
855 /// Checks if this feature is required.
858 pub extern "C" fn NodeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
859 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
863 /// Checks if this feature is required.
866 pub extern "C" fn ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
867 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
871 /// Set this feature as optional.
873 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
874 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_optional()
877 /// Set this feature as required.
879 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
880 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_required()
883 /// Checks if this feature is supported.
886 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
887 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
891 /// Set this feature as optional.
893 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
894 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_optional()
897 /// Set this feature as required.
899 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
900 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_required()
903 /// Checks if this feature is supported.
906 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
907 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
911 /// Checks if this feature is required.
914 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
915 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
919 /// Checks if this feature is required.
922 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
923 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
927 /// Set this feature as optional.
929 pub extern "C" fn InitFeatures_set_taproot_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
930 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_taproot_optional()
933 /// Set this feature as required.
935 pub extern "C" fn InitFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
936 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_taproot_required()
939 /// Checks if this feature is supported.
942 pub extern "C" fn InitFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
943 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
947 /// Set this feature as optional.
949 pub extern "C" fn NodeFeatures_set_taproot_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
950 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_taproot_optional()
953 /// Set this feature as required.
955 pub extern "C" fn NodeFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
956 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_taproot_required()
959 /// Checks if this feature is supported.
962 pub extern "C" fn NodeFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
963 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
967 /// Set this feature as optional.
969 pub extern "C" fn ChannelTypeFeatures_set_taproot_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
970 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_taproot_optional()
973 /// Set this feature as required.
975 pub extern "C" fn ChannelTypeFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
976 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_taproot_required()
979 /// Checks if this feature is supported.
982 pub extern "C" fn ChannelTypeFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
983 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
987 /// Checks if this feature is required.
990 pub extern "C" fn InitFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
991 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
995 /// Checks if this feature is required.
998 pub extern "C" fn NodeFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
999 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
1003 /// Checks if this feature is required.
1006 pub extern "C" fn ChannelTypeFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1007 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
1011 /// Set this feature as optional.
1013 pub extern "C" fn InitFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1014 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_optional()
1017 /// Set this feature as required.
1019 pub extern "C" fn InitFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1020 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_required()
1023 /// Checks if this feature is supported.
1026 pub extern "C" fn InitFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1027 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
1031 /// Set this feature as optional.
1033 pub extern "C" fn NodeFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1034 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_optional()
1037 /// Set this feature as required.
1039 pub extern "C" fn NodeFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1040 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_required()
1043 /// Checks if this feature is supported.
1046 pub extern "C" fn NodeFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1047 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
1051 /// Checks if this feature is required.
1054 pub extern "C" fn InitFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1055 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
1059 /// Checks if this feature is required.
1062 pub extern "C" fn NodeFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1063 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
1067 /// Set this feature as optional.
1069 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1070 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
1073 /// Set this feature as required.
1075 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1076 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
1079 /// Checks if this feature is supported.
1082 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1083 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
1087 /// Set this feature as optional.
1089 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1090 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
1093 /// Set this feature as required.
1095 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1096 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
1099 /// Checks if this feature is supported.
1102 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1103 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
1107 /// Checks if this feature is required.
1110 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1111 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
1115 /// Checks if this feature is required.
1118 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1119 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
1123 /// Set this feature as optional.
1125 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1126 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
1129 /// Set this feature as required.
1131 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1132 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
1135 /// Checks if this feature is supported.
1138 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1139 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1143 /// Set this feature as optional.
1145 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1146 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
1149 /// Set this feature as required.
1151 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1152 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
1155 /// Checks if this feature is supported.
1158 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1159 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1163 /// Set this feature as optional.
1165 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1166 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
1169 /// Set this feature as required.
1171 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1172 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
1175 /// Checks if this feature is supported.
1178 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1179 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1183 /// Checks if this feature is required.
1186 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1187 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1191 /// Checks if this feature is required.
1194 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1195 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1199 /// Checks if this feature is required.
1202 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1203 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1207 /// Set this feature as optional.
1209 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_metadata_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1210 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_metadata_optional()
1213 /// Set this feature as required.
1215 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_metadata_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1216 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_metadata_required()
1219 /// Checks if this feature is supported.
1222 pub extern "C" fn Bolt11InvoiceFeatures_supports_payment_metadata(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1223 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_metadata();
1227 /// Checks if this feature is required.
1230 pub extern "C" fn Bolt11InvoiceFeatures_requires_payment_metadata(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1231 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_metadata();
1235 /// Set this feature as optional.
1237 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1238 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
1241 /// Set this feature as required.
1243 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1244 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
1247 /// Checks if this feature is supported.
1250 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1251 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1255 /// Set this feature as optional.
1257 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1258 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
1261 /// Set this feature as required.
1263 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1264 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
1267 /// Checks if this feature is supported.
1270 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1271 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1275 /// Set this feature as optional.
1277 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1278 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
1281 /// Set this feature as required.
1283 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1284 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
1287 /// Checks if this feature is supported.
1290 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1291 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1295 /// Checks if this feature is required.
1298 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1299 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1303 /// Checks if this feature is required.
1306 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1307 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1311 /// Checks if this feature is required.
1314 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1315 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1319 /// Set this feature as optional.
1321 pub extern "C" fn NodeFeatures_set_keysend_optional(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_keysend_optional()
1325 /// Set this feature as required.
1327 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1328 unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
1331 /// Checks if this feature is supported.
1334 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1335 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
1339 /// Checks if this feature is required.
1342 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1343 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
1348 /// Checks if two InitFeaturess contain equal inner contents.
1349 /// This ignores pointers and is_owned flags and looks at the values in fields.
1350 /// Two objects with NULL inner values will be considered "equal" here.
1352 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
1353 if a.inner == b.inner { return true; }
1354 if a.inner.is_null() || b.inner.is_null() { return false; }
1355 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1357 /// Checks if two NodeFeaturess contain equal inner contents.
1358 /// This ignores pointers and is_owned flags and looks at the values in fields.
1359 /// Two objects with NULL inner values will be considered "equal" here.
1361 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
1362 if a.inner == b.inner { return true; }
1363 if a.inner.is_null() || b.inner.is_null() { return false; }
1364 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1366 /// Checks if two ChannelFeaturess contain equal inner contents.
1367 /// This ignores pointers and is_owned flags and looks at the values in fields.
1368 /// Two objects with NULL inner values will be considered "equal" here.
1370 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
1371 if a.inner == b.inner { return true; }
1372 if a.inner.is_null() || b.inner.is_null() { return false; }
1373 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1375 /// Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
1376 /// This ignores pointers and is_owned flags and looks at the values in fields.
1377 /// Two objects with NULL inner values will be considered "equal" here.
1379 pub extern "C" fn Bolt11InvoiceFeatures_eq(a: &Bolt11InvoiceFeatures, b: &Bolt11InvoiceFeatures) -> bool {
1380 if a.inner == b.inner { return true; }
1381 if a.inner.is_null() || b.inner.is_null() { return false; }
1382 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1384 /// Checks if two OfferFeaturess contain equal inner contents.
1385 /// This ignores pointers and is_owned flags and looks at the values in fields.
1386 /// Two objects with NULL inner values will be considered "equal" here.
1388 pub extern "C" fn OfferFeatures_eq(a: &OfferFeatures, b: &OfferFeatures) -> bool {
1389 if a.inner == b.inner { return true; }
1390 if a.inner.is_null() || b.inner.is_null() { return false; }
1391 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1393 /// Checks if two InvoiceRequestFeaturess contain equal inner contents.
1394 /// This ignores pointers and is_owned flags and looks at the values in fields.
1395 /// Two objects with NULL inner values will be considered "equal" here.
1397 pub extern "C" fn InvoiceRequestFeatures_eq(a: &InvoiceRequestFeatures, b: &InvoiceRequestFeatures) -> bool {
1398 if a.inner == b.inner { return true; }
1399 if a.inner.is_null() || b.inner.is_null() { return false; }
1400 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1402 /// Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
1403 /// This ignores pointers and is_owned flags and looks at the values in fields.
1404 /// Two objects with NULL inner values will be considered "equal" here.
1406 pub extern "C" fn Bolt12InvoiceFeatures_eq(a: &Bolt12InvoiceFeatures, b: &Bolt12InvoiceFeatures) -> bool {
1407 if a.inner == b.inner { return true; }
1408 if a.inner.is_null() || b.inner.is_null() { return false; }
1409 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1411 /// Checks if two BlindedHopFeaturess contain equal inner contents.
1412 /// This ignores pointers and is_owned flags and looks at the values in fields.
1413 /// Two objects with NULL inner values will be considered "equal" here.
1415 pub extern "C" fn BlindedHopFeatures_eq(a: &BlindedHopFeatures, b: &BlindedHopFeatures) -> bool {
1416 if a.inner == b.inner { return true; }
1417 if a.inner.is_null() || b.inner.is_null() { return false; }
1418 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1420 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
1421 /// This ignores pointers and is_owned flags and looks at the values in fields.
1422 /// Two objects with NULL inner values will be considered "equal" here.
1424 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
1425 if a.inner == b.inner { return true; }
1426 if a.inner.is_null() || b.inner.is_null() { return false; }
1427 if a.get_native_ref() == b.get_native_ref() { true } else { false }
1429 impl Clone for InitFeatures {
1430 fn clone(&self) -> Self {
1432 inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1433 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1439 /// Used only if an object of this type is returned as a trait impl by a method
1440 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1441 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeInitFeatures)).clone() })) as *mut c_void
1444 /// Creates a copy of the InitFeatures
1445 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1448 impl Clone for NodeFeatures {
1449 fn clone(&self) -> Self {
1451 inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1452 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1458 /// Used only if an object of this type is returned as a trait impl by a method
1459 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1460 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeNodeFeatures)).clone() })) as *mut c_void
1463 /// Creates a copy of the NodeFeatures
1464 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1467 impl Clone for ChannelFeatures {
1468 fn clone(&self) -> Self {
1470 inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1471 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1477 /// Used only if an object of this type is returned as a trait impl by a method
1478 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1479 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeChannelFeatures)).clone() })) as *mut c_void
1482 /// Creates a copy of the ChannelFeatures
1483 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1486 impl Clone for Bolt11InvoiceFeatures {
1487 fn clone(&self) -> Self {
1489 inner: if <*mut nativeBolt11InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1490 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1496 /// Used only if an object of this type is returned as a trait impl by a method
1497 pub(crate) extern "C" fn Bolt11InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1498 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt11InvoiceFeatures)).clone() })) as *mut c_void
1501 /// Creates a copy of the Bolt11InvoiceFeatures
1502 pub extern "C" fn Bolt11InvoiceFeatures_clone(orig: &Bolt11InvoiceFeatures) -> Bolt11InvoiceFeatures {
1505 impl Clone for OfferFeatures {
1506 fn clone(&self) -> Self {
1508 inner: if <*mut nativeOfferFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1509 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1515 /// Used only if an object of this type is returned as a trait impl by a method
1516 pub(crate) extern "C" fn OfferFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1517 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeOfferFeatures)).clone() })) as *mut c_void
1520 /// Creates a copy of the OfferFeatures
1521 pub extern "C" fn OfferFeatures_clone(orig: &OfferFeatures) -> OfferFeatures {
1524 impl Clone for InvoiceRequestFeatures {
1525 fn clone(&self) -> Self {
1527 inner: if <*mut nativeInvoiceRequestFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1528 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1534 /// Used only if an object of this type is returned as a trait impl by a method
1535 pub(crate) extern "C" fn InvoiceRequestFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1536 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
1539 /// Creates a copy of the InvoiceRequestFeatures
1540 pub extern "C" fn InvoiceRequestFeatures_clone(orig: &InvoiceRequestFeatures) -> InvoiceRequestFeatures {
1543 impl Clone for Bolt12InvoiceFeatures {
1544 fn clone(&self) -> Self {
1546 inner: if <*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1547 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1553 /// Used only if an object of this type is returned as a trait impl by a method
1554 pub(crate) extern "C" fn Bolt12InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1555 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt12InvoiceFeatures)).clone() })) as *mut c_void
1558 /// Creates a copy of the Bolt12InvoiceFeatures
1559 pub extern "C" fn Bolt12InvoiceFeatures_clone(orig: &Bolt12InvoiceFeatures) -> Bolt12InvoiceFeatures {
1562 impl Clone for BlindedHopFeatures {
1563 fn clone(&self) -> Self {
1565 inner: if <*mut nativeBlindedHopFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1566 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1572 /// Used only if an object of this type is returned as a trait impl by a method
1573 pub(crate) extern "C" fn BlindedHopFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1574 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBlindedHopFeatures)).clone() })) as *mut c_void
1577 /// Creates a copy of the BlindedHopFeatures
1578 pub extern "C" fn BlindedHopFeatures_clone(orig: &BlindedHopFeatures) -> BlindedHopFeatures {
1581 impl Clone for ChannelTypeFeatures {
1582 fn clone(&self) -> Self {
1584 inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1585 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1591 /// Used only if an object of this type is returned as a trait impl by a method
1592 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1593 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeChannelTypeFeatures)).clone() })) as *mut c_void
1596 /// Creates a copy of the ChannelTypeFeatures
1597 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1601 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1602 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1604 /// Features used within an `init` message.
1607 pub struct InitFeatures {
1608 /// A pointer to the opaque Rust object.
1610 /// Nearly everywhere, inner must be non-null, however in places where
1611 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1612 pub inner: *mut nativeInitFeatures,
1613 /// Indicates that this is the only struct which contains the same pointer.
1615 /// Rust functions which take ownership of an object provided via an argument require
1616 /// this to be true and invalidate the object pointed to by inner.
1620 impl Drop for InitFeatures {
1621 fn drop(&mut self) {
1622 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1623 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1627 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1629 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1631 /// Used only if an object of this type is returned as a trait impl by a method
1632 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1633 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInitFeatures) };
1637 pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1638 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1640 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1641 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1643 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1644 pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1645 assert!(self.is_owned);
1646 let ret = ObjOps::untweak_ptr(self.inner);
1647 self.inner = core::ptr::null_mut();
1652 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1653 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1655 /// Features used within a `node_announcement` message.
1658 pub struct NodeFeatures {
1659 /// A pointer to the opaque Rust object.
1661 /// Nearly everywhere, inner must be non-null, however in places where
1662 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1663 pub inner: *mut nativeNodeFeatures,
1664 /// Indicates that this is the only struct which contains the same pointer.
1666 /// Rust functions which take ownership of an object provided via an argument require
1667 /// this to be true and invalidate the object pointed to by inner.
1671 impl Drop for NodeFeatures {
1672 fn drop(&mut self) {
1673 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1674 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1678 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1680 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1682 /// Used only if an object of this type is returned as a trait impl by a method
1683 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1684 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeNodeFeatures) };
1688 pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1689 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1691 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1692 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1694 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1695 pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1696 assert!(self.is_owned);
1697 let ret = ObjOps::untweak_ptr(self.inner);
1698 self.inner = core::ptr::null_mut();
1703 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1704 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1706 /// Features used within a `channel_announcement` message.
1709 pub struct ChannelFeatures {
1710 /// A pointer to the opaque Rust object.
1712 /// Nearly everywhere, inner must be non-null, however in places where
1713 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1714 pub inner: *mut nativeChannelFeatures,
1715 /// Indicates that this is the only struct which contains the same pointer.
1717 /// Rust functions which take ownership of an object provided via an argument require
1718 /// this to be true and invalidate the object pointed to by inner.
1722 impl Drop for ChannelFeatures {
1723 fn drop(&mut self) {
1724 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1725 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1729 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1731 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1733 /// Used only if an object of this type is returned as a trait impl by a method
1734 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1735 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelFeatures) };
1738 impl ChannelFeatures {
1739 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1740 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1742 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1743 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1745 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1746 pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1747 assert!(self.is_owned);
1748 let ret = ObjOps::untweak_ptr(self.inner);
1749 self.inner = core::ptr::null_mut();
1754 use lightning::ln::features::Bolt11InvoiceFeatures as nativeBolt11InvoiceFeaturesImport;
1755 pub(crate) type nativeBolt11InvoiceFeatures = nativeBolt11InvoiceFeaturesImport;
1757 /// Features used within an invoice.
1760 pub struct Bolt11InvoiceFeatures {
1761 /// A pointer to the opaque Rust object.
1763 /// Nearly everywhere, inner must be non-null, however in places where
1764 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1765 pub inner: *mut nativeBolt11InvoiceFeatures,
1766 /// Indicates that this is the only struct which contains the same pointer.
1768 /// Rust functions which take ownership of an object provided via an argument require
1769 /// this to be true and invalidate the object pointed to by inner.
1773 impl Drop for Bolt11InvoiceFeatures {
1774 fn drop(&mut self) {
1775 if self.is_owned && !<*mut nativeBolt11InvoiceFeatures>::is_null(self.inner) {
1776 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1780 /// Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
1782 pub extern "C" fn Bolt11InvoiceFeatures_free(this_obj: Bolt11InvoiceFeatures) { }
1784 /// Used only if an object of this type is returned as a trait impl by a method
1785 pub(crate) extern "C" fn Bolt11InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1786 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt11InvoiceFeatures) };
1789 impl Bolt11InvoiceFeatures {
1790 pub(crate) fn get_native_ref(&self) -> &'static nativeBolt11InvoiceFeatures {
1791 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1793 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt11InvoiceFeatures {
1794 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1796 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1797 pub(crate) fn take_inner(mut self) -> *mut nativeBolt11InvoiceFeatures {
1798 assert!(self.is_owned);
1799 let ret = ObjOps::untweak_ptr(self.inner);
1800 self.inner = core::ptr::null_mut();
1805 use lightning::ln::features::OfferFeatures as nativeOfferFeaturesImport;
1806 pub(crate) type nativeOfferFeatures = nativeOfferFeaturesImport;
1808 /// Features used within an `offer`.
1811 pub struct OfferFeatures {
1812 /// A pointer to the opaque Rust object.
1814 /// Nearly everywhere, inner must be non-null, however in places where
1815 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1816 pub inner: *mut nativeOfferFeatures,
1817 /// Indicates that this is the only struct which contains the same pointer.
1819 /// Rust functions which take ownership of an object provided via an argument require
1820 /// this to be true and invalidate the object pointed to by inner.
1824 impl Drop for OfferFeatures {
1825 fn drop(&mut self) {
1826 if self.is_owned && !<*mut nativeOfferFeatures>::is_null(self.inner) {
1827 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1831 /// Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
1833 pub extern "C" fn OfferFeatures_free(this_obj: OfferFeatures) { }
1835 /// Used only if an object of this type is returned as a trait impl by a method
1836 pub(crate) extern "C" fn OfferFeatures_free_void(this_ptr: *mut c_void) {
1837 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferFeatures) };
1840 impl OfferFeatures {
1841 pub(crate) fn get_native_ref(&self) -> &'static nativeOfferFeatures {
1842 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1844 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferFeatures {
1845 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1847 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1848 pub(crate) fn take_inner(mut self) -> *mut nativeOfferFeatures {
1849 assert!(self.is_owned);
1850 let ret = ObjOps::untweak_ptr(self.inner);
1851 self.inner = core::ptr::null_mut();
1856 use lightning::ln::features::InvoiceRequestFeatures as nativeInvoiceRequestFeaturesImport;
1857 pub(crate) type nativeInvoiceRequestFeatures = nativeInvoiceRequestFeaturesImport;
1859 /// Features used within an `invoice_request`.
1862 pub struct InvoiceRequestFeatures {
1863 /// A pointer to the opaque Rust object.
1865 /// Nearly everywhere, inner must be non-null, however in places where
1866 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1867 pub inner: *mut nativeInvoiceRequestFeatures,
1868 /// Indicates that this is the only struct which contains the same pointer.
1870 /// Rust functions which take ownership of an object provided via an argument require
1871 /// this to be true and invalidate the object pointed to by inner.
1875 impl Drop for InvoiceRequestFeatures {
1876 fn drop(&mut self) {
1877 if self.is_owned && !<*mut nativeInvoiceRequestFeatures>::is_null(self.inner) {
1878 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1882 /// Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
1884 pub extern "C" fn InvoiceRequestFeatures_free(this_obj: InvoiceRequestFeatures) { }
1886 /// Used only if an object of this type is returned as a trait impl by a method
1887 pub(crate) extern "C" fn InvoiceRequestFeatures_free_void(this_ptr: *mut c_void) {
1888 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceRequestFeatures) };
1891 impl InvoiceRequestFeatures {
1892 pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceRequestFeatures {
1893 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1895 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceRequestFeatures {
1896 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1898 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1899 pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceRequestFeatures {
1900 assert!(self.is_owned);
1901 let ret = ObjOps::untweak_ptr(self.inner);
1902 self.inner = core::ptr::null_mut();
1907 use lightning::ln::features::Bolt12InvoiceFeatures as nativeBolt12InvoiceFeaturesImport;
1908 pub(crate) type nativeBolt12InvoiceFeatures = nativeBolt12InvoiceFeaturesImport;
1910 /// Features used within an `invoice`.
1913 pub struct Bolt12InvoiceFeatures {
1914 /// A pointer to the opaque Rust object.
1916 /// Nearly everywhere, inner must be non-null, however in places where
1917 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1918 pub inner: *mut nativeBolt12InvoiceFeatures,
1919 /// Indicates that this is the only struct which contains the same pointer.
1921 /// Rust functions which take ownership of an object provided via an argument require
1922 /// this to be true and invalidate the object pointed to by inner.
1926 impl Drop for Bolt12InvoiceFeatures {
1927 fn drop(&mut self) {
1928 if self.is_owned && !<*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) {
1929 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1933 /// Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
1935 pub extern "C" fn Bolt12InvoiceFeatures_free(this_obj: Bolt12InvoiceFeatures) { }
1937 /// Used only if an object of this type is returned as a trait impl by a method
1938 pub(crate) extern "C" fn Bolt12InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1939 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt12InvoiceFeatures) };
1942 impl Bolt12InvoiceFeatures {
1943 pub(crate) fn get_native_ref(&self) -> &'static nativeBolt12InvoiceFeatures {
1944 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1946 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt12InvoiceFeatures {
1947 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1949 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1950 pub(crate) fn take_inner(mut self) -> *mut nativeBolt12InvoiceFeatures {
1951 assert!(self.is_owned);
1952 let ret = ObjOps::untweak_ptr(self.inner);
1953 self.inner = core::ptr::null_mut();
1958 use lightning::ln::features::BlindedHopFeatures as nativeBlindedHopFeaturesImport;
1959 pub(crate) type nativeBlindedHopFeatures = nativeBlindedHopFeaturesImport;
1961 /// Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
1964 pub struct BlindedHopFeatures {
1965 /// A pointer to the opaque Rust object.
1967 /// Nearly everywhere, inner must be non-null, however in places where
1968 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1969 pub inner: *mut nativeBlindedHopFeatures,
1970 /// Indicates that this is the only struct which contains the same pointer.
1972 /// Rust functions which take ownership of an object provided via an argument require
1973 /// this to be true and invalidate the object pointed to by inner.
1977 impl Drop for BlindedHopFeatures {
1978 fn drop(&mut self) {
1979 if self.is_owned && !<*mut nativeBlindedHopFeatures>::is_null(self.inner) {
1980 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1984 /// Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
1986 pub extern "C" fn BlindedHopFeatures_free(this_obj: BlindedHopFeatures) { }
1988 /// Used only if an object of this type is returned as a trait impl by a method
1989 pub(crate) extern "C" fn BlindedHopFeatures_free_void(this_ptr: *mut c_void) {
1990 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBlindedHopFeatures) };
1993 impl BlindedHopFeatures {
1994 pub(crate) fn get_native_ref(&self) -> &'static nativeBlindedHopFeatures {
1995 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1997 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBlindedHopFeatures {
1998 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2000 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2001 pub(crate) fn take_inner(mut self) -> *mut nativeBlindedHopFeatures {
2002 assert!(self.is_owned);
2003 let ret = ObjOps::untweak_ptr(self.inner);
2004 self.inner = core::ptr::null_mut();
2009 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
2010 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
2012 /// Features used within the channel_type field in an OpenChannel message.
2014 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
2015 /// semantics of our interaction with our peer.
2017 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
2018 /// the counterparty, only required features are allowed here.
2020 /// This is serialized differently from other feature types - it is not prefixed by a length, and
2021 /// thus must only appear inside a TLV where its length is known in advance.
2024 pub struct ChannelTypeFeatures {
2025 /// A pointer to the opaque Rust object.
2027 /// Nearly everywhere, inner must be non-null, however in places where
2028 /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2029 pub inner: *mut nativeChannelTypeFeatures,
2030 /// Indicates that this is the only struct which contains the same pointer.
2032 /// Rust functions which take ownership of an object provided via an argument require
2033 /// this to be true and invalidate the object pointed to by inner.
2037 impl Drop for ChannelTypeFeatures {
2038 fn drop(&mut self) {
2039 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
2040 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2044 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
2046 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
2048 /// Used only if an object of this type is returned as a trait impl by a method
2049 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
2050 let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures) };
2053 impl ChannelTypeFeatures {
2054 pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
2055 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2057 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
2058 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2060 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2061 pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
2062 assert!(self.is_owned);
2063 let ret = ObjOps::untweak_ptr(self.inner);
2064 self.inner = core::ptr::null_mut();
2068 /// Create a blank Features with no features set
2071 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
2072 let mut ret = lightning::ln::features::InitFeatures::empty();
2073 crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2076 /// Returns true if this `Features` object contains required features unknown by `other`.
2079 pub extern "C" fn InitFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InitFeatures, other: &crate::lightning::ln::features::InitFeatures) -> bool {
2080 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2084 /// Returns true if this `Features` object contains unknown feature flags which are set as
2088 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
2089 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2093 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2096 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2097 /// be set instead (i.e., `bit - 1`).
2099 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2102 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 {
2103 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_required_feature_bit(bit);
2104 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() };
2108 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2111 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2112 /// set instead (i.e., `bit + 1`).
2114 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2117 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 {
2118 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_optional_feature_bit(bit);
2119 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() };
2123 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2124 /// by [bLIP 2] or if it is a known `T` feature.
2126 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2127 /// be set instead (i.e., `bit - 1`).
2129 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2132 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 {
2133 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_required_custom_bit(bit);
2134 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() };
2138 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2139 /// by [bLIP 2] or if it is a known `T` feature.
2141 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2142 /// set instead (i.e., `bit + 1`).
2144 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2147 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 {
2148 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_optional_custom_bit(bit);
2149 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() };
2153 /// Create a blank Features with no features set
2156 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
2157 let mut ret = lightning::ln::features::NodeFeatures::empty();
2158 crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2161 /// Returns true if this `Features` object contains required features unknown by `other`.
2164 pub extern "C" fn NodeFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::NodeFeatures, other: &crate::lightning::ln::features::NodeFeatures) -> bool {
2165 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2169 /// Returns true if this `Features` object contains unknown feature flags which are set as
2173 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
2174 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2178 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2181 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2182 /// be set instead (i.e., `bit - 1`).
2184 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2187 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 {
2188 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_required_feature_bit(bit);
2189 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() };
2193 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2196 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2197 /// set instead (i.e., `bit + 1`).
2199 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2202 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 {
2203 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_optional_feature_bit(bit);
2204 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() };
2208 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2209 /// by [bLIP 2] or if it is a known `T` feature.
2211 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2212 /// be set instead (i.e., `bit - 1`).
2214 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2217 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 {
2218 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_required_custom_bit(bit);
2219 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() };
2223 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2224 /// by [bLIP 2] or if it is a known `T` feature.
2226 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2227 /// set instead (i.e., `bit + 1`).
2229 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2232 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 {
2233 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_optional_custom_bit(bit);
2234 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() };
2238 /// Create a blank Features with no features set
2241 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
2242 let mut ret = lightning::ln::features::ChannelFeatures::empty();
2243 crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2246 /// Returns true if this `Features` object contains required features unknown by `other`.
2249 pub extern "C" fn ChannelFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelFeatures, other: &crate::lightning::ln::features::ChannelFeatures) -> bool {
2250 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2254 /// Returns true if this `Features` object contains unknown feature flags which are set as
2258 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
2259 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2263 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2266 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2267 /// be set instead (i.e., `bit - 1`).
2269 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2272 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 {
2273 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_required_feature_bit(bit);
2274 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() };
2278 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2281 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2282 /// set instead (i.e., `bit + 1`).
2284 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2287 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 {
2288 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_optional_feature_bit(bit);
2289 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() };
2293 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2294 /// by [bLIP 2] or if it is a known `T` feature.
2296 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2297 /// be set instead (i.e., `bit - 1`).
2299 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2302 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 {
2303 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_required_custom_bit(bit);
2304 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() };
2308 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2309 /// by [bLIP 2] or if it is a known `T` feature.
2311 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2312 /// set instead (i.e., `bit + 1`).
2314 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2317 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 {
2318 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_optional_custom_bit(bit);
2319 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() };
2323 /// Create a blank Features with no features set
2326 pub extern "C" fn Bolt11InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt11InvoiceFeatures {
2327 let mut ret = lightning::ln::features::Bolt11InvoiceFeatures::empty();
2328 crate::lightning::ln::features::Bolt11InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2331 /// Returns true if this `Features` object contains required features unknown by `other`.
2334 pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures, other: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
2335 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2339 /// Returns true if this `Features` object contains unknown feature flags which are set as
2343 pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
2344 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2348 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2351 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2352 /// be set instead (i.e., `bit - 1`).
2354 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2357 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 {
2358 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_required_feature_bit(bit);
2359 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() };
2363 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2366 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2367 /// set instead (i.e., `bit + 1`).
2369 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2372 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 {
2373 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_optional_feature_bit(bit);
2374 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() };
2378 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2379 /// by [bLIP 2] or if it is a known `T` feature.
2381 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2382 /// be set instead (i.e., `bit - 1`).
2384 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2387 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 {
2388 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_required_custom_bit(bit);
2389 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() };
2393 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2394 /// by [bLIP 2] or if it is a known `T` feature.
2396 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2397 /// set instead (i.e., `bit + 1`).
2399 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2402 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 {
2403 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_optional_custom_bit(bit);
2404 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() };
2408 /// Create a blank Features with no features set
2411 pub extern "C" fn OfferFeatures_empty() -> crate::lightning::ln::features::OfferFeatures {
2412 let mut ret = lightning::ln::features::OfferFeatures::empty();
2413 crate::lightning::ln::features::OfferFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2416 /// Returns true if this `Features` object contains required features unknown by `other`.
2419 pub extern "C" fn OfferFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::OfferFeatures, other: &crate::lightning::ln::features::OfferFeatures) -> bool {
2420 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2424 /// Returns true if this `Features` object contains unknown feature flags which are set as
2428 pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::OfferFeatures) -> bool {
2429 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2433 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2436 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2437 /// be set instead (i.e., `bit - 1`).
2439 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2442 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 {
2443 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_required_feature_bit(bit);
2444 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() };
2448 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2451 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2452 /// set instead (i.e., `bit + 1`).
2454 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2457 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 {
2458 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_optional_feature_bit(bit);
2459 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() };
2463 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2464 /// by [bLIP 2] or if it is a known `T` feature.
2466 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2467 /// be set instead (i.e., `bit - 1`).
2469 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2472 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 {
2473 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_required_custom_bit(bit);
2474 let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2478 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2479 /// by [bLIP 2] or if it is a known `T` feature.
2481 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2482 /// set instead (i.e., `bit + 1`).
2484 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2487 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 {
2488 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_optional_custom_bit(bit);
2489 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() };
2493 /// Create a blank Features with no features set
2496 pub extern "C" fn InvoiceRequestFeatures_empty() -> crate::lightning::ln::features::InvoiceRequestFeatures {
2497 let mut ret = lightning::ln::features::InvoiceRequestFeatures::empty();
2498 crate::lightning::ln::features::InvoiceRequestFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2501 /// Returns true if this `Features` object contains required features unknown by `other`.
2504 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures, other: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
2505 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2509 /// Returns true if this `Features` object contains unknown feature flags which are set as
2513 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
2514 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2518 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2521 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2522 /// be set instead (i.e., `bit - 1`).
2524 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2527 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 {
2528 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_required_feature_bit(bit);
2529 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() };
2533 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2536 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2537 /// set instead (i.e., `bit + 1`).
2539 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2542 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 {
2543 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_optional_feature_bit(bit);
2544 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() };
2548 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2549 /// by [bLIP 2] or if it is a known `T` feature.
2551 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2552 /// be set instead (i.e., `bit - 1`).
2554 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2557 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 {
2558 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_required_custom_bit(bit);
2559 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() };
2563 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2564 /// by [bLIP 2] or if it is a known `T` feature.
2566 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2567 /// set instead (i.e., `bit + 1`).
2569 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2572 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 {
2573 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_optional_custom_bit(bit);
2574 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() };
2578 /// Create a blank Features with no features set
2581 pub extern "C" fn Bolt12InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt12InvoiceFeatures {
2582 let mut ret = lightning::ln::features::Bolt12InvoiceFeatures::empty();
2583 crate::lightning::ln::features::Bolt12InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2586 /// Returns true if this `Features` object contains required features unknown by `other`.
2589 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures, other: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2590 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2594 /// Returns true if this `Features` object contains unknown feature flags which are set as
2598 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2599 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2603 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2606 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2607 /// be set instead (i.e., `bit - 1`).
2609 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2612 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 {
2613 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_required_feature_bit(bit);
2614 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() };
2618 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2621 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2622 /// set instead (i.e., `bit + 1`).
2624 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2627 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 {
2628 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_optional_feature_bit(bit);
2629 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() };
2633 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2634 /// by [bLIP 2] or if it is a known `T` feature.
2636 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2637 /// be set instead (i.e., `bit - 1`).
2639 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2642 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 {
2643 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_required_custom_bit(bit);
2644 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() };
2648 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2649 /// by [bLIP 2] or if it is a known `T` feature.
2651 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2652 /// set instead (i.e., `bit + 1`).
2654 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2657 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 {
2658 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_optional_custom_bit(bit);
2659 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() };
2663 /// Create a blank Features with no features set
2666 pub extern "C" fn BlindedHopFeatures_empty() -> crate::lightning::ln::features::BlindedHopFeatures {
2667 let mut ret = lightning::ln::features::BlindedHopFeatures::empty();
2668 crate::lightning::ln::features::BlindedHopFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2671 /// Returns true if this `Features` object contains required features unknown by `other`.
2674 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::BlindedHopFeatures, other: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2675 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2679 /// Returns true if this `Features` object contains unknown feature flags which are set as
2683 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2684 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2688 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2691 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2692 /// be set instead (i.e., `bit - 1`).
2694 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2697 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 {
2698 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_required_feature_bit(bit);
2699 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() };
2703 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2706 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2707 /// set instead (i.e., `bit + 1`).
2709 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2712 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 {
2713 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_optional_feature_bit(bit);
2714 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() };
2718 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2719 /// by [bLIP 2] or if it is a known `T` feature.
2721 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2722 /// be set instead (i.e., `bit - 1`).
2724 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2727 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 {
2728 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_required_custom_bit(bit);
2729 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() };
2733 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2734 /// by [bLIP 2] or if it is a known `T` feature.
2736 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2737 /// set instead (i.e., `bit + 1`).
2739 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2742 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 {
2743 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_optional_custom_bit(bit);
2744 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() };
2748 /// Create a blank Features with no features set
2751 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
2752 let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
2753 crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2756 /// Returns true if this `Features` object contains required features unknown by `other`.
2759 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures, other: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2760 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2764 /// Returns true if this `Features` object contains unknown feature flags which are set as
2768 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2769 let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2773 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2776 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2777 /// be set instead (i.e., `bit - 1`).
2779 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2782 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 {
2783 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_required_feature_bit(bit);
2784 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() };
2788 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2791 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2792 /// set instead (i.e., `bit + 1`).
2794 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2797 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 {
2798 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_optional_feature_bit(bit);
2799 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() };
2803 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2804 /// by [bLIP 2] or if it is a known `T` feature.
2806 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2807 /// be set instead (i.e., `bit - 1`).
2809 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2812 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 {
2813 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_required_custom_bit(bit);
2814 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() };
2818 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2819 /// by [bLIP 2] or if it is a known `T` feature.
2821 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2822 /// set instead (i.e., `bit + 1`).
2824 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2827 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 {
2828 let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_optional_custom_bit(bit);
2829 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() };
2834 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
2835 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
2836 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2839 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2840 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
2843 /// Read a InitFeatures from a byte array, created by InitFeatures_write
2844 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
2845 let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2846 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() };
2850 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
2851 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
2852 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2855 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2856 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
2859 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
2860 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
2861 let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2862 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() };
2866 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
2867 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
2868 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2871 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2872 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
2875 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
2876 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
2877 let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2878 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() };
2882 /// Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
2883 pub extern "C" fn Bolt11InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
2884 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2887 pub(crate) extern "C" fn Bolt11InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2888 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt11InvoiceFeatures) })
2891 /// Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
2892 pub extern "C" fn Bolt11InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_Bolt11InvoiceFeaturesDecodeErrorZ {
2893 let res: Result<lightning::ln::features::Bolt11InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2894 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() };
2898 /// Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
2899 pub extern "C" fn Bolt12InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
2900 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2903 pub(crate) extern "C" fn Bolt12InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2904 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt12InvoiceFeatures) })
2907 /// Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
2908 pub extern "C" fn Bolt12InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_Bolt12InvoiceFeaturesDecodeErrorZ {
2909 let res: Result<lightning::ln::features::Bolt12InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2910 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() };
2914 /// Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
2915 pub extern "C" fn BlindedHopFeatures_write(obj: &crate::lightning::ln::features::BlindedHopFeatures) -> crate::c_types::derived::CVec_u8Z {
2916 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2919 pub(crate) extern "C" fn BlindedHopFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2920 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedHopFeatures) })
2923 /// Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
2924 pub extern "C" fn BlindedHopFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_BlindedHopFeaturesDecodeErrorZ {
2925 let res: Result<lightning::ln::features::BlindedHopFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2926 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() };
2930 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
2931 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
2932 crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2935 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2936 crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
2939 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
2940 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
2941 let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2942 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() };