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