Update auto-generated bindings for LDK 0.0.115
[ldk-c-bindings] / lightning-c-bindings / src / lightning / ln / features.rs
1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
3 //
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.
8
9 //! Feature flag definitions for the Lightning protocol according to [BOLT #9].
10 //!
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).
15 //!
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.
20 //!
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).
26 //!
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
52 //!      onion.
53 //!      (see [BOLT-11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) for
54 //!      more).
55 //! - `ZeroConf` - supports accepting HTLCs and using channels prior to funding confirmation
56 //!      (see
57 //!      [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message)
58 //!      for more info).
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
64 //!     information).
65 //!
66 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
67 //! [messages]: crate::ln::msgs
68
69 use alloc::str::FromStr;
70 use core::ffi::c_void;
71 use core::convert::Infallible;
72 use bitcoin::hashes::Hash;
73 use crate::c_types::*;
74 #[cfg(feature="no-std")]
75 use alloc::{vec::Vec, boxed::Box};
76
77 mod sealed {
78
79 use alloc::str::FromStr;
80 use core::ffi::c_void;
81 use core::convert::Infallible;
82 use bitcoin::hashes::Hash;
83 use crate::c_types::*;
84 #[cfg(feature="no-std")]
85 use alloc::{vec::Vec, boxed::Box};
86
87 /// Set this feature as optional.
88 #[no_mangle]
89 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
90         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_optional()
91 }
92
93 /// Set this feature as required.
94 #[no_mangle]
95 pub extern "C" fn InitFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
96         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_required()
97 }
98
99 /// Checks if this feature is supported.
100 #[must_use]
101 #[no_mangle]
102 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
103         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
104         ret
105 }
106
107 /// Set this feature as optional.
108 #[no_mangle]
109 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
110         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_optional()
111 }
112
113 /// Set this feature as required.
114 #[no_mangle]
115 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
116         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_required()
117 }
118
119 /// Checks if this feature is supported.
120 #[must_use]
121 #[no_mangle]
122 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
123         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
124         ret
125 }
126
127 /// Checks if this feature is required.
128 #[must_use]
129 #[no_mangle]
130 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
131         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
132         ret
133 }
134
135 /// Checks if this feature is required.
136 #[must_use]
137 #[no_mangle]
138 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
139         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
140         ret
141 }
142
143 /// Set this feature as optional.
144 #[no_mangle]
145 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
146         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_optional()
147 }
148
149 /// Set this feature as required.
150 #[no_mangle]
151 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
152         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_required()
153 }
154
155 /// Checks if this feature is supported.
156 #[must_use]
157 #[no_mangle]
158 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
159         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
160         ret
161 }
162
163 /// Set this feature as optional.
164 #[no_mangle]
165 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
166         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_optional()
167 }
168
169 /// Set this feature as required.
170 #[no_mangle]
171 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
172         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_required()
173 }
174
175 /// Checks if this feature is supported.
176 #[must_use]
177 #[no_mangle]
178 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
179         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
180         ret
181 }
182
183 /// Set this feature as optional.
184 #[no_mangle]
185 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
186         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_optional()
187 }
188
189 /// Set this feature as required.
190 #[no_mangle]
191 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
192         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_required()
193 }
194
195 /// Checks if this feature is supported.
196 #[must_use]
197 #[no_mangle]
198 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
199         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
200         ret
201 }
202
203 /// Checks if this feature is required.
204 #[must_use]
205 #[no_mangle]
206 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
207         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
208         ret
209 }
210
211 /// Checks if this feature is required.
212 #[must_use]
213 #[no_mangle]
214 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
215         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
216         ret
217 }
218
219 /// Set this feature as optional.
220 #[no_mangle]
221 pub extern "C" fn InitFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
222         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_optional()
223 }
224
225 /// Set this feature as required.
226 #[no_mangle]
227 pub extern "C" fn InitFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
228         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_required()
229 }
230
231 /// Checks if this feature is supported.
232 #[must_use]
233 #[no_mangle]
234 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
235         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
236         ret
237 }
238
239 /// Set this feature as optional.
240 #[no_mangle]
241 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
242         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_optional()
243 }
244
245 /// Set this feature as required.
246 #[no_mangle]
247 pub extern "C" fn NodeFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
248         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_required()
249 }
250
251 /// Checks if this feature is supported.
252 #[must_use]
253 #[no_mangle]
254 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
255         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
256         ret
257 }
258
259 /// Checks if this feature is required.
260 #[must_use]
261 #[no_mangle]
262 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
263         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
264         ret
265 }
266
267 /// Checks if this feature is required.
268 #[must_use]
269 #[no_mangle]
270 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
271         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
272         ret
273 }
274
275 /// Set this feature as optional.
276 #[no_mangle]
277 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
278         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_optional()
279 }
280
281 /// Set this feature as required.
282 #[no_mangle]
283 pub extern "C" fn InitFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
284         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_required()
285 }
286
287 /// Checks if this feature is supported.
288 #[must_use]
289 #[no_mangle]
290 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
291         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
292         ret
293 }
294
295 /// Set this feature as optional.
296 #[no_mangle]
297 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
298         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_optional()
299 }
300
301 /// Set this feature as required.
302 #[no_mangle]
303 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
304         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_required()
305 }
306
307 /// Checks if this feature is supported.
308 #[must_use]
309 #[no_mangle]
310 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
311         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
312         ret
313 }
314
315 /// Set this feature as optional.
316 #[no_mangle]
317 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
318         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_optional()
319 }
320
321 /// Set this feature as required.
322 #[no_mangle]
323 pub extern "C" fn InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
324         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_variable_length_onion_required()
325 }
326
327 /// Checks if this feature is supported.
328 #[must_use]
329 #[no_mangle]
330 pub extern "C" fn InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
331         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
332         ret
333 }
334
335 /// Checks if this feature is required.
336 #[must_use]
337 #[no_mangle]
338 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
339         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
340         ret
341 }
342
343 /// Checks if this feature is required.
344 #[must_use]
345 #[no_mangle]
346 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
347         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
348         ret
349 }
350
351 /// Checks if this feature is required.
352 #[must_use]
353 #[no_mangle]
354 pub extern "C" fn InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
355         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
356         ret
357 }
358
359 /// Set this feature as optional.
360 #[no_mangle]
361 pub extern "C" fn InitFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
362         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_optional()
363 }
364
365 /// Set this feature as required.
366 #[no_mangle]
367 pub extern "C" fn InitFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
368         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_required()
369 }
370
371 /// Checks if this feature is supported.
372 #[must_use]
373 #[no_mangle]
374 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
375         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
376         ret
377 }
378
379 /// Set this feature as optional.
380 #[no_mangle]
381 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
382         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_optional()
383 }
384
385 /// Set this feature as required.
386 #[no_mangle]
387 pub extern "C" fn NodeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
388         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_required()
389 }
390
391 /// Checks if this feature is supported.
392 #[must_use]
393 #[no_mangle]
394 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
395         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
396         ret
397 }
398
399 /// Set this feature as optional.
400 #[no_mangle]
401 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
402         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_optional()
403 }
404
405 /// Set this feature as required.
406 #[no_mangle]
407 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
408         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_required()
409 }
410
411 /// Checks if this feature is supported.
412 #[must_use]
413 #[no_mangle]
414 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
415         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
416         ret
417 }
418
419 /// Checks if this feature is required.
420 #[must_use]
421 #[no_mangle]
422 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
423         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
424         ret
425 }
426
427 /// Checks if this feature is required.
428 #[must_use]
429 #[no_mangle]
430 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
431         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
432         ret
433 }
434
435 /// Checks if this feature is required.
436 #[must_use]
437 #[no_mangle]
438 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
439         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
440         ret
441 }
442
443 /// Set this feature as optional.
444 #[no_mangle]
445 pub extern "C" fn InitFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
446         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_optional()
447 }
448
449 /// Set this feature as required.
450 #[no_mangle]
451 pub extern "C" fn InitFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
452         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_required()
453 }
454
455 /// Checks if this feature is supported.
456 #[must_use]
457 #[no_mangle]
458 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
459         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
460         ret
461 }
462
463 /// Set this feature as optional.
464 #[no_mangle]
465 pub extern "C" fn NodeFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
466         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_optional()
467 }
468
469 /// Set this feature as required.
470 #[no_mangle]
471 pub extern "C" fn NodeFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
472         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_required()
473 }
474
475 /// Checks if this feature is supported.
476 #[must_use]
477 #[no_mangle]
478 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
479         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
480         ret
481 }
482
483 /// Set this feature as optional.
484 #[no_mangle]
485 pub extern "C" fn InvoiceFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
486         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_optional()
487 }
488
489 /// Set this feature as required.
490 #[no_mangle]
491 pub extern "C" fn InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
492         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_secret_required()
493 }
494
495 /// Checks if this feature is supported.
496 #[must_use]
497 #[no_mangle]
498 pub extern "C" fn InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
499         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
500         ret
501 }
502
503 /// Checks if this feature is required.
504 #[must_use]
505 #[no_mangle]
506 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
507         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
508         ret
509 }
510
511 /// Checks if this feature is required.
512 #[must_use]
513 #[no_mangle]
514 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
515         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
516         ret
517 }
518
519 /// Checks if this feature is required.
520 #[must_use]
521 #[no_mangle]
522 pub extern "C" fn InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
523         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
524         ret
525 }
526
527 /// Set this feature as optional.
528 #[no_mangle]
529 pub extern "C" fn InitFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
530         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_optional()
531 }
532
533 /// Set this feature as required.
534 #[no_mangle]
535 pub extern "C" fn InitFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
536         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_required()
537 }
538
539 /// Checks if this feature is supported.
540 #[must_use]
541 #[no_mangle]
542 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
543         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
544         ret
545 }
546
547 /// Set this feature as optional.
548 #[no_mangle]
549 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
550         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_optional()
551 }
552
553 /// Set this feature as required.
554 #[no_mangle]
555 pub extern "C" fn NodeFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
556         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_required()
557 }
558
559 /// Checks if this feature is supported.
560 #[must_use]
561 #[no_mangle]
562 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
563         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
564         ret
565 }
566
567 /// Set this feature as optional.
568 #[no_mangle]
569 pub extern "C" fn InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
570         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_optional()
571 }
572
573 /// Set this feature as required.
574 #[no_mangle]
575 pub extern "C" fn InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
576         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_basic_mpp_required()
577 }
578
579 /// Checks if this feature is supported.
580 #[must_use]
581 #[no_mangle]
582 pub extern "C" fn InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
583         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
584         ret
585 }
586
587 /// Set this feature as optional.
588 #[no_mangle]
589 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
590         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_optional()
591 }
592
593 /// Set this feature as required.
594 #[no_mangle]
595 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
596         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_required()
597 }
598
599 /// Checks if this feature is supported.
600 #[must_use]
601 #[no_mangle]
602 pub extern "C" fn Bolt12InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
603         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
604         ret
605 }
606
607 /// Checks if this feature is required.
608 #[must_use]
609 #[no_mangle]
610 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
611         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
612         ret
613 }
614
615 /// Checks if this feature is required.
616 #[must_use]
617 #[no_mangle]
618 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
619         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
620         ret
621 }
622
623 /// Checks if this feature is required.
624 #[must_use]
625 #[no_mangle]
626 pub extern "C" fn InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
627         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
628         ret
629 }
630
631 /// Checks if this feature is required.
632 #[must_use]
633 #[no_mangle]
634 pub extern "C" fn Bolt12InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
635         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
636         ret
637 }
638
639 /// Set this feature as optional.
640 #[no_mangle]
641 pub extern "C" fn InitFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
642         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_optional()
643 }
644
645 /// Set this feature as required.
646 #[no_mangle]
647 pub extern "C" fn InitFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
648         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_required()
649 }
650
651 /// Checks if this feature is supported.
652 #[must_use]
653 #[no_mangle]
654 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
655         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
656         ret
657 }
658
659 /// Set this feature as optional.
660 #[no_mangle]
661 pub extern "C" fn NodeFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
662         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_optional()
663 }
664
665 /// Set this feature as required.
666 #[no_mangle]
667 pub extern "C" fn NodeFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
668         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_required()
669 }
670
671 /// Checks if this feature is supported.
672 #[must_use]
673 #[no_mangle]
674 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
675         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
676         ret
677 }
678
679 /// Checks if this feature is required.
680 #[must_use]
681 #[no_mangle]
682 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
683         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
684         ret
685 }
686
687 /// Checks if this feature is required.
688 #[must_use]
689 #[no_mangle]
690 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
691         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
692         ret
693 }
694
695 /// Set this feature as optional.
696 #[no_mangle]
697 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
698         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
699 }
700
701 /// Set this feature as required.
702 #[no_mangle]
703 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
704         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
705 }
706
707 /// Checks if this feature is supported.
708 #[must_use]
709 #[no_mangle]
710 pub extern "C" fn InitFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
711         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
712         ret
713 }
714
715 /// Set this feature as optional.
716 #[no_mangle]
717 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
718         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
719 }
720
721 /// Set this feature as required.
722 #[no_mangle]
723 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
724         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
725 }
726
727 /// Checks if this feature is supported.
728 #[must_use]
729 #[no_mangle]
730 pub extern "C" fn NodeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
731         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
732         ret
733 }
734
735 /// Set this feature as optional.
736 #[no_mangle]
737 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
738         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
739 }
740
741 /// Set this feature as required.
742 #[no_mangle]
743 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
744         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
745 }
746
747 /// Checks if this feature is supported.
748 #[must_use]
749 #[no_mangle]
750 pub extern "C" fn ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
751         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
752         ret
753 }
754
755 /// Checks if this feature is required.
756 #[must_use]
757 #[no_mangle]
758 pub extern "C" fn InitFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
759         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
760         ret
761 }
762
763 /// Checks if this feature is required.
764 #[must_use]
765 #[no_mangle]
766 pub extern "C" fn NodeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
767         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
768         ret
769 }
770
771 /// Checks if this feature is required.
772 #[must_use]
773 #[no_mangle]
774 pub extern "C" fn ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
775         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
776         ret
777 }
778
779 /// Set this feature as optional.
780 #[no_mangle]
781 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
782         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_optional()
783 }
784
785 /// Set this feature as required.
786 #[no_mangle]
787 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
788         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_required()
789 }
790
791 /// Checks if this feature is supported.
792 #[must_use]
793 #[no_mangle]
794 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
795         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
796         ret
797 }
798
799 /// Set this feature as optional.
800 #[no_mangle]
801 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
802         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_optional()
803 }
804
805 /// Set this feature as required.
806 #[no_mangle]
807 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
808         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_required()
809 }
810
811 /// Checks if this feature is supported.
812 #[must_use]
813 #[no_mangle]
814 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
815         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
816         ret
817 }
818
819 /// Checks if this feature is required.
820 #[must_use]
821 #[no_mangle]
822 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
823         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
824         ret
825 }
826
827 /// Checks if this feature is required.
828 #[must_use]
829 #[no_mangle]
830 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
831         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
832         ret
833 }
834
835 /// Set this feature as optional.
836 #[no_mangle]
837 pub extern "C" fn InitFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
838         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_optional()
839 }
840
841 /// Set this feature as required.
842 #[no_mangle]
843 pub extern "C" fn InitFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
844         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_required()
845 }
846
847 /// Checks if this feature is supported.
848 #[must_use]
849 #[no_mangle]
850 pub extern "C" fn InitFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
851         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
852         ret
853 }
854
855 /// Set this feature as optional.
856 #[no_mangle]
857 pub extern "C" fn NodeFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
858         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_optional()
859 }
860
861 /// Set this feature as required.
862 #[no_mangle]
863 pub extern "C" fn NodeFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
864         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_required()
865 }
866
867 /// Checks if this feature is supported.
868 #[must_use]
869 #[no_mangle]
870 pub extern "C" fn NodeFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
871         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
872         ret
873 }
874
875 /// Checks if this feature is required.
876 #[must_use]
877 #[no_mangle]
878 pub extern "C" fn InitFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
879         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
880         ret
881 }
882
883 /// Checks if this feature is required.
884 #[must_use]
885 #[no_mangle]
886 pub extern "C" fn NodeFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
887         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
888         ret
889 }
890
891 /// Set this feature as optional.
892 #[no_mangle]
893 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
894         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
895 }
896
897 /// Set this feature as required.
898 #[no_mangle]
899 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
900         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
901 }
902
903 /// Checks if this feature is supported.
904 #[must_use]
905 #[no_mangle]
906 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
907         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
908         ret
909 }
910
911 /// Set this feature as optional.
912 #[no_mangle]
913 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
914         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
915 }
916
917 /// Set this feature as required.
918 #[no_mangle]
919 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
920         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
921 }
922
923 /// Checks if this feature is supported.
924 #[must_use]
925 #[no_mangle]
926 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
927         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
928         ret
929 }
930
931 /// Checks if this feature is required.
932 #[must_use]
933 #[no_mangle]
934 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
935         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
936         ret
937 }
938
939 /// Checks if this feature is required.
940 #[must_use]
941 #[no_mangle]
942 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
943         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
944         ret
945 }
946
947 /// Set this feature as optional.
948 #[no_mangle]
949 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
950         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
951 }
952
953 /// Set this feature as required.
954 #[no_mangle]
955 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
956         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
957 }
958
959 /// Checks if this feature is supported.
960 #[must_use]
961 #[no_mangle]
962 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
963         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
964         ret
965 }
966
967 /// Set this feature as optional.
968 #[no_mangle]
969 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
970         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
971 }
972
973 /// Set this feature as required.
974 #[no_mangle]
975 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
976         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
977 }
978
979 /// Checks if this feature is supported.
980 #[must_use]
981 #[no_mangle]
982 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
983         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
984         ret
985 }
986
987 /// Set this feature as optional.
988 #[no_mangle]
989 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
990         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
991 }
992
993 /// Set this feature as required.
994 #[no_mangle]
995 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
996         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
997 }
998
999 /// Checks if this feature is supported.
1000 #[must_use]
1001 #[no_mangle]
1002 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1003         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1004         ret
1005 }
1006
1007 /// Checks if this feature is required.
1008 #[must_use]
1009 #[no_mangle]
1010 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1011         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1012         ret
1013 }
1014
1015 /// Checks if this feature is required.
1016 #[must_use]
1017 #[no_mangle]
1018 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1019         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1020         ret
1021 }
1022
1023 /// Checks if this feature is required.
1024 #[must_use]
1025 #[no_mangle]
1026 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1027         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1028         ret
1029 }
1030
1031 /// Set this feature as optional.
1032 #[no_mangle]
1033 pub extern "C" fn InvoiceFeatures_set_payment_metadata_optional(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
1034         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_metadata_optional()
1035 }
1036
1037 /// Set this feature as required.
1038 #[no_mangle]
1039 pub extern "C" fn InvoiceFeatures_set_payment_metadata_required(this_arg: &mut crate::lightning::ln::features::InvoiceFeatures) {
1040         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceFeatures)) }.set_payment_metadata_required()
1041 }
1042
1043 /// Checks if this feature is supported.
1044 #[must_use]
1045 #[no_mangle]
1046 pub extern "C" fn InvoiceFeatures_supports_payment_metadata(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1047         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_metadata();
1048         ret
1049 }
1050
1051 /// Checks if this feature is required.
1052 #[must_use]
1053 #[no_mangle]
1054 pub extern "C" fn InvoiceFeatures_requires_payment_metadata(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1055         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_metadata();
1056         ret
1057 }
1058
1059 /// Set this feature as optional.
1060 #[no_mangle]
1061 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1062         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
1063 }
1064
1065 /// Set this feature as required.
1066 #[no_mangle]
1067 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1068         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
1069 }
1070
1071 /// Checks if this feature is supported.
1072 #[must_use]
1073 #[no_mangle]
1074 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1075         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1076         ret
1077 }
1078
1079 /// Set this feature as optional.
1080 #[no_mangle]
1081 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1082         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
1083 }
1084
1085 /// Set this feature as required.
1086 #[no_mangle]
1087 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1088         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
1089 }
1090
1091 /// Checks if this feature is supported.
1092 #[must_use]
1093 #[no_mangle]
1094 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1095         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1096         ret
1097 }
1098
1099 /// Set this feature as optional.
1100 #[no_mangle]
1101 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1102         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
1103 }
1104
1105 /// Set this feature as required.
1106 #[no_mangle]
1107 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1108         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
1109 }
1110
1111 /// Checks if this feature is supported.
1112 #[must_use]
1113 #[no_mangle]
1114 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1115         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1116         ret
1117 }
1118
1119 /// Checks if this feature is required.
1120 #[must_use]
1121 #[no_mangle]
1122 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1123         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1124         ret
1125 }
1126
1127 /// Checks if this feature is required.
1128 #[must_use]
1129 #[no_mangle]
1130 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1131         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1132         ret
1133 }
1134
1135 /// Checks if this feature is required.
1136 #[must_use]
1137 #[no_mangle]
1138 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1139         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1140         ret
1141 }
1142
1143 /// Set this feature as optional.
1144 #[no_mangle]
1145 pub extern "C" fn NodeFeatures_set_keysend_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1146         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_optional()
1147 }
1148
1149 /// Set this feature as required.
1150 #[no_mangle]
1151 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1152         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
1153 }
1154
1155 /// Checks if this feature is supported.
1156 #[must_use]
1157 #[no_mangle]
1158 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1159         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
1160         ret
1161 }
1162
1163 /// Checks if this feature is required.
1164 #[must_use]
1165 #[no_mangle]
1166 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1167         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
1168         ret
1169 }
1170
1171 }
1172 /// Checks if two InitFeaturess contain equal inner contents.
1173 /// This ignores pointers and is_owned flags and looks at the values in fields.
1174 /// Two objects with NULL inner values will be considered "equal" here.
1175 #[no_mangle]
1176 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
1177         if a.inner == b.inner { return true; }
1178         if a.inner.is_null() || b.inner.is_null() { return false; }
1179         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1180 }
1181 /// Checks if two NodeFeaturess contain equal inner contents.
1182 /// This ignores pointers and is_owned flags and looks at the values in fields.
1183 /// Two objects with NULL inner values will be considered "equal" here.
1184 #[no_mangle]
1185 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
1186         if a.inner == b.inner { return true; }
1187         if a.inner.is_null() || b.inner.is_null() { return false; }
1188         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1189 }
1190 /// Checks if two ChannelFeaturess contain equal inner contents.
1191 /// This ignores pointers and is_owned flags and looks at the values in fields.
1192 /// Two objects with NULL inner values will be considered "equal" here.
1193 #[no_mangle]
1194 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
1195         if a.inner == b.inner { return true; }
1196         if a.inner.is_null() || b.inner.is_null() { return false; }
1197         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1198 }
1199 /// Checks if two InvoiceFeaturess contain equal inner contents.
1200 /// This ignores pointers and is_owned flags and looks at the values in fields.
1201 /// Two objects with NULL inner values will be considered "equal" here.
1202 #[no_mangle]
1203 pub extern "C" fn InvoiceFeatures_eq(a: &InvoiceFeatures, b: &InvoiceFeatures) -> bool {
1204         if a.inner == b.inner { return true; }
1205         if a.inner.is_null() || b.inner.is_null() { return false; }
1206         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1207 }
1208 /// Checks if two OfferFeaturess contain equal inner contents.
1209 /// This ignores pointers and is_owned flags and looks at the values in fields.
1210 /// Two objects with NULL inner values will be considered "equal" here.
1211 #[no_mangle]
1212 pub extern "C" fn OfferFeatures_eq(a: &OfferFeatures, b: &OfferFeatures) -> bool {
1213         if a.inner == b.inner { return true; }
1214         if a.inner.is_null() || b.inner.is_null() { return false; }
1215         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1216 }
1217 /// Checks if two InvoiceRequestFeaturess contain equal inner contents.
1218 /// This ignores pointers and is_owned flags and looks at the values in fields.
1219 /// Two objects with NULL inner values will be considered "equal" here.
1220 #[no_mangle]
1221 pub extern "C" fn InvoiceRequestFeatures_eq(a: &InvoiceRequestFeatures, b: &InvoiceRequestFeatures) -> bool {
1222         if a.inner == b.inner { return true; }
1223         if a.inner.is_null() || b.inner.is_null() { return false; }
1224         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1225 }
1226 /// Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
1227 /// This ignores pointers and is_owned flags and looks at the values in fields.
1228 /// Two objects with NULL inner values will be considered "equal" here.
1229 #[no_mangle]
1230 pub extern "C" fn Bolt12InvoiceFeatures_eq(a: &Bolt12InvoiceFeatures, b: &Bolt12InvoiceFeatures) -> bool {
1231         if a.inner == b.inner { return true; }
1232         if a.inner.is_null() || b.inner.is_null() { return false; }
1233         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1234 }
1235 /// Checks if two BlindedHopFeaturess contain equal inner contents.
1236 /// This ignores pointers and is_owned flags and looks at the values in fields.
1237 /// Two objects with NULL inner values will be considered "equal" here.
1238 #[no_mangle]
1239 pub extern "C" fn BlindedHopFeatures_eq(a: &BlindedHopFeatures, b: &BlindedHopFeatures) -> bool {
1240         if a.inner == b.inner { return true; }
1241         if a.inner.is_null() || b.inner.is_null() { return false; }
1242         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1243 }
1244 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
1245 /// This ignores pointers and is_owned flags and looks at the values in fields.
1246 /// Two objects with NULL inner values will be considered "equal" here.
1247 #[no_mangle]
1248 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
1249         if a.inner == b.inner { return true; }
1250         if a.inner.is_null() || b.inner.is_null() { return false; }
1251         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1252 }
1253 impl Clone for InitFeatures {
1254         fn clone(&self) -> Self {
1255                 Self {
1256                         inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1257                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1258                         is_owned: true,
1259                 }
1260         }
1261 }
1262 #[allow(unused)]
1263 /// Used only if an object of this type is returned as a trait impl by a method
1264 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1265         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
1266 }
1267 #[no_mangle]
1268 /// Creates a copy of the InitFeatures
1269 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1270         orig.clone()
1271 }
1272 impl Clone for NodeFeatures {
1273         fn clone(&self) -> Self {
1274                 Self {
1275                         inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1276                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1277                         is_owned: true,
1278                 }
1279         }
1280 }
1281 #[allow(unused)]
1282 /// Used only if an object of this type is returned as a trait impl by a method
1283 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1284         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
1285 }
1286 #[no_mangle]
1287 /// Creates a copy of the NodeFeatures
1288 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1289         orig.clone()
1290 }
1291 impl Clone for ChannelFeatures {
1292         fn clone(&self) -> Self {
1293                 Self {
1294                         inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1295                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1296                         is_owned: true,
1297                 }
1298         }
1299 }
1300 #[allow(unused)]
1301 /// Used only if an object of this type is returned as a trait impl by a method
1302 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1303         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
1304 }
1305 #[no_mangle]
1306 /// Creates a copy of the ChannelFeatures
1307 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1308         orig.clone()
1309 }
1310 impl Clone for InvoiceFeatures {
1311         fn clone(&self) -> Self {
1312                 Self {
1313                         inner: if <*mut nativeInvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1314                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1315                         is_owned: true,
1316                 }
1317         }
1318 }
1319 #[allow(unused)]
1320 /// Used only if an object of this type is returned as a trait impl by a method
1321 pub(crate) extern "C" fn InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1322         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceFeatures)).clone() })) as *mut c_void
1323 }
1324 #[no_mangle]
1325 /// Creates a copy of the InvoiceFeatures
1326 pub extern "C" fn InvoiceFeatures_clone(orig: &InvoiceFeatures) -> InvoiceFeatures {
1327         orig.clone()
1328 }
1329 impl Clone for OfferFeatures {
1330         fn clone(&self) -> Self {
1331                 Self {
1332                         inner: if <*mut nativeOfferFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1333                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1334                         is_owned: true,
1335                 }
1336         }
1337 }
1338 #[allow(unused)]
1339 /// Used only if an object of this type is returned as a trait impl by a method
1340 pub(crate) extern "C" fn OfferFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1341         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOfferFeatures)).clone() })) as *mut c_void
1342 }
1343 #[no_mangle]
1344 /// Creates a copy of the OfferFeatures
1345 pub extern "C" fn OfferFeatures_clone(orig: &OfferFeatures) -> OfferFeatures {
1346         orig.clone()
1347 }
1348 impl Clone for InvoiceRequestFeatures {
1349         fn clone(&self) -> Self {
1350                 Self {
1351                         inner: if <*mut nativeInvoiceRequestFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1352                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1353                         is_owned: true,
1354                 }
1355         }
1356 }
1357 #[allow(unused)]
1358 /// Used only if an object of this type is returned as a trait impl by a method
1359 pub(crate) extern "C" fn InvoiceRequestFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1360         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
1361 }
1362 #[no_mangle]
1363 /// Creates a copy of the InvoiceRequestFeatures
1364 pub extern "C" fn InvoiceRequestFeatures_clone(orig: &InvoiceRequestFeatures) -> InvoiceRequestFeatures {
1365         orig.clone()
1366 }
1367 impl Clone for Bolt12InvoiceFeatures {
1368         fn clone(&self) -> Self {
1369                 Self {
1370                         inner: if <*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1371                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1372                         is_owned: true,
1373                 }
1374         }
1375 }
1376 #[allow(unused)]
1377 /// Used only if an object of this type is returned as a trait impl by a method
1378 pub(crate) extern "C" fn Bolt12InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1379         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt12InvoiceFeatures)).clone() })) as *mut c_void
1380 }
1381 #[no_mangle]
1382 /// Creates a copy of the Bolt12InvoiceFeatures
1383 pub extern "C" fn Bolt12InvoiceFeatures_clone(orig: &Bolt12InvoiceFeatures) -> Bolt12InvoiceFeatures {
1384         orig.clone()
1385 }
1386 impl Clone for BlindedHopFeatures {
1387         fn clone(&self) -> Self {
1388                 Self {
1389                         inner: if <*mut nativeBlindedHopFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1390                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1391                         is_owned: true,
1392                 }
1393         }
1394 }
1395 #[allow(unused)]
1396 /// Used only if an object of this type is returned as a trait impl by a method
1397 pub(crate) extern "C" fn BlindedHopFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1398         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBlindedHopFeatures)).clone() })) as *mut c_void
1399 }
1400 #[no_mangle]
1401 /// Creates a copy of the BlindedHopFeatures
1402 pub extern "C" fn BlindedHopFeatures_clone(orig: &BlindedHopFeatures) -> BlindedHopFeatures {
1403         orig.clone()
1404 }
1405 impl Clone for ChannelTypeFeatures {
1406         fn clone(&self) -> Self {
1407                 Self {
1408                         inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1409                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1410                         is_owned: true,
1411                 }
1412         }
1413 }
1414 #[allow(unused)]
1415 /// Used only if an object of this type is returned as a trait impl by a method
1416 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1417         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
1418 }
1419 #[no_mangle]
1420 /// Creates a copy of the ChannelTypeFeatures
1421 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1422         orig.clone()
1423 }
1424
1425 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1426 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1427
1428 /// Features used within an `init` message.
1429 #[must_use]
1430 #[repr(C)]
1431 pub struct InitFeatures {
1432         /// A pointer to the opaque Rust object.
1433
1434         /// Nearly everywhere, inner must be non-null, however in places where
1435         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1436         pub inner: *mut nativeInitFeatures,
1437         /// Indicates that this is the only struct which contains the same pointer.
1438
1439         /// Rust functions which take ownership of an object provided via an argument require
1440         /// this to be true and invalidate the object pointed to by inner.
1441         pub is_owned: bool,
1442 }
1443
1444 impl Drop for InitFeatures {
1445         fn drop(&mut self) {
1446                 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1447                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1448                 }
1449         }
1450 }
1451 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1452 #[no_mangle]
1453 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1454 #[allow(unused)]
1455 /// Used only if an object of this type is returned as a trait impl by a method
1456 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1457         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInitFeatures) };
1458 }
1459 #[allow(unused)]
1460 impl InitFeatures {
1461         pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1462                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1463         }
1464         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1465                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1466         }
1467         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1468         pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1469                 assert!(self.is_owned);
1470                 let ret = ObjOps::untweak_ptr(self.inner);
1471                 self.inner = core::ptr::null_mut();
1472                 ret
1473         }
1474 }
1475
1476 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1477 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1478
1479 /// Features used within a `node_announcement` message.
1480 #[must_use]
1481 #[repr(C)]
1482 pub struct NodeFeatures {
1483         /// A pointer to the opaque Rust object.
1484
1485         /// Nearly everywhere, inner must be non-null, however in places where
1486         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1487         pub inner: *mut nativeNodeFeatures,
1488         /// Indicates that this is the only struct which contains the same pointer.
1489
1490         /// Rust functions which take ownership of an object provided via an argument require
1491         /// this to be true and invalidate the object pointed to by inner.
1492         pub is_owned: bool,
1493 }
1494
1495 impl Drop for NodeFeatures {
1496         fn drop(&mut self) {
1497                 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1498                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1499                 }
1500         }
1501 }
1502 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1503 #[no_mangle]
1504 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1505 #[allow(unused)]
1506 /// Used only if an object of this type is returned as a trait impl by a method
1507 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1508         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeNodeFeatures) };
1509 }
1510 #[allow(unused)]
1511 impl NodeFeatures {
1512         pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1513                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1514         }
1515         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1516                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1517         }
1518         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1519         pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1520                 assert!(self.is_owned);
1521                 let ret = ObjOps::untweak_ptr(self.inner);
1522                 self.inner = core::ptr::null_mut();
1523                 ret
1524         }
1525 }
1526
1527 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1528 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1529
1530 /// Features used within a `channel_announcement` message.
1531 #[must_use]
1532 #[repr(C)]
1533 pub struct ChannelFeatures {
1534         /// A pointer to the opaque Rust object.
1535
1536         /// Nearly everywhere, inner must be non-null, however in places where
1537         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1538         pub inner: *mut nativeChannelFeatures,
1539         /// Indicates that this is the only struct which contains the same pointer.
1540
1541         /// Rust functions which take ownership of an object provided via an argument require
1542         /// this to be true and invalidate the object pointed to by inner.
1543         pub is_owned: bool,
1544 }
1545
1546 impl Drop for ChannelFeatures {
1547         fn drop(&mut self) {
1548                 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1549                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1550                 }
1551         }
1552 }
1553 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1554 #[no_mangle]
1555 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1556 #[allow(unused)]
1557 /// Used only if an object of this type is returned as a trait impl by a method
1558 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1559         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelFeatures) };
1560 }
1561 #[allow(unused)]
1562 impl ChannelFeatures {
1563         pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1564                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1565         }
1566         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1567                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1568         }
1569         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1570         pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1571                 assert!(self.is_owned);
1572                 let ret = ObjOps::untweak_ptr(self.inner);
1573                 self.inner = core::ptr::null_mut();
1574                 ret
1575         }
1576 }
1577
1578 use lightning::ln::features::InvoiceFeatures as nativeInvoiceFeaturesImport;
1579 pub(crate) type nativeInvoiceFeatures = nativeInvoiceFeaturesImport;
1580
1581 /// Features used within an invoice.
1582 #[must_use]
1583 #[repr(C)]
1584 pub struct InvoiceFeatures {
1585         /// A pointer to the opaque Rust object.
1586
1587         /// Nearly everywhere, inner must be non-null, however in places where
1588         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1589         pub inner: *mut nativeInvoiceFeatures,
1590         /// Indicates that this is the only struct which contains the same pointer.
1591
1592         /// Rust functions which take ownership of an object provided via an argument require
1593         /// this to be true and invalidate the object pointed to by inner.
1594         pub is_owned: bool,
1595 }
1596
1597 impl Drop for InvoiceFeatures {
1598         fn drop(&mut self) {
1599                 if self.is_owned && !<*mut nativeInvoiceFeatures>::is_null(self.inner) {
1600                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1601                 }
1602         }
1603 }
1604 /// Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
1605 #[no_mangle]
1606 pub extern "C" fn InvoiceFeatures_free(this_obj: InvoiceFeatures) { }
1607 #[allow(unused)]
1608 /// Used only if an object of this type is returned as a trait impl by a method
1609 pub(crate) extern "C" fn InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1610         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceFeatures) };
1611 }
1612 #[allow(unused)]
1613 impl InvoiceFeatures {
1614         pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceFeatures {
1615                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1616         }
1617         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceFeatures {
1618                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1619         }
1620         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1621         pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceFeatures {
1622                 assert!(self.is_owned);
1623                 let ret = ObjOps::untweak_ptr(self.inner);
1624                 self.inner = core::ptr::null_mut();
1625                 ret
1626         }
1627 }
1628
1629 use lightning::ln::features::OfferFeatures as nativeOfferFeaturesImport;
1630 pub(crate) type nativeOfferFeatures = nativeOfferFeaturesImport;
1631
1632 /// Features used within an `offer`.
1633 #[must_use]
1634 #[repr(C)]
1635 pub struct OfferFeatures {
1636         /// A pointer to the opaque Rust object.
1637
1638         /// Nearly everywhere, inner must be non-null, however in places where
1639         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1640         pub inner: *mut nativeOfferFeatures,
1641         /// Indicates that this is the only struct which contains the same pointer.
1642
1643         /// Rust functions which take ownership of an object provided via an argument require
1644         /// this to be true and invalidate the object pointed to by inner.
1645         pub is_owned: bool,
1646 }
1647
1648 impl Drop for OfferFeatures {
1649         fn drop(&mut self) {
1650                 if self.is_owned && !<*mut nativeOfferFeatures>::is_null(self.inner) {
1651                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1652                 }
1653         }
1654 }
1655 /// Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
1656 #[no_mangle]
1657 pub extern "C" fn OfferFeatures_free(this_obj: OfferFeatures) { }
1658 #[allow(unused)]
1659 /// Used only if an object of this type is returned as a trait impl by a method
1660 pub(crate) extern "C" fn OfferFeatures_free_void(this_ptr: *mut c_void) {
1661         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferFeatures) };
1662 }
1663 #[allow(unused)]
1664 impl OfferFeatures {
1665         pub(crate) fn get_native_ref(&self) -> &'static nativeOfferFeatures {
1666                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1667         }
1668         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferFeatures {
1669                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1670         }
1671         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1672         pub(crate) fn take_inner(mut self) -> *mut nativeOfferFeatures {
1673                 assert!(self.is_owned);
1674                 let ret = ObjOps::untweak_ptr(self.inner);
1675                 self.inner = core::ptr::null_mut();
1676                 ret
1677         }
1678 }
1679
1680 use lightning::ln::features::InvoiceRequestFeatures as nativeInvoiceRequestFeaturesImport;
1681 pub(crate) type nativeInvoiceRequestFeatures = nativeInvoiceRequestFeaturesImport;
1682
1683 /// Features used within an `invoice_request`.
1684 #[must_use]
1685 #[repr(C)]
1686 pub struct InvoiceRequestFeatures {
1687         /// A pointer to the opaque Rust object.
1688
1689         /// Nearly everywhere, inner must be non-null, however in places where
1690         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1691         pub inner: *mut nativeInvoiceRequestFeatures,
1692         /// Indicates that this is the only struct which contains the same pointer.
1693
1694         /// Rust functions which take ownership of an object provided via an argument require
1695         /// this to be true and invalidate the object pointed to by inner.
1696         pub is_owned: bool,
1697 }
1698
1699 impl Drop for InvoiceRequestFeatures {
1700         fn drop(&mut self) {
1701                 if self.is_owned && !<*mut nativeInvoiceRequestFeatures>::is_null(self.inner) {
1702                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1703                 }
1704         }
1705 }
1706 /// Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
1707 #[no_mangle]
1708 pub extern "C" fn InvoiceRequestFeatures_free(this_obj: InvoiceRequestFeatures) { }
1709 #[allow(unused)]
1710 /// Used only if an object of this type is returned as a trait impl by a method
1711 pub(crate) extern "C" fn InvoiceRequestFeatures_free_void(this_ptr: *mut c_void) {
1712         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceRequestFeatures) };
1713 }
1714 #[allow(unused)]
1715 impl InvoiceRequestFeatures {
1716         pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceRequestFeatures {
1717                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1718         }
1719         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceRequestFeatures {
1720                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1721         }
1722         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1723         pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceRequestFeatures {
1724                 assert!(self.is_owned);
1725                 let ret = ObjOps::untweak_ptr(self.inner);
1726                 self.inner = core::ptr::null_mut();
1727                 ret
1728         }
1729 }
1730
1731 use lightning::ln::features::Bolt12InvoiceFeatures as nativeBolt12InvoiceFeaturesImport;
1732 pub(crate) type nativeBolt12InvoiceFeatures = nativeBolt12InvoiceFeaturesImport;
1733
1734 /// Features used within an `invoice`.
1735 #[must_use]
1736 #[repr(C)]
1737 pub struct Bolt12InvoiceFeatures {
1738         /// A pointer to the opaque Rust object.
1739
1740         /// Nearly everywhere, inner must be non-null, however in places where
1741         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1742         pub inner: *mut nativeBolt12InvoiceFeatures,
1743         /// Indicates that this is the only struct which contains the same pointer.
1744
1745         /// Rust functions which take ownership of an object provided via an argument require
1746         /// this to be true and invalidate the object pointed to by inner.
1747         pub is_owned: bool,
1748 }
1749
1750 impl Drop for Bolt12InvoiceFeatures {
1751         fn drop(&mut self) {
1752                 if self.is_owned && !<*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) {
1753                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1754                 }
1755         }
1756 }
1757 /// Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
1758 #[no_mangle]
1759 pub extern "C" fn Bolt12InvoiceFeatures_free(this_obj: Bolt12InvoiceFeatures) { }
1760 #[allow(unused)]
1761 /// Used only if an object of this type is returned as a trait impl by a method
1762 pub(crate) extern "C" fn Bolt12InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1763         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt12InvoiceFeatures) };
1764 }
1765 #[allow(unused)]
1766 impl Bolt12InvoiceFeatures {
1767         pub(crate) fn get_native_ref(&self) -> &'static nativeBolt12InvoiceFeatures {
1768                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1769         }
1770         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt12InvoiceFeatures {
1771                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1772         }
1773         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1774         pub(crate) fn take_inner(mut self) -> *mut nativeBolt12InvoiceFeatures {
1775                 assert!(self.is_owned);
1776                 let ret = ObjOps::untweak_ptr(self.inner);
1777                 self.inner = core::ptr::null_mut();
1778                 ret
1779         }
1780 }
1781
1782 use lightning::ln::features::BlindedHopFeatures as nativeBlindedHopFeaturesImport;
1783 pub(crate) type nativeBlindedHopFeatures = nativeBlindedHopFeaturesImport;
1784
1785 /// Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
1786 #[must_use]
1787 #[repr(C)]
1788 pub struct BlindedHopFeatures {
1789         /// A pointer to the opaque Rust object.
1790
1791         /// Nearly everywhere, inner must be non-null, however in places where
1792         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1793         pub inner: *mut nativeBlindedHopFeatures,
1794         /// Indicates that this is the only struct which contains the same pointer.
1795
1796         /// Rust functions which take ownership of an object provided via an argument require
1797         /// this to be true and invalidate the object pointed to by inner.
1798         pub is_owned: bool,
1799 }
1800
1801 impl Drop for BlindedHopFeatures {
1802         fn drop(&mut self) {
1803                 if self.is_owned && !<*mut nativeBlindedHopFeatures>::is_null(self.inner) {
1804                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1805                 }
1806         }
1807 }
1808 /// Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
1809 #[no_mangle]
1810 pub extern "C" fn BlindedHopFeatures_free(this_obj: BlindedHopFeatures) { }
1811 #[allow(unused)]
1812 /// Used only if an object of this type is returned as a trait impl by a method
1813 pub(crate) extern "C" fn BlindedHopFeatures_free_void(this_ptr: *mut c_void) {
1814         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBlindedHopFeatures) };
1815 }
1816 #[allow(unused)]
1817 impl BlindedHopFeatures {
1818         pub(crate) fn get_native_ref(&self) -> &'static nativeBlindedHopFeatures {
1819                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1820         }
1821         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBlindedHopFeatures {
1822                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1823         }
1824         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1825         pub(crate) fn take_inner(mut self) -> *mut nativeBlindedHopFeatures {
1826                 assert!(self.is_owned);
1827                 let ret = ObjOps::untweak_ptr(self.inner);
1828                 self.inner = core::ptr::null_mut();
1829                 ret
1830         }
1831 }
1832
1833 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
1834 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
1835
1836 /// Features used within the channel_type field in an OpenChannel message.
1837 ///
1838 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
1839 /// semantics of our interaction with our peer.
1840 ///
1841 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
1842 /// the counterparty, only required features are allowed here.
1843 ///
1844 /// This is serialized differently from other feature types - it is not prefixed by a length, and
1845 /// thus must only appear inside a TLV where its length is known in advance.
1846 #[must_use]
1847 #[repr(C)]
1848 pub struct ChannelTypeFeatures {
1849         /// A pointer to the opaque Rust object.
1850
1851         /// Nearly everywhere, inner must be non-null, however in places where
1852         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1853         pub inner: *mut nativeChannelTypeFeatures,
1854         /// Indicates that this is the only struct which contains the same pointer.
1855
1856         /// Rust functions which take ownership of an object provided via an argument require
1857         /// this to be true and invalidate the object pointed to by inner.
1858         pub is_owned: bool,
1859 }
1860
1861 impl Drop for ChannelTypeFeatures {
1862         fn drop(&mut self) {
1863                 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
1864                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1865                 }
1866         }
1867 }
1868 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
1869 #[no_mangle]
1870 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
1871 #[allow(unused)]
1872 /// Used only if an object of this type is returned as a trait impl by a method
1873 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
1874         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures) };
1875 }
1876 #[allow(unused)]
1877 impl ChannelTypeFeatures {
1878         pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
1879                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1880         }
1881         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
1882                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1883         }
1884         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1885         pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
1886                 assert!(self.is_owned);
1887                 let ret = ObjOps::untweak_ptr(self.inner);
1888                 self.inner = core::ptr::null_mut();
1889                 ret
1890         }
1891 }
1892 /// Create a blank Features with no features set
1893 #[must_use]
1894 #[no_mangle]
1895 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
1896         let mut ret = lightning::ln::features::InitFeatures::empty();
1897         crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1898 }
1899
1900 /// Returns true if this `Features` object contains unknown feature flags which are set as
1901 /// \"required\".
1902 #[must_use]
1903 #[no_mangle]
1904 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1905         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1906         ret
1907 }
1908
1909 /// Create a blank Features with no features set
1910 #[must_use]
1911 #[no_mangle]
1912 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
1913         let mut ret = lightning::ln::features::NodeFeatures::empty();
1914         crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1915 }
1916
1917 /// Returns true if this `Features` object contains unknown feature flags which are set as
1918 /// \"required\".
1919 #[must_use]
1920 #[no_mangle]
1921 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1922         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1923         ret
1924 }
1925
1926 /// Create a blank Features with no features set
1927 #[must_use]
1928 #[no_mangle]
1929 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
1930         let mut ret = lightning::ln::features::ChannelFeatures::empty();
1931         crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1932 }
1933
1934 /// Returns true if this `Features` object contains unknown feature flags which are set as
1935 /// \"required\".
1936 #[must_use]
1937 #[no_mangle]
1938 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
1939         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1940         ret
1941 }
1942
1943 /// Create a blank Features with no features set
1944 #[must_use]
1945 #[no_mangle]
1946 pub extern "C" fn InvoiceFeatures_empty() -> crate::lightning::ln::features::InvoiceFeatures {
1947         let mut ret = lightning::ln::features::InvoiceFeatures::empty();
1948         crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1949 }
1950
1951 /// Returns true if this `Features` object contains unknown feature flags which are set as
1952 /// \"required\".
1953 #[must_use]
1954 #[no_mangle]
1955 pub extern "C" fn InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1956         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1957         ret
1958 }
1959
1960 /// Create a blank Features with no features set
1961 #[must_use]
1962 #[no_mangle]
1963 pub extern "C" fn OfferFeatures_empty() -> crate::lightning::ln::features::OfferFeatures {
1964         let mut ret = lightning::ln::features::OfferFeatures::empty();
1965         crate::lightning::ln::features::OfferFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1966 }
1967
1968 /// Returns true if this `Features` object contains unknown feature flags which are set as
1969 /// \"required\".
1970 #[must_use]
1971 #[no_mangle]
1972 pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::OfferFeatures) -> bool {
1973         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1974         ret
1975 }
1976
1977 /// Create a blank Features with no features set
1978 #[must_use]
1979 #[no_mangle]
1980 pub extern "C" fn InvoiceRequestFeatures_empty() -> crate::lightning::ln::features::InvoiceRequestFeatures {
1981         let mut ret = lightning::ln::features::InvoiceRequestFeatures::empty();
1982         crate::lightning::ln::features::InvoiceRequestFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1983 }
1984
1985 /// Returns true if this `Features` object contains unknown feature flags which are set as
1986 /// \"required\".
1987 #[must_use]
1988 #[no_mangle]
1989 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
1990         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1991         ret
1992 }
1993
1994 /// Create a blank Features with no features set
1995 #[must_use]
1996 #[no_mangle]
1997 pub extern "C" fn Bolt12InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt12InvoiceFeatures {
1998         let mut ret = lightning::ln::features::Bolt12InvoiceFeatures::empty();
1999         crate::lightning::ln::features::Bolt12InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2000 }
2001
2002 /// Returns true if this `Features` object contains unknown feature flags which are set as
2003 /// \"required\".
2004 #[must_use]
2005 #[no_mangle]
2006 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2007         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2008         ret
2009 }
2010
2011 /// Create a blank Features with no features set
2012 #[must_use]
2013 #[no_mangle]
2014 pub extern "C" fn BlindedHopFeatures_empty() -> crate::lightning::ln::features::BlindedHopFeatures {
2015         let mut ret = lightning::ln::features::BlindedHopFeatures::empty();
2016         crate::lightning::ln::features::BlindedHopFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2017 }
2018
2019 /// Returns true if this `Features` object contains unknown feature flags which are set as
2020 /// \"required\".
2021 #[must_use]
2022 #[no_mangle]
2023 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2024         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2025         ret
2026 }
2027
2028 /// Create a blank Features with no features set
2029 #[must_use]
2030 #[no_mangle]
2031 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
2032         let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
2033         crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2034 }
2035
2036 /// Returns true if this `Features` object contains unknown feature flags which are set as
2037 /// \"required\".
2038 #[must_use]
2039 #[no_mangle]
2040 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2041         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2042         ret
2043 }
2044
2045 #[no_mangle]
2046 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
2047 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
2048         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2049 }
2050 #[no_mangle]
2051 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2052         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
2053 }
2054 #[no_mangle]
2055 /// Read a InitFeatures from a byte array, created by InitFeatures_write
2056 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
2057         let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2058         let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
2059         local_res
2060 }
2061 #[no_mangle]
2062 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
2063 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
2064         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2065 }
2066 #[no_mangle]
2067 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2068         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
2069 }
2070 #[no_mangle]
2071 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
2072 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
2073         let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2074         let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
2075         local_res
2076 }
2077 #[no_mangle]
2078 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
2079 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
2080         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2081 }
2082 #[no_mangle]
2083 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2084         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
2085 }
2086 #[no_mangle]
2087 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
2088 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
2089         let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2090         let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
2091         local_res
2092 }
2093 #[no_mangle]
2094 /// Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
2095 pub extern "C" fn InvoiceFeatures_write(obj: &crate::lightning::ln::features::InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
2096         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2097 }
2098 #[no_mangle]
2099 pub(crate) extern "C" fn InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2100         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceFeatures) })
2101 }
2102 #[no_mangle]
2103 /// Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
2104 pub extern "C" fn InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InvoiceFeaturesDecodeErrorZ {
2105         let res: Result<lightning::ln::features::InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2106         let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
2107         local_res
2108 }
2109 #[no_mangle]
2110 /// Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
2111 pub extern "C" fn BlindedHopFeatures_write(obj: &crate::lightning::ln::features::BlindedHopFeatures) -> crate::c_types::derived::CVec_u8Z {
2112         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2113 }
2114 #[no_mangle]
2115 pub(crate) extern "C" fn BlindedHopFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2116         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedHopFeatures) })
2117 }
2118 #[no_mangle]
2119 /// Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
2120 pub extern "C" fn BlindedHopFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_BlindedHopFeaturesDecodeErrorZ {
2121         let res: Result<lightning::ln::features::BlindedHopFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2122         let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::BlindedHopFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
2123         local_res
2124 }
2125 #[no_mangle]
2126 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
2127 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
2128         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2129 }
2130 #[no_mangle]
2131 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2132         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
2133 }
2134 #[no_mangle]
2135 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
2136 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
2137         let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2138         let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
2139         local_res
2140 }