Update auto-generated bindings to LDK 0.0.116
[ldk-c-bindings] / lightning-c-bindings / src / lightning / ln / features.rs
1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
3 //
4 // This file is licensed under the license available in the LICENSE or LICENSE.md
5 // file in the root of this repository or, if no such file exists, the same
6 // license as that which applies to the original source files from which this
7 // source was automatically generated.
8
9 //! Feature flag definitions for the Lightning protocol according to [BOLT #9].
10 //!
11 //! Lightning nodes advertise a supported set of operation through feature flags. Features are
12 //! applicable for a specific context as indicated in some [messages]. [`Features`] encapsulates
13 //! behavior for specifying and checking feature flags for a particular context. Each feature is
14 //! defined internally by a trait specifying the corresponding flags (i.e., even and odd bits).
15 //!
16 //! Whether a feature is considered \"known\" or \"unknown\" is relative to the implementation, whereas
17 //! the term \"supports\" is used in reference to a particular set of [`Features`]. That is, a node
18 //! supports a feature if it advertises the feature (as either required or optional) to its peers.
19 //! And the implementation can interpret a feature if the feature is known to it.
20 //!
21 //! The following features are currently required in the LDK:
22 //! - `VariableLengthOnion` - requires/supports variable-length routing onion payloads
23 //!     (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for more information).
24 //! - `StaticRemoteKey` - requires/supports static key for remote output
25 //!     (see [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more information).
26 //!
27 //! The following features are currently supported in the LDK:
28 //! - `DataLossProtect` - requires/supports that a node which has somehow fallen behind, e.g., has been restored from an old backup,
29 //!     can detect that it has fallen behind
30 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
31 //! - `InitialRoutingSync` - requires/supports that the sending node needs a complete routing information dump
32 //!     (see [BOLT-7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#initial-sync) for more information).
33 //! - `UpfrontShutdownScript` - commits to a shutdown scriptpubkey when opening a channel
34 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message) for more information).
35 //! - `GossipQueries` - requires/supports more sophisticated gossip control
36 //!     (see [BOLT-7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md) for more information).
37 //! - `PaymentSecret` - requires/supports that a node supports payment_secret field
38 //!     (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for more information).
39 //! - `BasicMPP` - requires/supports that a node can receive basic multi-part payments
40 //!     (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#basic-multi-part-payments) for more information).
41 //! - `Wumbo` - requires/supports that a node create large channels. Called `option_support_large_channel` in the spec.
42 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message) for more information).
43 //! - `ShutdownAnySegwit` - requires/supports that future segwit versions are allowed in `shutdown`
44 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
45 //! - `OnionMessages` - requires/supports forwarding onion messages
46 //!     (see [BOLT-7](https://github.com/lightning/bolts/pull/759/files) for more information).
47 //! - `ChannelType` - node supports the channel_type field in open/accept
48 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
49 //! - `SCIDPrivacy` - supply channel aliases for routing
50 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
51 //! - `PaymentMetadata` - include additional data in invoices which is passed to recipients in the
52 //!      onion.
53 //!      (see [BOLT-11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) for
54 //!      more).
55 //! - `ZeroConf` - supports accepting HTLCs and using channels prior to funding confirmation
56 //!      (see
57 //!      [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message)
58 //!      for more info).
59 //! - `Keysend` - send funds to a node without an invoice
60 //!     (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
61 //! - `AnchorsZeroFeeHtlcTx` - requires/supports that commitment transactions include anchor outputs
62 //!     and HTLC transactions are pre-signed with zero fee (see
63 //!     [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more
64 //!     information).
65 //!
66 //! LDK knows about the following features, but does not support them:
67 //! - `AnchorsNonzeroFeeHtlcTx` - the initial version of anchor outputs, which was later found to be
68 //!     vulnerable (see this
69 //!     [mailing list post](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html)
70 //!     for more information).
71 //!
72 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
73 //! [messages]: crate::ln::msgs
74
75 use alloc::str::FromStr;
76 use core::ffi::c_void;
77 use core::convert::Infallible;
78 use bitcoin::hashes::Hash;
79 use crate::c_types::*;
80 #[cfg(feature="no-std")]
81 use alloc::{vec::Vec, boxed::Box};
82
83 mod sealed {
84
85 use alloc::str::FromStr;
86 use core::ffi::c_void;
87 use core::convert::Infallible;
88 use bitcoin::hashes::Hash;
89 use crate::c_types::*;
90 #[cfg(feature="no-std")]
91 use alloc::{vec::Vec, boxed::Box};
92
93 /// Set this feature as optional.
94 #[no_mangle]
95 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
96         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_optional()
97 }
98
99 /// Set this feature as required.
100 #[no_mangle]
101 pub extern "C" fn InitFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
102         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_required()
103 }
104
105 /// Checks if this feature is supported.
106 #[must_use]
107 #[no_mangle]
108 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
109         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
110         ret
111 }
112
113 /// Set this feature as optional.
114 #[no_mangle]
115 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
116         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_optional()
117 }
118
119 /// Set this feature as required.
120 #[no_mangle]
121 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
122         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_required()
123 }
124
125 /// Checks if this feature is supported.
126 #[must_use]
127 #[no_mangle]
128 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
129         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
130         ret
131 }
132
133 /// Checks if this feature is required.
134 #[must_use]
135 #[no_mangle]
136 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
137         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
138         ret
139 }
140
141 /// Checks if this feature is required.
142 #[must_use]
143 #[no_mangle]
144 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
145         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
146         ret
147 }
148
149 /// Set this feature as optional.
150 #[no_mangle]
151 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
152         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_optional()
153 }
154
155 /// Set this feature as required.
156 #[no_mangle]
157 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
158         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_required()
159 }
160
161 /// Checks if this feature is supported.
162 #[must_use]
163 #[no_mangle]
164 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
165         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
166         ret
167 }
168
169 /// Set this feature as optional.
170 #[no_mangle]
171 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
172         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_optional()
173 }
174
175 /// Set this feature as required.
176 #[no_mangle]
177 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
178         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_required()
179 }
180
181 /// Checks if this feature is supported.
182 #[must_use]
183 #[no_mangle]
184 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
185         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
186         ret
187 }
188
189 /// Set this feature as optional.
190 #[no_mangle]
191 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
192         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_optional()
193 }
194
195 /// Set this feature as required.
196 #[no_mangle]
197 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
198         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_required()
199 }
200
201 /// Checks if this feature is supported.
202 #[must_use]
203 #[no_mangle]
204 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
205         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
206         ret
207 }
208
209 /// Checks if this feature is required.
210 #[must_use]
211 #[no_mangle]
212 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
213         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
214         ret
215 }
216
217 /// Checks if this feature is required.
218 #[must_use]
219 #[no_mangle]
220 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
221         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
222         ret
223 }
224
225 /// Set this feature as optional.
226 #[no_mangle]
227 pub extern "C" fn InitFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
228         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_optional()
229 }
230
231 /// Set this feature as required.
232 #[no_mangle]
233 pub extern "C" fn InitFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
234         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_required()
235 }
236
237 /// Checks if this feature is supported.
238 #[must_use]
239 #[no_mangle]
240 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
241         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
242         ret
243 }
244
245 /// Set this feature as optional.
246 #[no_mangle]
247 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
248         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_optional()
249 }
250
251 /// Set this feature as required.
252 #[no_mangle]
253 pub extern "C" fn NodeFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
254         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_required()
255 }
256
257 /// Checks if this feature is supported.
258 #[must_use]
259 #[no_mangle]
260 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
261         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
262         ret
263 }
264
265 /// Checks if this feature is required.
266 #[must_use]
267 #[no_mangle]
268 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
269         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
270         ret
271 }
272
273 /// Checks if this feature is required.
274 #[must_use]
275 #[no_mangle]
276 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
277         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
278         ret
279 }
280
281 /// Set this feature as optional.
282 #[no_mangle]
283 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
284         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_optional()
285 }
286
287 /// Set this feature as required.
288 #[no_mangle]
289 pub extern "C" fn InitFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
290         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_required()
291 }
292
293 /// Checks if this feature is supported.
294 #[must_use]
295 #[no_mangle]
296 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
297         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
298         ret
299 }
300
301 /// Set this feature as optional.
302 #[no_mangle]
303 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
304         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_optional()
305 }
306
307 /// Set this feature as required.
308 #[no_mangle]
309 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
310         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_required()
311 }
312
313 /// Checks if this feature is supported.
314 #[must_use]
315 #[no_mangle]
316 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
317         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
318         ret
319 }
320
321 /// Set this feature as optional.
322 #[no_mangle]
323 pub extern "C" fn Bolt11InvoiceFeatures_set_variable_length_onion_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
324         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_variable_length_onion_optional()
325 }
326
327 /// Set this feature as required.
328 #[no_mangle]
329 pub extern "C" fn Bolt11InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
330         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_variable_length_onion_required()
331 }
332
333 /// Checks if this feature is supported.
334 #[must_use]
335 #[no_mangle]
336 pub extern "C" fn Bolt11InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
337         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
338         ret
339 }
340
341 /// Checks if this feature is required.
342 #[must_use]
343 #[no_mangle]
344 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
345         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
346         ret
347 }
348
349 /// Checks if this feature is required.
350 #[must_use]
351 #[no_mangle]
352 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
353         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
354         ret
355 }
356
357 /// Checks if this feature is required.
358 #[must_use]
359 #[no_mangle]
360 pub extern "C" fn Bolt11InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
361         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
362         ret
363 }
364
365 /// Set this feature as optional.
366 #[no_mangle]
367 pub extern "C" fn InitFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
368         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_optional()
369 }
370
371 /// Set this feature as required.
372 #[no_mangle]
373 pub extern "C" fn InitFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
374         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_required()
375 }
376
377 /// Checks if this feature is supported.
378 #[must_use]
379 #[no_mangle]
380 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
381         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
382         ret
383 }
384
385 /// Set this feature as optional.
386 #[no_mangle]
387 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
388         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_optional()
389 }
390
391 /// Set this feature as required.
392 #[no_mangle]
393 pub extern "C" fn NodeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
394         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_required()
395 }
396
397 /// Checks if this feature is supported.
398 #[must_use]
399 #[no_mangle]
400 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
401         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
402         ret
403 }
404
405 /// Set this feature as optional.
406 #[no_mangle]
407 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
408         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_optional()
409 }
410
411 /// Set this feature as required.
412 #[no_mangle]
413 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
414         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_required()
415 }
416
417 /// Checks if this feature is supported.
418 #[must_use]
419 #[no_mangle]
420 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
421         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
422         ret
423 }
424
425 /// Checks if this feature is required.
426 #[must_use]
427 #[no_mangle]
428 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
429         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
430         ret
431 }
432
433 /// Checks if this feature is required.
434 #[must_use]
435 #[no_mangle]
436 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
437         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
438         ret
439 }
440
441 /// Checks if this feature is required.
442 #[must_use]
443 #[no_mangle]
444 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
445         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
446         ret
447 }
448
449 /// Set this feature as optional.
450 #[no_mangle]
451 pub extern "C" fn InitFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
452         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_optional()
453 }
454
455 /// Set this feature as required.
456 #[no_mangle]
457 pub extern "C" fn InitFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
458         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_required()
459 }
460
461 /// Checks if this feature is supported.
462 #[must_use]
463 #[no_mangle]
464 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
465         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
466         ret
467 }
468
469 /// Set this feature as optional.
470 #[no_mangle]
471 pub extern "C" fn NodeFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
472         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_optional()
473 }
474
475 /// Set this feature as required.
476 #[no_mangle]
477 pub extern "C" fn NodeFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
478         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_required()
479 }
480
481 /// Checks if this feature is supported.
482 #[must_use]
483 #[no_mangle]
484 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
485         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
486         ret
487 }
488
489 /// Set this feature as optional.
490 #[no_mangle]
491 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_secret_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
492         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_secret_optional()
493 }
494
495 /// Set this feature as required.
496 #[no_mangle]
497 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
498         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_secret_required()
499 }
500
501 /// Checks if this feature is supported.
502 #[must_use]
503 #[no_mangle]
504 pub extern "C" fn Bolt11InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
505         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
506         ret
507 }
508
509 /// Checks if this feature is required.
510 #[must_use]
511 #[no_mangle]
512 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
513         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
514         ret
515 }
516
517 /// Checks if this feature is required.
518 #[must_use]
519 #[no_mangle]
520 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
521         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
522         ret
523 }
524
525 /// Checks if this feature is required.
526 #[must_use]
527 #[no_mangle]
528 pub extern "C" fn Bolt11InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
529         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
530         ret
531 }
532
533 /// Set this feature as optional.
534 #[no_mangle]
535 pub extern "C" fn InitFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
536         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_optional()
537 }
538
539 /// Set this feature as required.
540 #[no_mangle]
541 pub extern "C" fn InitFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
542         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_required()
543 }
544
545 /// Checks if this feature is supported.
546 #[must_use]
547 #[no_mangle]
548 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
549         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
550         ret
551 }
552
553 /// Set this feature as optional.
554 #[no_mangle]
555 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
556         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_optional()
557 }
558
559 /// Set this feature as required.
560 #[no_mangle]
561 pub extern "C" fn NodeFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
562         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_required()
563 }
564
565 /// Checks if this feature is supported.
566 #[must_use]
567 #[no_mangle]
568 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
569         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
570         ret
571 }
572
573 /// Set this feature as optional.
574 #[no_mangle]
575 pub extern "C" fn Bolt11InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
576         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_basic_mpp_optional()
577 }
578
579 /// Set this feature as required.
580 #[no_mangle]
581 pub extern "C" fn Bolt11InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
582         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_basic_mpp_required()
583 }
584
585 /// Checks if this feature is supported.
586 #[must_use]
587 #[no_mangle]
588 pub extern "C" fn Bolt11InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
589         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
590         ret
591 }
592
593 /// Set this feature as optional.
594 #[no_mangle]
595 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_optional(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
596         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_optional()
597 }
598
599 /// Set this feature as required.
600 #[no_mangle]
601 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
602         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_required()
603 }
604
605 /// Checks if this feature is supported.
606 #[must_use]
607 #[no_mangle]
608 pub extern "C" fn Bolt12InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
609         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
610         ret
611 }
612
613 /// Checks if this feature is required.
614 #[must_use]
615 #[no_mangle]
616 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
617         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
618         ret
619 }
620
621 /// Checks if this feature is required.
622 #[must_use]
623 #[no_mangle]
624 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
625         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
626         ret
627 }
628
629 /// Checks if this feature is required.
630 #[must_use]
631 #[no_mangle]
632 pub extern "C" fn Bolt11InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
633         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
634         ret
635 }
636
637 /// Checks if this feature is required.
638 #[must_use]
639 #[no_mangle]
640 pub extern "C" fn Bolt12InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
641         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
642         ret
643 }
644
645 /// Set this feature as optional.
646 #[no_mangle]
647 pub extern "C" fn InitFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
648         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_optional()
649 }
650
651 /// Set this feature as required.
652 #[no_mangle]
653 pub extern "C" fn InitFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
654         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_required()
655 }
656
657 /// Checks if this feature is supported.
658 #[must_use]
659 #[no_mangle]
660 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
661         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
662         ret
663 }
664
665 /// Set this feature as optional.
666 #[no_mangle]
667 pub extern "C" fn NodeFeatures_set_wumbo_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
668         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_optional()
669 }
670
671 /// Set this feature as required.
672 #[no_mangle]
673 pub extern "C" fn NodeFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
674         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_required()
675 }
676
677 /// Checks if this feature is supported.
678 #[must_use]
679 #[no_mangle]
680 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
681         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
682         ret
683 }
684
685 /// Checks if this feature is required.
686 #[must_use]
687 #[no_mangle]
688 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
689         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
690         ret
691 }
692
693 /// Checks if this feature is required.
694 #[must_use]
695 #[no_mangle]
696 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
697         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
698         ret
699 }
700
701 /// Set this feature as optional.
702 #[no_mangle]
703 pub extern "C" fn InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
704         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
705 }
706
707 /// Set this feature as required.
708 #[no_mangle]
709 pub extern "C" fn InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
710         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
711 }
712
713 /// Checks if this feature is supported.
714 #[must_use]
715 #[no_mangle]
716 pub extern "C" fn InitFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
717         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
718         ret
719 }
720
721 /// Set this feature as optional.
722 #[no_mangle]
723 pub extern "C" fn NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
724         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
725 }
726
727 /// Set this feature as required.
728 #[no_mangle]
729 pub extern "C" fn NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
730         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
731 }
732
733 /// Checks if this feature is supported.
734 #[must_use]
735 #[no_mangle]
736 pub extern "C" fn NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
737         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
738         ret
739 }
740
741 /// Set this feature as optional.
742 #[no_mangle]
743 pub extern "C" fn ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
744         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_optional()
745 }
746
747 /// Set this feature as required.
748 #[no_mangle]
749 pub extern "C" fn ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
750         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
751 }
752
753 /// Checks if this feature is supported.
754 #[must_use]
755 #[no_mangle]
756 pub extern "C" fn ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
757         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
758         ret
759 }
760
761 /// Checks if this feature is required.
762 #[must_use]
763 #[no_mangle]
764 pub extern "C" fn InitFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
765         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
766         ret
767 }
768
769 /// Checks if this feature is required.
770 #[must_use]
771 #[no_mangle]
772 pub extern "C" fn NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
773         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
774         ret
775 }
776
777 /// Checks if this feature is required.
778 #[must_use]
779 #[no_mangle]
780 pub extern "C" fn ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
781         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
782         ret
783 }
784
785 /// Set this feature as optional.
786 #[no_mangle]
787 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
788         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
789 }
790
791 /// Set this feature as required.
792 #[no_mangle]
793 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
794         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
795 }
796
797 /// Checks if this feature is supported.
798 #[must_use]
799 #[no_mangle]
800 pub extern "C" fn InitFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
801         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
802         ret
803 }
804
805 /// Set this feature as optional.
806 #[no_mangle]
807 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
808         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
809 }
810
811 /// Set this feature as required.
812 #[no_mangle]
813 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
814         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
815 }
816
817 /// Checks if this feature is supported.
818 #[must_use]
819 #[no_mangle]
820 pub extern "C" fn NodeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
821         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
822         ret
823 }
824
825 /// Set this feature as optional.
826 #[no_mangle]
827 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
828         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_optional()
829 }
830
831 /// Set this feature as required.
832 #[no_mangle]
833 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
834         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
835 }
836
837 /// Checks if this feature is supported.
838 #[must_use]
839 #[no_mangle]
840 pub extern "C" fn ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
841         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
842         ret
843 }
844
845 /// Checks if this feature is required.
846 #[must_use]
847 #[no_mangle]
848 pub extern "C" fn InitFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
849         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
850         ret
851 }
852
853 /// Checks if this feature is required.
854 #[must_use]
855 #[no_mangle]
856 pub extern "C" fn NodeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
857         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
858         ret
859 }
860
861 /// Checks if this feature is required.
862 #[must_use]
863 #[no_mangle]
864 pub extern "C" fn ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
865         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
866         ret
867 }
868
869 /// Set this feature as optional.
870 #[no_mangle]
871 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
872         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_optional()
873 }
874
875 /// Set this feature as required.
876 #[no_mangle]
877 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
878         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_required()
879 }
880
881 /// Checks if this feature is supported.
882 #[must_use]
883 #[no_mangle]
884 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
885         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
886         ret
887 }
888
889 /// Set this feature as optional.
890 #[no_mangle]
891 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
892         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_optional()
893 }
894
895 /// Set this feature as required.
896 #[no_mangle]
897 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
898         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_required()
899 }
900
901 /// Checks if this feature is supported.
902 #[must_use]
903 #[no_mangle]
904 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
905         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
906         ret
907 }
908
909 /// Checks if this feature is required.
910 #[must_use]
911 #[no_mangle]
912 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
913         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
914         ret
915 }
916
917 /// Checks if this feature is required.
918 #[must_use]
919 #[no_mangle]
920 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
921         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
922         ret
923 }
924
925 /// Set this feature as optional.
926 #[no_mangle]
927 pub extern "C" fn InitFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
928         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_optional()
929 }
930
931 /// Set this feature as required.
932 #[no_mangle]
933 pub extern "C" fn InitFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
934         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_required()
935 }
936
937 /// Checks if this feature is supported.
938 #[must_use]
939 #[no_mangle]
940 pub extern "C" fn InitFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
941         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
942         ret
943 }
944
945 /// Set this feature as optional.
946 #[no_mangle]
947 pub extern "C" fn NodeFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
948         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_optional()
949 }
950
951 /// Set this feature as required.
952 #[no_mangle]
953 pub extern "C" fn NodeFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
954         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_required()
955 }
956
957 /// Checks if this feature is supported.
958 #[must_use]
959 #[no_mangle]
960 pub extern "C" fn NodeFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
961         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
962         ret
963 }
964
965 /// Checks if this feature is required.
966 #[must_use]
967 #[no_mangle]
968 pub extern "C" fn InitFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
969         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
970         ret
971 }
972
973 /// Checks if this feature is required.
974 #[must_use]
975 #[no_mangle]
976 pub extern "C" fn NodeFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
977         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
978         ret
979 }
980
981 /// Set this feature as optional.
982 #[no_mangle]
983 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
984         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
985 }
986
987 /// Set this feature as required.
988 #[no_mangle]
989 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
990         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
991 }
992
993 /// Checks if this feature is supported.
994 #[must_use]
995 #[no_mangle]
996 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
997         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
998         ret
999 }
1000
1001 /// Set this feature as optional.
1002 #[no_mangle]
1003 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1004         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
1005 }
1006
1007 /// Set this feature as required.
1008 #[no_mangle]
1009 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1010         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
1011 }
1012
1013 /// Checks if this feature is supported.
1014 #[must_use]
1015 #[no_mangle]
1016 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1017         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
1018         ret
1019 }
1020
1021 /// Checks if this feature is required.
1022 #[must_use]
1023 #[no_mangle]
1024 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1025         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
1026         ret
1027 }
1028
1029 /// Checks if this feature is required.
1030 #[must_use]
1031 #[no_mangle]
1032 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1033         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
1034         ret
1035 }
1036
1037 /// Set this feature as optional.
1038 #[no_mangle]
1039 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1040         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
1041 }
1042
1043 /// Set this feature as required.
1044 #[no_mangle]
1045 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1046         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
1047 }
1048
1049 /// Checks if this feature is supported.
1050 #[must_use]
1051 #[no_mangle]
1052 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1053         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1054         ret
1055 }
1056
1057 /// Set this feature as optional.
1058 #[no_mangle]
1059 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1060         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
1061 }
1062
1063 /// Set this feature as required.
1064 #[no_mangle]
1065 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1066         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
1067 }
1068
1069 /// Checks if this feature is supported.
1070 #[must_use]
1071 #[no_mangle]
1072 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1073         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1074         ret
1075 }
1076
1077 /// Set this feature as optional.
1078 #[no_mangle]
1079 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1080         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
1081 }
1082
1083 /// Set this feature as required.
1084 #[no_mangle]
1085 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1086         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
1087 }
1088
1089 /// Checks if this feature is supported.
1090 #[must_use]
1091 #[no_mangle]
1092 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1093         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1094         ret
1095 }
1096
1097 /// Checks if this feature is required.
1098 #[must_use]
1099 #[no_mangle]
1100 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1101         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1102         ret
1103 }
1104
1105 /// Checks if this feature is required.
1106 #[must_use]
1107 #[no_mangle]
1108 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1109         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1110         ret
1111 }
1112
1113 /// Checks if this feature is required.
1114 #[must_use]
1115 #[no_mangle]
1116 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1117         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1118         ret
1119 }
1120
1121 /// Set this feature as optional.
1122 #[no_mangle]
1123 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_metadata_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1124         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_metadata_optional()
1125 }
1126
1127 /// Set this feature as required.
1128 #[no_mangle]
1129 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_metadata_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1130         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_metadata_required()
1131 }
1132
1133 /// Checks if this feature is supported.
1134 #[must_use]
1135 #[no_mangle]
1136 pub extern "C" fn Bolt11InvoiceFeatures_supports_payment_metadata(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1137         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_metadata();
1138         ret
1139 }
1140
1141 /// Checks if this feature is required.
1142 #[must_use]
1143 #[no_mangle]
1144 pub extern "C" fn Bolt11InvoiceFeatures_requires_payment_metadata(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1145         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_metadata();
1146         ret
1147 }
1148
1149 /// Set this feature as optional.
1150 #[no_mangle]
1151 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1152         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
1153 }
1154
1155 /// Set this feature as required.
1156 #[no_mangle]
1157 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1158         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
1159 }
1160
1161 /// Checks if this feature is supported.
1162 #[must_use]
1163 #[no_mangle]
1164 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1165         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1166         ret
1167 }
1168
1169 /// Set this feature as optional.
1170 #[no_mangle]
1171 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1172         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
1173 }
1174
1175 /// Set this feature as required.
1176 #[no_mangle]
1177 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1178         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
1179 }
1180
1181 /// Checks if this feature is supported.
1182 #[must_use]
1183 #[no_mangle]
1184 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1185         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1186         ret
1187 }
1188
1189 /// Set this feature as optional.
1190 #[no_mangle]
1191 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1192         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
1193 }
1194
1195 /// Set this feature as required.
1196 #[no_mangle]
1197 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1198         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
1199 }
1200
1201 /// Checks if this feature is supported.
1202 #[must_use]
1203 #[no_mangle]
1204 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1205         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1206         ret
1207 }
1208
1209 /// Checks if this feature is required.
1210 #[must_use]
1211 #[no_mangle]
1212 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1213         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1214         ret
1215 }
1216
1217 /// Checks if this feature is required.
1218 #[must_use]
1219 #[no_mangle]
1220 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1221         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1222         ret
1223 }
1224
1225 /// Checks if this feature is required.
1226 #[must_use]
1227 #[no_mangle]
1228 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1229         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1230         ret
1231 }
1232
1233 /// Set this feature as optional.
1234 #[no_mangle]
1235 pub extern "C" fn NodeFeatures_set_keysend_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1236         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_optional()
1237 }
1238
1239 /// Set this feature as required.
1240 #[no_mangle]
1241 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1242         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
1243 }
1244
1245 /// Checks if this feature is supported.
1246 #[must_use]
1247 #[no_mangle]
1248 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1249         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
1250         ret
1251 }
1252
1253 /// Checks if this feature is required.
1254 #[must_use]
1255 #[no_mangle]
1256 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1257         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
1258         ret
1259 }
1260
1261 }
1262 /// Checks if two InitFeaturess contain equal inner contents.
1263 /// This ignores pointers and is_owned flags and looks at the values in fields.
1264 /// Two objects with NULL inner values will be considered "equal" here.
1265 #[no_mangle]
1266 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
1267         if a.inner == b.inner { return true; }
1268         if a.inner.is_null() || b.inner.is_null() { return false; }
1269         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1270 }
1271 /// Checks if two NodeFeaturess contain equal inner contents.
1272 /// This ignores pointers and is_owned flags and looks at the values in fields.
1273 /// Two objects with NULL inner values will be considered "equal" here.
1274 #[no_mangle]
1275 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
1276         if a.inner == b.inner { return true; }
1277         if a.inner.is_null() || b.inner.is_null() { return false; }
1278         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1279 }
1280 /// Checks if two ChannelFeaturess contain equal inner contents.
1281 /// This ignores pointers and is_owned flags and looks at the values in fields.
1282 /// Two objects with NULL inner values will be considered "equal" here.
1283 #[no_mangle]
1284 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
1285         if a.inner == b.inner { return true; }
1286         if a.inner.is_null() || b.inner.is_null() { return false; }
1287         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1288 }
1289 /// Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
1290 /// This ignores pointers and is_owned flags and looks at the values in fields.
1291 /// Two objects with NULL inner values will be considered "equal" here.
1292 #[no_mangle]
1293 pub extern "C" fn Bolt11InvoiceFeatures_eq(a: &Bolt11InvoiceFeatures, b: &Bolt11InvoiceFeatures) -> bool {
1294         if a.inner == b.inner { return true; }
1295         if a.inner.is_null() || b.inner.is_null() { return false; }
1296         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1297 }
1298 /// Checks if two OfferFeaturess contain equal inner contents.
1299 /// This ignores pointers and is_owned flags and looks at the values in fields.
1300 /// Two objects with NULL inner values will be considered "equal" here.
1301 #[no_mangle]
1302 pub extern "C" fn OfferFeatures_eq(a: &OfferFeatures, b: &OfferFeatures) -> bool {
1303         if a.inner == b.inner { return true; }
1304         if a.inner.is_null() || b.inner.is_null() { return false; }
1305         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1306 }
1307 /// Checks if two InvoiceRequestFeaturess contain equal inner contents.
1308 /// This ignores pointers and is_owned flags and looks at the values in fields.
1309 /// Two objects with NULL inner values will be considered "equal" here.
1310 #[no_mangle]
1311 pub extern "C" fn InvoiceRequestFeatures_eq(a: &InvoiceRequestFeatures, b: &InvoiceRequestFeatures) -> bool {
1312         if a.inner == b.inner { return true; }
1313         if a.inner.is_null() || b.inner.is_null() { return false; }
1314         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1315 }
1316 /// Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
1317 /// This ignores pointers and is_owned flags and looks at the values in fields.
1318 /// Two objects with NULL inner values will be considered "equal" here.
1319 #[no_mangle]
1320 pub extern "C" fn Bolt12InvoiceFeatures_eq(a: &Bolt12InvoiceFeatures, b: &Bolt12InvoiceFeatures) -> bool {
1321         if a.inner == b.inner { return true; }
1322         if a.inner.is_null() || b.inner.is_null() { return false; }
1323         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1324 }
1325 /// Checks if two BlindedHopFeaturess contain equal inner contents.
1326 /// This ignores pointers and is_owned flags and looks at the values in fields.
1327 /// Two objects with NULL inner values will be considered "equal" here.
1328 #[no_mangle]
1329 pub extern "C" fn BlindedHopFeatures_eq(a: &BlindedHopFeatures, b: &BlindedHopFeatures) -> bool {
1330         if a.inner == b.inner { return true; }
1331         if a.inner.is_null() || b.inner.is_null() { return false; }
1332         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1333 }
1334 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
1335 /// This ignores pointers and is_owned flags and looks at the values in fields.
1336 /// Two objects with NULL inner values will be considered "equal" here.
1337 #[no_mangle]
1338 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
1339         if a.inner == b.inner { return true; }
1340         if a.inner.is_null() || b.inner.is_null() { return false; }
1341         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1342 }
1343 impl Clone for InitFeatures {
1344         fn clone(&self) -> Self {
1345                 Self {
1346                         inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1347                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1348                         is_owned: true,
1349                 }
1350         }
1351 }
1352 #[allow(unused)]
1353 /// Used only if an object of this type is returned as a trait impl by a method
1354 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1355         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
1356 }
1357 #[no_mangle]
1358 /// Creates a copy of the InitFeatures
1359 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1360         orig.clone()
1361 }
1362 impl Clone for NodeFeatures {
1363         fn clone(&self) -> Self {
1364                 Self {
1365                         inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1366                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1367                         is_owned: true,
1368                 }
1369         }
1370 }
1371 #[allow(unused)]
1372 /// Used only if an object of this type is returned as a trait impl by a method
1373 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1374         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
1375 }
1376 #[no_mangle]
1377 /// Creates a copy of the NodeFeatures
1378 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1379         orig.clone()
1380 }
1381 impl Clone for ChannelFeatures {
1382         fn clone(&self) -> Self {
1383                 Self {
1384                         inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1385                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1386                         is_owned: true,
1387                 }
1388         }
1389 }
1390 #[allow(unused)]
1391 /// Used only if an object of this type is returned as a trait impl by a method
1392 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1393         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
1394 }
1395 #[no_mangle]
1396 /// Creates a copy of the ChannelFeatures
1397 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1398         orig.clone()
1399 }
1400 impl Clone for Bolt11InvoiceFeatures {
1401         fn clone(&self) -> Self {
1402                 Self {
1403                         inner: if <*mut nativeBolt11InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1404                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1405                         is_owned: true,
1406                 }
1407         }
1408 }
1409 #[allow(unused)]
1410 /// Used only if an object of this type is returned as a trait impl by a method
1411 pub(crate) extern "C" fn Bolt11InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1412         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt11InvoiceFeatures)).clone() })) as *mut c_void
1413 }
1414 #[no_mangle]
1415 /// Creates a copy of the Bolt11InvoiceFeatures
1416 pub extern "C" fn Bolt11InvoiceFeatures_clone(orig: &Bolt11InvoiceFeatures) -> Bolt11InvoiceFeatures {
1417         orig.clone()
1418 }
1419 impl Clone for OfferFeatures {
1420         fn clone(&self) -> Self {
1421                 Self {
1422                         inner: if <*mut nativeOfferFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1423                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1424                         is_owned: true,
1425                 }
1426         }
1427 }
1428 #[allow(unused)]
1429 /// Used only if an object of this type is returned as a trait impl by a method
1430 pub(crate) extern "C" fn OfferFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1431         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOfferFeatures)).clone() })) as *mut c_void
1432 }
1433 #[no_mangle]
1434 /// Creates a copy of the OfferFeatures
1435 pub extern "C" fn OfferFeatures_clone(orig: &OfferFeatures) -> OfferFeatures {
1436         orig.clone()
1437 }
1438 impl Clone for InvoiceRequestFeatures {
1439         fn clone(&self) -> Self {
1440                 Self {
1441                         inner: if <*mut nativeInvoiceRequestFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1442                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1443                         is_owned: true,
1444                 }
1445         }
1446 }
1447 #[allow(unused)]
1448 /// Used only if an object of this type is returned as a trait impl by a method
1449 pub(crate) extern "C" fn InvoiceRequestFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1450         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
1451 }
1452 #[no_mangle]
1453 /// Creates a copy of the InvoiceRequestFeatures
1454 pub extern "C" fn InvoiceRequestFeatures_clone(orig: &InvoiceRequestFeatures) -> InvoiceRequestFeatures {
1455         orig.clone()
1456 }
1457 impl Clone for Bolt12InvoiceFeatures {
1458         fn clone(&self) -> Self {
1459                 Self {
1460                         inner: if <*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1461                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1462                         is_owned: true,
1463                 }
1464         }
1465 }
1466 #[allow(unused)]
1467 /// Used only if an object of this type is returned as a trait impl by a method
1468 pub(crate) extern "C" fn Bolt12InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1469         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt12InvoiceFeatures)).clone() })) as *mut c_void
1470 }
1471 #[no_mangle]
1472 /// Creates a copy of the Bolt12InvoiceFeatures
1473 pub extern "C" fn Bolt12InvoiceFeatures_clone(orig: &Bolt12InvoiceFeatures) -> Bolt12InvoiceFeatures {
1474         orig.clone()
1475 }
1476 impl Clone for BlindedHopFeatures {
1477         fn clone(&self) -> Self {
1478                 Self {
1479                         inner: if <*mut nativeBlindedHopFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1480                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1481                         is_owned: true,
1482                 }
1483         }
1484 }
1485 #[allow(unused)]
1486 /// Used only if an object of this type is returned as a trait impl by a method
1487 pub(crate) extern "C" fn BlindedHopFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1488         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBlindedHopFeatures)).clone() })) as *mut c_void
1489 }
1490 #[no_mangle]
1491 /// Creates a copy of the BlindedHopFeatures
1492 pub extern "C" fn BlindedHopFeatures_clone(orig: &BlindedHopFeatures) -> BlindedHopFeatures {
1493         orig.clone()
1494 }
1495 impl Clone for ChannelTypeFeatures {
1496         fn clone(&self) -> Self {
1497                 Self {
1498                         inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1499                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1500                         is_owned: true,
1501                 }
1502         }
1503 }
1504 #[allow(unused)]
1505 /// Used only if an object of this type is returned as a trait impl by a method
1506 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1507         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
1508 }
1509 #[no_mangle]
1510 /// Creates a copy of the ChannelTypeFeatures
1511 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1512         orig.clone()
1513 }
1514
1515 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1516 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1517
1518 /// Features used within an `init` message.
1519 #[must_use]
1520 #[repr(C)]
1521 pub struct InitFeatures {
1522         /// A pointer to the opaque Rust object.
1523
1524         /// Nearly everywhere, inner must be non-null, however in places where
1525         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1526         pub inner: *mut nativeInitFeatures,
1527         /// Indicates that this is the only struct which contains the same pointer.
1528
1529         /// Rust functions which take ownership of an object provided via an argument require
1530         /// this to be true and invalidate the object pointed to by inner.
1531         pub is_owned: bool,
1532 }
1533
1534 impl Drop for InitFeatures {
1535         fn drop(&mut self) {
1536                 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1537                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1538                 }
1539         }
1540 }
1541 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1542 #[no_mangle]
1543 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1544 #[allow(unused)]
1545 /// Used only if an object of this type is returned as a trait impl by a method
1546 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1547         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInitFeatures) };
1548 }
1549 #[allow(unused)]
1550 impl InitFeatures {
1551         pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1552                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1553         }
1554         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1555                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1556         }
1557         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1558         pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1559                 assert!(self.is_owned);
1560                 let ret = ObjOps::untweak_ptr(self.inner);
1561                 self.inner = core::ptr::null_mut();
1562                 ret
1563         }
1564 }
1565
1566 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1567 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1568
1569 /// Features used within a `node_announcement` message.
1570 #[must_use]
1571 #[repr(C)]
1572 pub struct NodeFeatures {
1573         /// A pointer to the opaque Rust object.
1574
1575         /// Nearly everywhere, inner must be non-null, however in places where
1576         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1577         pub inner: *mut nativeNodeFeatures,
1578         /// Indicates that this is the only struct which contains the same pointer.
1579
1580         /// Rust functions which take ownership of an object provided via an argument require
1581         /// this to be true and invalidate the object pointed to by inner.
1582         pub is_owned: bool,
1583 }
1584
1585 impl Drop for NodeFeatures {
1586         fn drop(&mut self) {
1587                 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1588                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1589                 }
1590         }
1591 }
1592 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1593 #[no_mangle]
1594 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1595 #[allow(unused)]
1596 /// Used only if an object of this type is returned as a trait impl by a method
1597 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1598         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeNodeFeatures) };
1599 }
1600 #[allow(unused)]
1601 impl NodeFeatures {
1602         pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1603                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1604         }
1605         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1606                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1607         }
1608         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1609         pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1610                 assert!(self.is_owned);
1611                 let ret = ObjOps::untweak_ptr(self.inner);
1612                 self.inner = core::ptr::null_mut();
1613                 ret
1614         }
1615 }
1616
1617 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1618 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1619
1620 /// Features used within a `channel_announcement` message.
1621 #[must_use]
1622 #[repr(C)]
1623 pub struct ChannelFeatures {
1624         /// A pointer to the opaque Rust object.
1625
1626         /// Nearly everywhere, inner must be non-null, however in places where
1627         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1628         pub inner: *mut nativeChannelFeatures,
1629         /// Indicates that this is the only struct which contains the same pointer.
1630
1631         /// Rust functions which take ownership of an object provided via an argument require
1632         /// this to be true and invalidate the object pointed to by inner.
1633         pub is_owned: bool,
1634 }
1635
1636 impl Drop for ChannelFeatures {
1637         fn drop(&mut self) {
1638                 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1639                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1640                 }
1641         }
1642 }
1643 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1644 #[no_mangle]
1645 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1646 #[allow(unused)]
1647 /// Used only if an object of this type is returned as a trait impl by a method
1648 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1649         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelFeatures) };
1650 }
1651 #[allow(unused)]
1652 impl ChannelFeatures {
1653         pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1654                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1655         }
1656         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1657                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1658         }
1659         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1660         pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1661                 assert!(self.is_owned);
1662                 let ret = ObjOps::untweak_ptr(self.inner);
1663                 self.inner = core::ptr::null_mut();
1664                 ret
1665         }
1666 }
1667
1668 use lightning::ln::features::Bolt11InvoiceFeatures as nativeBolt11InvoiceFeaturesImport;
1669 pub(crate) type nativeBolt11InvoiceFeatures = nativeBolt11InvoiceFeaturesImport;
1670
1671 /// Features used within an invoice.
1672 #[must_use]
1673 #[repr(C)]
1674 pub struct Bolt11InvoiceFeatures {
1675         /// A pointer to the opaque Rust object.
1676
1677         /// Nearly everywhere, inner must be non-null, however in places where
1678         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1679         pub inner: *mut nativeBolt11InvoiceFeatures,
1680         /// Indicates that this is the only struct which contains the same pointer.
1681
1682         /// Rust functions which take ownership of an object provided via an argument require
1683         /// this to be true and invalidate the object pointed to by inner.
1684         pub is_owned: bool,
1685 }
1686
1687 impl Drop for Bolt11InvoiceFeatures {
1688         fn drop(&mut self) {
1689                 if self.is_owned && !<*mut nativeBolt11InvoiceFeatures>::is_null(self.inner) {
1690                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1691                 }
1692         }
1693 }
1694 /// Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
1695 #[no_mangle]
1696 pub extern "C" fn Bolt11InvoiceFeatures_free(this_obj: Bolt11InvoiceFeatures) { }
1697 #[allow(unused)]
1698 /// Used only if an object of this type is returned as a trait impl by a method
1699 pub(crate) extern "C" fn Bolt11InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1700         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt11InvoiceFeatures) };
1701 }
1702 #[allow(unused)]
1703 impl Bolt11InvoiceFeatures {
1704         pub(crate) fn get_native_ref(&self) -> &'static nativeBolt11InvoiceFeatures {
1705                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1706         }
1707         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt11InvoiceFeatures {
1708                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1709         }
1710         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1711         pub(crate) fn take_inner(mut self) -> *mut nativeBolt11InvoiceFeatures {
1712                 assert!(self.is_owned);
1713                 let ret = ObjOps::untweak_ptr(self.inner);
1714                 self.inner = core::ptr::null_mut();
1715                 ret
1716         }
1717 }
1718
1719 use lightning::ln::features::OfferFeatures as nativeOfferFeaturesImport;
1720 pub(crate) type nativeOfferFeatures = nativeOfferFeaturesImport;
1721
1722 /// Features used within an `offer`.
1723 #[must_use]
1724 #[repr(C)]
1725 pub struct OfferFeatures {
1726         /// A pointer to the opaque Rust object.
1727
1728         /// Nearly everywhere, inner must be non-null, however in places where
1729         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1730         pub inner: *mut nativeOfferFeatures,
1731         /// Indicates that this is the only struct which contains the same pointer.
1732
1733         /// Rust functions which take ownership of an object provided via an argument require
1734         /// this to be true and invalidate the object pointed to by inner.
1735         pub is_owned: bool,
1736 }
1737
1738 impl Drop for OfferFeatures {
1739         fn drop(&mut self) {
1740                 if self.is_owned && !<*mut nativeOfferFeatures>::is_null(self.inner) {
1741                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1742                 }
1743         }
1744 }
1745 /// Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
1746 #[no_mangle]
1747 pub extern "C" fn OfferFeatures_free(this_obj: OfferFeatures) { }
1748 #[allow(unused)]
1749 /// Used only if an object of this type is returned as a trait impl by a method
1750 pub(crate) extern "C" fn OfferFeatures_free_void(this_ptr: *mut c_void) {
1751         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferFeatures) };
1752 }
1753 #[allow(unused)]
1754 impl OfferFeatures {
1755         pub(crate) fn get_native_ref(&self) -> &'static nativeOfferFeatures {
1756                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1757         }
1758         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferFeatures {
1759                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1760         }
1761         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1762         pub(crate) fn take_inner(mut self) -> *mut nativeOfferFeatures {
1763                 assert!(self.is_owned);
1764                 let ret = ObjOps::untweak_ptr(self.inner);
1765                 self.inner = core::ptr::null_mut();
1766                 ret
1767         }
1768 }
1769
1770 use lightning::ln::features::InvoiceRequestFeatures as nativeInvoiceRequestFeaturesImport;
1771 pub(crate) type nativeInvoiceRequestFeatures = nativeInvoiceRequestFeaturesImport;
1772
1773 /// Features used within an `invoice_request`.
1774 #[must_use]
1775 #[repr(C)]
1776 pub struct InvoiceRequestFeatures {
1777         /// A pointer to the opaque Rust object.
1778
1779         /// Nearly everywhere, inner must be non-null, however in places where
1780         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1781         pub inner: *mut nativeInvoiceRequestFeatures,
1782         /// Indicates that this is the only struct which contains the same pointer.
1783
1784         /// Rust functions which take ownership of an object provided via an argument require
1785         /// this to be true and invalidate the object pointed to by inner.
1786         pub is_owned: bool,
1787 }
1788
1789 impl Drop for InvoiceRequestFeatures {
1790         fn drop(&mut self) {
1791                 if self.is_owned && !<*mut nativeInvoiceRequestFeatures>::is_null(self.inner) {
1792                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1793                 }
1794         }
1795 }
1796 /// Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
1797 #[no_mangle]
1798 pub extern "C" fn InvoiceRequestFeatures_free(this_obj: InvoiceRequestFeatures) { }
1799 #[allow(unused)]
1800 /// Used only if an object of this type is returned as a trait impl by a method
1801 pub(crate) extern "C" fn InvoiceRequestFeatures_free_void(this_ptr: *mut c_void) {
1802         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceRequestFeatures) };
1803 }
1804 #[allow(unused)]
1805 impl InvoiceRequestFeatures {
1806         pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceRequestFeatures {
1807                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1808         }
1809         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceRequestFeatures {
1810                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1811         }
1812         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1813         pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceRequestFeatures {
1814                 assert!(self.is_owned);
1815                 let ret = ObjOps::untweak_ptr(self.inner);
1816                 self.inner = core::ptr::null_mut();
1817                 ret
1818         }
1819 }
1820
1821 use lightning::ln::features::Bolt12InvoiceFeatures as nativeBolt12InvoiceFeaturesImport;
1822 pub(crate) type nativeBolt12InvoiceFeatures = nativeBolt12InvoiceFeaturesImport;
1823
1824 /// Features used within an `invoice`.
1825 #[must_use]
1826 #[repr(C)]
1827 pub struct Bolt12InvoiceFeatures {
1828         /// A pointer to the opaque Rust object.
1829
1830         /// Nearly everywhere, inner must be non-null, however in places where
1831         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1832         pub inner: *mut nativeBolt12InvoiceFeatures,
1833         /// Indicates that this is the only struct which contains the same pointer.
1834
1835         /// Rust functions which take ownership of an object provided via an argument require
1836         /// this to be true and invalidate the object pointed to by inner.
1837         pub is_owned: bool,
1838 }
1839
1840 impl Drop for Bolt12InvoiceFeatures {
1841         fn drop(&mut self) {
1842                 if self.is_owned && !<*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) {
1843                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1844                 }
1845         }
1846 }
1847 /// Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
1848 #[no_mangle]
1849 pub extern "C" fn Bolt12InvoiceFeatures_free(this_obj: Bolt12InvoiceFeatures) { }
1850 #[allow(unused)]
1851 /// Used only if an object of this type is returned as a trait impl by a method
1852 pub(crate) extern "C" fn Bolt12InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1853         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt12InvoiceFeatures) };
1854 }
1855 #[allow(unused)]
1856 impl Bolt12InvoiceFeatures {
1857         pub(crate) fn get_native_ref(&self) -> &'static nativeBolt12InvoiceFeatures {
1858                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1859         }
1860         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt12InvoiceFeatures {
1861                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1862         }
1863         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1864         pub(crate) fn take_inner(mut self) -> *mut nativeBolt12InvoiceFeatures {
1865                 assert!(self.is_owned);
1866                 let ret = ObjOps::untweak_ptr(self.inner);
1867                 self.inner = core::ptr::null_mut();
1868                 ret
1869         }
1870 }
1871
1872 use lightning::ln::features::BlindedHopFeatures as nativeBlindedHopFeaturesImport;
1873 pub(crate) type nativeBlindedHopFeatures = nativeBlindedHopFeaturesImport;
1874
1875 /// Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
1876 #[must_use]
1877 #[repr(C)]
1878 pub struct BlindedHopFeatures {
1879         /// A pointer to the opaque Rust object.
1880
1881         /// Nearly everywhere, inner must be non-null, however in places where
1882         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1883         pub inner: *mut nativeBlindedHopFeatures,
1884         /// Indicates that this is the only struct which contains the same pointer.
1885
1886         /// Rust functions which take ownership of an object provided via an argument require
1887         /// this to be true and invalidate the object pointed to by inner.
1888         pub is_owned: bool,
1889 }
1890
1891 impl Drop for BlindedHopFeatures {
1892         fn drop(&mut self) {
1893                 if self.is_owned && !<*mut nativeBlindedHopFeatures>::is_null(self.inner) {
1894                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1895                 }
1896         }
1897 }
1898 /// Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
1899 #[no_mangle]
1900 pub extern "C" fn BlindedHopFeatures_free(this_obj: BlindedHopFeatures) { }
1901 #[allow(unused)]
1902 /// Used only if an object of this type is returned as a trait impl by a method
1903 pub(crate) extern "C" fn BlindedHopFeatures_free_void(this_ptr: *mut c_void) {
1904         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBlindedHopFeatures) };
1905 }
1906 #[allow(unused)]
1907 impl BlindedHopFeatures {
1908         pub(crate) fn get_native_ref(&self) -> &'static nativeBlindedHopFeatures {
1909                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1910         }
1911         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBlindedHopFeatures {
1912                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1913         }
1914         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1915         pub(crate) fn take_inner(mut self) -> *mut nativeBlindedHopFeatures {
1916                 assert!(self.is_owned);
1917                 let ret = ObjOps::untweak_ptr(self.inner);
1918                 self.inner = core::ptr::null_mut();
1919                 ret
1920         }
1921 }
1922
1923 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
1924 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
1925
1926 /// Features used within the channel_type field in an OpenChannel message.
1927 ///
1928 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
1929 /// semantics of our interaction with our peer.
1930 ///
1931 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
1932 /// the counterparty, only required features are allowed here.
1933 ///
1934 /// This is serialized differently from other feature types - it is not prefixed by a length, and
1935 /// thus must only appear inside a TLV where its length is known in advance.
1936 #[must_use]
1937 #[repr(C)]
1938 pub struct ChannelTypeFeatures {
1939         /// A pointer to the opaque Rust object.
1940
1941         /// Nearly everywhere, inner must be non-null, however in places where
1942         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1943         pub inner: *mut nativeChannelTypeFeatures,
1944         /// Indicates that this is the only struct which contains the same pointer.
1945
1946         /// Rust functions which take ownership of an object provided via an argument require
1947         /// this to be true and invalidate the object pointed to by inner.
1948         pub is_owned: bool,
1949 }
1950
1951 impl Drop for ChannelTypeFeatures {
1952         fn drop(&mut self) {
1953                 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
1954                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1955                 }
1956         }
1957 }
1958 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
1959 #[no_mangle]
1960 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
1961 #[allow(unused)]
1962 /// Used only if an object of this type is returned as a trait impl by a method
1963 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
1964         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures) };
1965 }
1966 #[allow(unused)]
1967 impl ChannelTypeFeatures {
1968         pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
1969                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1970         }
1971         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
1972                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1973         }
1974         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1975         pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
1976                 assert!(self.is_owned);
1977                 let ret = ObjOps::untweak_ptr(self.inner);
1978                 self.inner = core::ptr::null_mut();
1979                 ret
1980         }
1981 }
1982 /// Create a blank Features with no features set
1983 #[must_use]
1984 #[no_mangle]
1985 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
1986         let mut ret = lightning::ln::features::InitFeatures::empty();
1987         crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1988 }
1989
1990 /// Returns true if this `Features` object contains required features unknown by `other`.
1991 #[must_use]
1992 #[no_mangle]
1993 pub extern "C" fn InitFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InitFeatures, other: &crate::lightning::ln::features::InitFeatures) -> bool {
1994         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
1995         ret
1996 }
1997
1998 /// Returns true if this `Features` object contains unknown feature flags which are set as
1999 /// \"required\".
2000 #[must_use]
2001 #[no_mangle]
2002 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
2003         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2004         ret
2005 }
2006
2007 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2008 /// by [bLIP 2] or if it is a known `T` feature.
2009 ///
2010 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2011 /// be set instead (i.e., `bit - 1`).
2012 ///
2013 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2014 #[must_use]
2015 #[no_mangle]
2016 pub extern "C" fn InitFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::InitFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2017         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_required_custom_bit(bit);
2018         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2019         local_ret
2020 }
2021
2022 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2023 /// by [bLIP 2] or if it is a known `T` feature.
2024 ///
2025 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2026 /// set instead (i.e., `bit + 1`).
2027 ///
2028 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2029 #[must_use]
2030 #[no_mangle]
2031 pub extern "C" fn InitFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::InitFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2032         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_optional_custom_bit(bit);
2033         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2034         local_ret
2035 }
2036
2037 /// Create a blank Features with no features set
2038 #[must_use]
2039 #[no_mangle]
2040 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
2041         let mut ret = lightning::ln::features::NodeFeatures::empty();
2042         crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2043 }
2044
2045 /// Returns true if this `Features` object contains required features unknown by `other`.
2046 #[must_use]
2047 #[no_mangle]
2048 pub extern "C" fn NodeFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::NodeFeatures, other: &crate::lightning::ln::features::NodeFeatures) -> bool {
2049         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2050         ret
2051 }
2052
2053 /// Returns true if this `Features` object contains unknown feature flags which are set as
2054 /// \"required\".
2055 #[must_use]
2056 #[no_mangle]
2057 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
2058         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2059         ret
2060 }
2061
2062 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2063 /// by [bLIP 2] or if it is a known `T` feature.
2064 ///
2065 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2066 /// be set instead (i.e., `bit - 1`).
2067 ///
2068 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2069 #[must_use]
2070 #[no_mangle]
2071 pub extern "C" fn NodeFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::NodeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2072         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_required_custom_bit(bit);
2073         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2074         local_ret
2075 }
2076
2077 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2078 /// by [bLIP 2] or if it is a known `T` feature.
2079 ///
2080 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2081 /// set instead (i.e., `bit + 1`).
2082 ///
2083 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2084 #[must_use]
2085 #[no_mangle]
2086 pub extern "C" fn NodeFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::NodeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2087         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_optional_custom_bit(bit);
2088         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2089         local_ret
2090 }
2091
2092 /// Create a blank Features with no features set
2093 #[must_use]
2094 #[no_mangle]
2095 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
2096         let mut ret = lightning::ln::features::ChannelFeatures::empty();
2097         crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2098 }
2099
2100 /// Returns true if this `Features` object contains required features unknown by `other`.
2101 #[must_use]
2102 #[no_mangle]
2103 pub extern "C" fn ChannelFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelFeatures, other: &crate::lightning::ln::features::ChannelFeatures) -> bool {
2104         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2105         ret
2106 }
2107
2108 /// Returns true if this `Features` object contains unknown feature flags which are set as
2109 /// \"required\".
2110 #[must_use]
2111 #[no_mangle]
2112 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
2113         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2114         ret
2115 }
2116
2117 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2118 /// by [bLIP 2] or if it is a known `T` feature.
2119 ///
2120 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2121 /// be set instead (i.e., `bit - 1`).
2122 ///
2123 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2124 #[must_use]
2125 #[no_mangle]
2126 pub extern "C" fn ChannelFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2127         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_required_custom_bit(bit);
2128         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2129         local_ret
2130 }
2131
2132 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2133 /// by [bLIP 2] or if it is a known `T` feature.
2134 ///
2135 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2136 /// set instead (i.e., `bit + 1`).
2137 ///
2138 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2139 #[must_use]
2140 #[no_mangle]
2141 pub extern "C" fn ChannelFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2142         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_optional_custom_bit(bit);
2143         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2144         local_ret
2145 }
2146
2147 /// Create a blank Features with no features set
2148 #[must_use]
2149 #[no_mangle]
2150 pub extern "C" fn Bolt11InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt11InvoiceFeatures {
2151         let mut ret = lightning::ln::features::Bolt11InvoiceFeatures::empty();
2152         crate::lightning::ln::features::Bolt11InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2153 }
2154
2155 /// Returns true if this `Features` object contains required features unknown by `other`.
2156 #[must_use]
2157 #[no_mangle]
2158 pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures, other: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
2159         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2160         ret
2161 }
2162
2163 /// Returns true if this `Features` object contains unknown feature flags which are set as
2164 /// \"required\".
2165 #[must_use]
2166 #[no_mangle]
2167 pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
2168         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2169         ret
2170 }
2171
2172 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2173 /// by [bLIP 2] or if it is a known `T` feature.
2174 ///
2175 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2176 /// be set instead (i.e., `bit - 1`).
2177 ///
2178 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2179 #[must_use]
2180 #[no_mangle]
2181 pub extern "C" fn Bolt11InvoiceFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2182         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_required_custom_bit(bit);
2183         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2184         local_ret
2185 }
2186
2187 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2188 /// by [bLIP 2] or if it is a known `T` feature.
2189 ///
2190 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2191 /// set instead (i.e., `bit + 1`).
2192 ///
2193 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2194 #[must_use]
2195 #[no_mangle]
2196 pub extern "C" fn Bolt11InvoiceFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2197         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_optional_custom_bit(bit);
2198         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2199         local_ret
2200 }
2201
2202 /// Create a blank Features with no features set
2203 #[must_use]
2204 #[no_mangle]
2205 pub extern "C" fn OfferFeatures_empty() -> crate::lightning::ln::features::OfferFeatures {
2206         let mut ret = lightning::ln::features::OfferFeatures::empty();
2207         crate::lightning::ln::features::OfferFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2208 }
2209
2210 /// Returns true if this `Features` object contains required features unknown by `other`.
2211 #[must_use]
2212 #[no_mangle]
2213 pub extern "C" fn OfferFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::OfferFeatures, other: &crate::lightning::ln::features::OfferFeatures) -> bool {
2214         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2215         ret
2216 }
2217
2218 /// Returns true if this `Features` object contains unknown feature flags which are set as
2219 /// \"required\".
2220 #[must_use]
2221 #[no_mangle]
2222 pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::OfferFeatures) -> bool {
2223         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2224         ret
2225 }
2226
2227 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2228 /// by [bLIP 2] or if it is a known `T` feature.
2229 ///
2230 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2231 /// be set instead (i.e., `bit - 1`).
2232 ///
2233 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2234 #[must_use]
2235 #[no_mangle]
2236 pub extern "C" fn OfferFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::OfferFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2237         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_required_custom_bit(bit);
2238         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2239         local_ret
2240 }
2241
2242 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2243 /// by [bLIP 2] or if it is a known `T` feature.
2244 ///
2245 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2246 /// set instead (i.e., `bit + 1`).
2247 ///
2248 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2249 #[must_use]
2250 #[no_mangle]
2251 pub extern "C" fn OfferFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::OfferFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2252         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_optional_custom_bit(bit);
2253         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2254         local_ret
2255 }
2256
2257 /// Create a blank Features with no features set
2258 #[must_use]
2259 #[no_mangle]
2260 pub extern "C" fn InvoiceRequestFeatures_empty() -> crate::lightning::ln::features::InvoiceRequestFeatures {
2261         let mut ret = lightning::ln::features::InvoiceRequestFeatures::empty();
2262         crate::lightning::ln::features::InvoiceRequestFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2263 }
2264
2265 /// Returns true if this `Features` object contains required features unknown by `other`.
2266 #[must_use]
2267 #[no_mangle]
2268 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures, other: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
2269         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2270         ret
2271 }
2272
2273 /// Returns true if this `Features` object contains unknown feature flags which are set as
2274 /// \"required\".
2275 #[must_use]
2276 #[no_mangle]
2277 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
2278         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2279         ret
2280 }
2281
2282 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2283 /// by [bLIP 2] or if it is a known `T` feature.
2284 ///
2285 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2286 /// be set instead (i.e., `bit - 1`).
2287 ///
2288 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2289 #[must_use]
2290 #[no_mangle]
2291 pub extern "C" fn InvoiceRequestFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::InvoiceRequestFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2292         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_required_custom_bit(bit);
2293         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2294         local_ret
2295 }
2296
2297 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2298 /// by [bLIP 2] or if it is a known `T` feature.
2299 ///
2300 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2301 /// set instead (i.e., `bit + 1`).
2302 ///
2303 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2304 #[must_use]
2305 #[no_mangle]
2306 pub extern "C" fn InvoiceRequestFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::InvoiceRequestFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2307         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_optional_custom_bit(bit);
2308         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2309         local_ret
2310 }
2311
2312 /// Create a blank Features with no features set
2313 #[must_use]
2314 #[no_mangle]
2315 pub extern "C" fn Bolt12InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt12InvoiceFeatures {
2316         let mut ret = lightning::ln::features::Bolt12InvoiceFeatures::empty();
2317         crate::lightning::ln::features::Bolt12InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2318 }
2319
2320 /// Returns true if this `Features` object contains required features unknown by `other`.
2321 #[must_use]
2322 #[no_mangle]
2323 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures, other: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2324         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2325         ret
2326 }
2327
2328 /// Returns true if this `Features` object contains unknown feature flags which are set as
2329 /// \"required\".
2330 #[must_use]
2331 #[no_mangle]
2332 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2333         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2334         ret
2335 }
2336
2337 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2338 /// by [bLIP 2] or if it is a known `T` feature.
2339 ///
2340 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2341 /// be set instead (i.e., `bit - 1`).
2342 ///
2343 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2344 #[must_use]
2345 #[no_mangle]
2346 pub extern "C" fn Bolt12InvoiceFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2347         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_required_custom_bit(bit);
2348         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2349         local_ret
2350 }
2351
2352 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2353 /// by [bLIP 2] or if it is a known `T` feature.
2354 ///
2355 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2356 /// set instead (i.e., `bit + 1`).
2357 ///
2358 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2359 #[must_use]
2360 #[no_mangle]
2361 pub extern "C" fn Bolt12InvoiceFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2362         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_optional_custom_bit(bit);
2363         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2364         local_ret
2365 }
2366
2367 /// Create a blank Features with no features set
2368 #[must_use]
2369 #[no_mangle]
2370 pub extern "C" fn BlindedHopFeatures_empty() -> crate::lightning::ln::features::BlindedHopFeatures {
2371         let mut ret = lightning::ln::features::BlindedHopFeatures::empty();
2372         crate::lightning::ln::features::BlindedHopFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2373 }
2374
2375 /// Returns true if this `Features` object contains required features unknown by `other`.
2376 #[must_use]
2377 #[no_mangle]
2378 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::BlindedHopFeatures, other: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2379         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2380         ret
2381 }
2382
2383 /// Returns true if this `Features` object contains unknown feature flags which are set as
2384 /// \"required\".
2385 #[must_use]
2386 #[no_mangle]
2387 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2388         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2389         ret
2390 }
2391
2392 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2393 /// by [bLIP 2] or if it is a known `T` feature.
2394 ///
2395 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2396 /// be set instead (i.e., `bit - 1`).
2397 ///
2398 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2399 #[must_use]
2400 #[no_mangle]
2401 pub extern "C" fn BlindedHopFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::BlindedHopFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2402         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_required_custom_bit(bit);
2403         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2404         local_ret
2405 }
2406
2407 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2408 /// by [bLIP 2] or if it is a known `T` feature.
2409 ///
2410 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2411 /// set instead (i.e., `bit + 1`).
2412 ///
2413 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2414 #[must_use]
2415 #[no_mangle]
2416 pub extern "C" fn BlindedHopFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::BlindedHopFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2417         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_optional_custom_bit(bit);
2418         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2419         local_ret
2420 }
2421
2422 /// Create a blank Features with no features set
2423 #[must_use]
2424 #[no_mangle]
2425 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
2426         let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
2427         crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2428 }
2429
2430 /// Returns true if this `Features` object contains required features unknown by `other`.
2431 #[must_use]
2432 #[no_mangle]
2433 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures, other: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2434         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2435         ret
2436 }
2437
2438 /// Returns true if this `Features` object contains unknown feature flags which are set as
2439 /// \"required\".
2440 #[must_use]
2441 #[no_mangle]
2442 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
2443         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2444         ret
2445 }
2446
2447 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2448 /// by [bLIP 2] or if it is a known `T` feature.
2449 ///
2450 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2451 /// be set instead (i.e., `bit - 1`).
2452 ///
2453 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2454 #[must_use]
2455 #[no_mangle]
2456 pub extern "C" fn ChannelTypeFeatures_set_required_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2457         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_required_custom_bit(bit);
2458         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2459         local_ret
2460 }
2461
2462 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2463 /// by [bLIP 2] or if it is a known `T` feature.
2464 ///
2465 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2466 /// set instead (i.e., `bit + 1`).
2467 ///
2468 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2469 #[must_use]
2470 #[no_mangle]
2471 pub extern "C" fn ChannelTypeFeatures_set_optional_custom_bit(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2472         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_optional_custom_bit(bit);
2473         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
2474         local_ret
2475 }
2476
2477 #[no_mangle]
2478 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
2479 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
2480         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2481 }
2482 #[no_mangle]
2483 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2484         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
2485 }
2486 #[no_mangle]
2487 /// Read a InitFeatures from a byte array, created by InitFeatures_write
2488 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
2489         let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2490         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() };
2491         local_res
2492 }
2493 #[no_mangle]
2494 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
2495 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
2496         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2497 }
2498 #[no_mangle]
2499 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2500         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
2501 }
2502 #[no_mangle]
2503 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
2504 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
2505         let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2506         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() };
2507         local_res
2508 }
2509 #[no_mangle]
2510 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
2511 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
2512         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2513 }
2514 #[no_mangle]
2515 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2516         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
2517 }
2518 #[no_mangle]
2519 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
2520 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
2521         let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2522         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() };
2523         local_res
2524 }
2525 #[no_mangle]
2526 /// Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
2527 pub extern "C" fn Bolt11InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
2528         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2529 }
2530 #[no_mangle]
2531 pub(crate) extern "C" fn Bolt11InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2532         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt11InvoiceFeatures) })
2533 }
2534 #[no_mangle]
2535 /// Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
2536 pub extern "C" fn Bolt11InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_Bolt11InvoiceFeaturesDecodeErrorZ {
2537         let res: Result<lightning::ln::features::Bolt11InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2538         let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::Bolt11InvoiceFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
2539         local_res
2540 }
2541 #[no_mangle]
2542 /// Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
2543 pub extern "C" fn Bolt12InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
2544         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2545 }
2546 #[no_mangle]
2547 pub(crate) extern "C" fn Bolt12InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2548         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt12InvoiceFeatures) })
2549 }
2550 #[no_mangle]
2551 /// Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
2552 pub extern "C" fn Bolt12InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_Bolt12InvoiceFeaturesDecodeErrorZ {
2553         let res: Result<lightning::ln::features::Bolt12InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2554         let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::Bolt12InvoiceFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
2555         local_res
2556 }
2557 #[no_mangle]
2558 /// Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
2559 pub extern "C" fn BlindedHopFeatures_write(obj: &crate::lightning::ln::features::BlindedHopFeatures) -> crate::c_types::derived::CVec_u8Z {
2560         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2561 }
2562 #[no_mangle]
2563 pub(crate) extern "C" fn BlindedHopFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2564         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedHopFeatures) })
2565 }
2566 #[no_mangle]
2567 /// Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
2568 pub extern "C" fn BlindedHopFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_BlindedHopFeaturesDecodeErrorZ {
2569         let res: Result<lightning::ln::features::BlindedHopFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2570         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() };
2571         local_res
2572 }
2573 #[no_mangle]
2574 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
2575 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
2576         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
2577 }
2578 #[no_mangle]
2579 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
2580         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
2581 }
2582 #[no_mangle]
2583 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
2584 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
2585         let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
2586         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() };
2587         local_res
2588 }