Pin compiler_builtins to 0.1.109 when building std
[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 //! - `AnchorsZeroFeeHtlcTx` - requires/supports that commitment transactions include anchor outputs
44 //!     and HTLC transactions are pre-signed with zero fee (see
45 //!     [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more
46 //!     information).
47 //! - `RouteBlinding` - requires/supports that a node can relay payments over blinded paths
48 //!     (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#route-blinding) for more information).
49 //! - `ShutdownAnySegwit` - requires/supports that future segwit versions are allowed in `shutdown`
50 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
51 //! - `OnionMessages` - requires/supports forwarding onion messages
52 //!     (see [BOLT-7](https://github.com/lightning/bolts/pull/759/files) for more information).
53 //! - `ChannelType` - node supports the channel_type field in open/accept
54 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
55 //! - `SCIDPrivacy` - supply channel aliases for routing
56 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
57 //! - `PaymentMetadata` - include additional data in invoices which is passed to recipients in the
58 //!      onion.
59 //!      (see [BOLT-11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) for
60 //!      more).
61 //! - `ZeroConf` - supports accepting HTLCs and using channels prior to funding confirmation
62 //!      (see
63 //!      [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message)
64 //!      for more info).
65 //! - `Keysend` - send funds to a node without an invoice
66 //!     (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
67 //! - `Trampoline` - supports receiving and forwarding Trampoline payments
68 //!     (see the [`Trampoline` feature proposal](https://github.com/lightning/bolts/pull/836) for more information).
69 //!
70 //! LDK knows about the following features, but does not support them:
71 //! - `AnchorsNonzeroFeeHtlcTx` - the initial version of anchor outputs, which was later found to be
72 //!     vulnerable (see this
73 //!     [mailing list post](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html)
74 //!     for more information).
75 //!
76 //! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
77 //! [messages]: crate::ln::msgs
78
79 use alloc::str::FromStr;
80 use alloc::string::String;
81 use core::ffi::c_void;
82 use core::convert::Infallible;
83 use bitcoin::hashes::Hash;
84 use crate::c_types::*;
85 #[cfg(feature="no-std")]
86 use alloc::{vec::Vec, boxed::Box};
87
88 mod sealed {
89
90 use alloc::str::FromStr;
91 use alloc::string::String;
92 use core::ffi::c_void;
93 use core::convert::Infallible;
94 use bitcoin::hashes::Hash;
95 use crate::c_types::*;
96 #[cfg(feature="no-std")]
97 use alloc::{vec::Vec, boxed::Box};
98
99 /// Set this feature as optional.
100 #[no_mangle]
101 pub extern "C" fn InitFeatures_set_data_loss_protect_optional(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_optional()
103 }
104
105 /// Set this feature as required.
106 #[no_mangle]
107 pub extern "C" fn InitFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
108         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_data_loss_protect_required()
109 }
110
111 /// Checks if this feature is supported.
112 #[must_use]
113 #[no_mangle]
114 pub extern "C" fn InitFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
115         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
116         ret
117 }
118
119 /// Set this feature as optional.
120 #[no_mangle]
121 pub extern "C" fn NodeFeatures_set_data_loss_protect_optional(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_optional()
123 }
124
125 /// Set this feature as required.
126 #[no_mangle]
127 pub extern "C" fn NodeFeatures_set_data_loss_protect_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
128         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_data_loss_protect_required()
129 }
130
131 /// Checks if this feature is supported.
132 #[must_use]
133 #[no_mangle]
134 pub extern "C" fn NodeFeatures_supports_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
135         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_data_loss_protect();
136         ret
137 }
138
139 /// Checks if this feature is required.
140 #[must_use]
141 #[no_mangle]
142 pub extern "C" fn InitFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
143         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
144         ret
145 }
146
147 /// Checks if this feature is required.
148 #[must_use]
149 #[no_mangle]
150 pub extern "C" fn NodeFeatures_requires_data_loss_protect(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
151         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_data_loss_protect();
152         ret
153 }
154
155 /// Set this feature as optional.
156 #[no_mangle]
157 pub extern "C" fn InitFeatures_set_initial_routing_sync_optional(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_optional()
159 }
160
161 /// Set this feature as required.
162 #[no_mangle]
163 pub extern "C" fn InitFeatures_set_initial_routing_sync_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
164         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_initial_routing_sync_required()
165 }
166
167 /// Checks if this feature is supported.
168 #[must_use]
169 #[no_mangle]
170 pub extern "C" fn InitFeatures_initial_routing_sync(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
171         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.initial_routing_sync();
172         ret
173 }
174
175 /// Set this feature as optional.
176 #[no_mangle]
177 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_optional(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_optional()
179 }
180
181 /// Set this feature as required.
182 #[no_mangle]
183 pub extern "C" fn InitFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
184         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_upfront_shutdown_script_required()
185 }
186
187 /// Checks if this feature is supported.
188 #[must_use]
189 #[no_mangle]
190 pub extern "C" fn InitFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
191         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
192         ret
193 }
194
195 /// Set this feature as optional.
196 #[no_mangle]
197 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_optional(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_optional()
199 }
200
201 /// Set this feature as required.
202 #[no_mangle]
203 pub extern "C" fn NodeFeatures_set_upfront_shutdown_script_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
204         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_upfront_shutdown_script_required()
205 }
206
207 /// Checks if this feature is supported.
208 #[must_use]
209 #[no_mangle]
210 pub extern "C" fn NodeFeatures_supports_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
211         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_upfront_shutdown_script();
212         ret
213 }
214
215 /// Checks if this feature is required.
216 #[must_use]
217 #[no_mangle]
218 pub extern "C" fn InitFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
219         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
220         ret
221 }
222
223 /// Checks if this feature is required.
224 #[must_use]
225 #[no_mangle]
226 pub extern "C" fn NodeFeatures_requires_upfront_shutdown_script(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
227         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_upfront_shutdown_script();
228         ret
229 }
230
231 /// Set this feature as optional.
232 #[no_mangle]
233 pub extern "C" fn InitFeatures_set_gossip_queries_optional(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_optional()
235 }
236
237 /// Set this feature as required.
238 #[no_mangle]
239 pub extern "C" fn InitFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
240         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_gossip_queries_required()
241 }
242
243 /// Checks if this feature is supported.
244 #[must_use]
245 #[no_mangle]
246 pub extern "C" fn InitFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
247         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
248         ret
249 }
250
251 /// Set this feature as optional.
252 #[no_mangle]
253 pub extern "C" fn NodeFeatures_set_gossip_queries_optional(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_optional()
255 }
256
257 /// Set this feature as required.
258 #[no_mangle]
259 pub extern "C" fn NodeFeatures_set_gossip_queries_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
260         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_gossip_queries_required()
261 }
262
263 /// Checks if this feature is supported.
264 #[must_use]
265 #[no_mangle]
266 pub extern "C" fn NodeFeatures_supports_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
267         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_gossip_queries();
268         ret
269 }
270
271 /// Checks if this feature is required.
272 #[must_use]
273 #[no_mangle]
274 pub extern "C" fn InitFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
275         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
276         ret
277 }
278
279 /// Checks if this feature is required.
280 #[must_use]
281 #[no_mangle]
282 pub extern "C" fn NodeFeatures_requires_gossip_queries(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
283         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_gossip_queries();
284         ret
285 }
286
287 /// Set this feature as optional.
288 #[no_mangle]
289 pub extern "C" fn InitFeatures_set_variable_length_onion_optional(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_optional()
291 }
292
293 /// Set this feature as required.
294 #[no_mangle]
295 pub extern "C" fn InitFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
296         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_variable_length_onion_required()
297 }
298
299 /// Checks if this feature is supported.
300 #[must_use]
301 #[no_mangle]
302 pub extern "C" fn InitFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
303         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
304         ret
305 }
306
307 /// Set this feature as optional.
308 #[no_mangle]
309 pub extern "C" fn NodeFeatures_set_variable_length_onion_optional(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_optional()
311 }
312
313 /// Set this feature as required.
314 #[no_mangle]
315 pub extern "C" fn NodeFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
316         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_variable_length_onion_required()
317 }
318
319 /// Checks if this feature is supported.
320 #[must_use]
321 #[no_mangle]
322 pub extern "C" fn NodeFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
323         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
324         ret
325 }
326
327 /// Set this feature as optional.
328 #[no_mangle]
329 pub extern "C" fn Bolt11InvoiceFeatures_set_variable_length_onion_optional(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_optional()
331 }
332
333 /// Set this feature as required.
334 #[no_mangle]
335 pub extern "C" fn Bolt11InvoiceFeatures_set_variable_length_onion_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
336         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_variable_length_onion_required()
337 }
338
339 /// Checks if this feature is supported.
340 #[must_use]
341 #[no_mangle]
342 pub extern "C" fn Bolt11InvoiceFeatures_supports_variable_length_onion(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
343         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_variable_length_onion();
344         ret
345 }
346
347 /// Checks if this feature is required.
348 #[must_use]
349 #[no_mangle]
350 pub extern "C" fn InitFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
351         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
352         ret
353 }
354
355 /// Checks if this feature is required.
356 #[must_use]
357 #[no_mangle]
358 pub extern "C" fn NodeFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
359         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
360         ret
361 }
362
363 /// Checks if this feature is required.
364 #[must_use]
365 #[no_mangle]
366 pub extern "C" fn Bolt11InvoiceFeatures_requires_variable_length_onion(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
367         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_variable_length_onion();
368         ret
369 }
370
371 /// Set this feature as optional.
372 #[no_mangle]
373 pub extern "C" fn InitFeatures_set_static_remote_key_optional(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_optional()
375 }
376
377 /// Set this feature as required.
378 #[no_mangle]
379 pub extern "C" fn InitFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
380         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_static_remote_key_required()
381 }
382
383 /// Checks if this feature is supported.
384 #[must_use]
385 #[no_mangle]
386 pub extern "C" fn InitFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
387         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
388         ret
389 }
390
391 /// Set this feature as optional.
392 #[no_mangle]
393 pub extern "C" fn NodeFeatures_set_static_remote_key_optional(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_optional()
395 }
396
397 /// Set this feature as required.
398 #[no_mangle]
399 pub extern "C" fn NodeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
400         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_static_remote_key_required()
401 }
402
403 /// Checks if this feature is supported.
404 #[must_use]
405 #[no_mangle]
406 pub extern "C" fn NodeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
407         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
408         ret
409 }
410
411 /// Set this feature as optional.
412 #[no_mangle]
413 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_optional(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_optional()
415 }
416
417 /// Set this feature as required.
418 #[no_mangle]
419 pub extern "C" fn ChannelTypeFeatures_set_static_remote_key_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
420         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_static_remote_key_required()
421 }
422
423 /// Checks if this feature is supported.
424 #[must_use]
425 #[no_mangle]
426 pub extern "C" fn ChannelTypeFeatures_supports_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
427         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_static_remote_key();
428         ret
429 }
430
431 /// Checks if this feature is required.
432 #[must_use]
433 #[no_mangle]
434 pub extern "C" fn InitFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
435         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
436         ret
437 }
438
439 /// Checks if this feature is required.
440 #[must_use]
441 #[no_mangle]
442 pub extern "C" fn NodeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
443         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
444         ret
445 }
446
447 /// Checks if this feature is required.
448 #[must_use]
449 #[no_mangle]
450 pub extern "C" fn ChannelTypeFeatures_requires_static_remote_key(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
451         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_static_remote_key();
452         ret
453 }
454
455 /// Set this feature as optional.
456 #[no_mangle]
457 pub extern "C" fn InitFeatures_set_payment_secret_optional(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_optional()
459 }
460
461 /// Set this feature as required.
462 #[no_mangle]
463 pub extern "C" fn InitFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
464         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_payment_secret_required()
465 }
466
467 /// Checks if this feature is supported.
468 #[must_use]
469 #[no_mangle]
470 pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
471         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
472         ret
473 }
474
475 /// Set this feature as optional.
476 #[no_mangle]
477 pub extern "C" fn NodeFeatures_set_payment_secret_optional(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_optional()
479 }
480
481 /// Set this feature as required.
482 #[no_mangle]
483 pub extern "C" fn NodeFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
484         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_payment_secret_required()
485 }
486
487 /// Checks if this feature is supported.
488 #[must_use]
489 #[no_mangle]
490 pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
491         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
492         ret
493 }
494
495 /// Set this feature as optional.
496 #[no_mangle]
497 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_secret_optional(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_optional()
499 }
500
501 /// Set this feature as required.
502 #[no_mangle]
503 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_secret_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
504         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_secret_required()
505 }
506
507 /// Checks if this feature is supported.
508 #[must_use]
509 #[no_mangle]
510 pub extern "C" fn Bolt11InvoiceFeatures_supports_payment_secret(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
511         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
512         ret
513 }
514
515 /// Checks if this feature is required.
516 #[must_use]
517 #[no_mangle]
518 pub extern "C" fn InitFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
519         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
520         ret
521 }
522
523 /// Checks if this feature is required.
524 #[must_use]
525 #[no_mangle]
526 pub extern "C" fn NodeFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
527         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
528         ret
529 }
530
531 /// Checks if this feature is required.
532 #[must_use]
533 #[no_mangle]
534 pub extern "C" fn Bolt11InvoiceFeatures_requires_payment_secret(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
535         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_secret();
536         ret
537 }
538
539 /// Set this feature as optional.
540 #[no_mangle]
541 pub extern "C" fn InitFeatures_set_basic_mpp_optional(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_optional()
543 }
544
545 /// Set this feature as required.
546 #[no_mangle]
547 pub extern "C" fn InitFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
548         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_basic_mpp_required()
549 }
550
551 /// Checks if this feature is supported.
552 #[must_use]
553 #[no_mangle]
554 pub extern "C" fn InitFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
555         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
556         ret
557 }
558
559 /// Set this feature as optional.
560 #[no_mangle]
561 pub extern "C" fn NodeFeatures_set_basic_mpp_optional(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_optional()
563 }
564
565 /// Set this feature as required.
566 #[no_mangle]
567 pub extern "C" fn NodeFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
568         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_basic_mpp_required()
569 }
570
571 /// Checks if this feature is supported.
572 #[must_use]
573 #[no_mangle]
574 pub extern "C" fn NodeFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
575         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
576         ret
577 }
578
579 /// Set this feature as optional.
580 #[no_mangle]
581 pub extern "C" fn Bolt11InvoiceFeatures_set_basic_mpp_optional(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_optional()
583 }
584
585 /// Set this feature as required.
586 #[no_mangle]
587 pub extern "C" fn Bolt11InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
588         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_basic_mpp_required()
589 }
590
591 /// Checks if this feature is supported.
592 #[must_use]
593 #[no_mangle]
594 pub extern "C" fn Bolt11InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
595         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
596         ret
597 }
598
599 /// Set this feature as optional.
600 #[no_mangle]
601 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_optional(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_optional()
603 }
604
605 /// Set this feature as required.
606 #[no_mangle]
607 pub extern "C" fn Bolt12InvoiceFeatures_set_basic_mpp_required(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures) {
608         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_basic_mpp_required()
609 }
610
611 /// Checks if this feature is supported.
612 #[must_use]
613 #[no_mangle]
614 pub extern "C" fn Bolt12InvoiceFeatures_supports_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
615         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_basic_mpp();
616         ret
617 }
618
619 /// Checks if this feature is required.
620 #[must_use]
621 #[no_mangle]
622 pub extern "C" fn InitFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
623         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
624         ret
625 }
626
627 /// Checks if this feature is required.
628 #[must_use]
629 #[no_mangle]
630 pub extern "C" fn NodeFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
631         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
632         ret
633 }
634
635 /// Checks if this feature is required.
636 #[must_use]
637 #[no_mangle]
638 pub extern "C" fn Bolt11InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
639         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
640         ret
641 }
642
643 /// Checks if this feature is required.
644 #[must_use]
645 #[no_mangle]
646 pub extern "C" fn Bolt12InvoiceFeatures_requires_basic_mpp(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
647         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_basic_mpp();
648         ret
649 }
650
651 /// Set this feature as optional.
652 #[no_mangle]
653 pub extern "C" fn InitFeatures_set_wumbo_optional(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_optional()
655 }
656
657 /// Set this feature as required.
658 #[no_mangle]
659 pub extern "C" fn InitFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
660         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_wumbo_required()
661 }
662
663 /// Checks if this feature is supported.
664 #[must_use]
665 #[no_mangle]
666 pub extern "C" fn InitFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
667         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
668         ret
669 }
670
671 /// Set this feature as optional.
672 #[no_mangle]
673 pub extern "C" fn NodeFeatures_set_wumbo_optional(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_optional()
675 }
676
677 /// Set this feature as required.
678 #[no_mangle]
679 pub extern "C" fn NodeFeatures_set_wumbo_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
680         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_wumbo_required()
681 }
682
683 /// Checks if this feature is supported.
684 #[must_use]
685 #[no_mangle]
686 pub extern "C" fn NodeFeatures_supports_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
687         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_wumbo();
688         ret
689 }
690
691 /// Checks if this feature is required.
692 #[must_use]
693 #[no_mangle]
694 pub extern "C" fn InitFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
695         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
696         ret
697 }
698
699 /// Checks if this feature is required.
700 #[must_use]
701 #[no_mangle]
702 pub extern "C" fn NodeFeatures_requires_wumbo(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
703         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_wumbo();
704         ret
705 }
706
707 /// Set this feature as optional.
708 #[no_mangle]
709 pub extern "C" fn InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(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_optional()
711 }
712
713 /// Set this feature as required.
714 #[no_mangle]
715 pub extern "C" fn InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
716         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
717 }
718
719 /// Checks if this feature is supported.
720 #[must_use]
721 #[no_mangle]
722 pub extern "C" fn InitFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
723         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
724         ret
725 }
726
727 /// Set this feature as optional.
728 #[no_mangle]
729 pub extern "C" fn NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(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_optional()
731 }
732
733 /// Set this feature as required.
734 #[no_mangle]
735 pub extern "C" fn NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
736         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
737 }
738
739 /// Checks if this feature is supported.
740 #[must_use]
741 #[no_mangle]
742 pub extern "C" fn NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
743         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
744         ret
745 }
746
747 /// Set this feature as optional.
748 #[no_mangle]
749 pub extern "C" fn ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(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_optional()
751 }
752
753 /// Set this feature as required.
754 #[no_mangle]
755 pub extern "C" fn ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
756         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_nonzero_fee_htlc_tx_required()
757 }
758
759 /// Checks if this feature is supported.
760 #[must_use]
761 #[no_mangle]
762 pub extern "C" fn ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
763         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_nonzero_fee_htlc_tx();
764         ret
765 }
766
767 /// Checks if this feature is required.
768 #[must_use]
769 #[no_mangle]
770 pub extern "C" fn InitFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
771         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
772         ret
773 }
774
775 /// Checks if this feature is required.
776 #[must_use]
777 #[no_mangle]
778 pub extern "C" fn NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
779         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
780         ret
781 }
782
783 /// Checks if this feature is required.
784 #[must_use]
785 #[no_mangle]
786 pub extern "C" fn ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
787         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_nonzero_fee_htlc_tx();
788         ret
789 }
790
791 /// Set this feature as optional.
792 #[no_mangle]
793 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_optional(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_optional()
795 }
796
797 /// Set this feature as required.
798 #[no_mangle]
799 pub extern "C" fn InitFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
800         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
801 }
802
803 /// Checks if this feature is supported.
804 #[must_use]
805 #[no_mangle]
806 pub extern "C" fn InitFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
807         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
808         ret
809 }
810
811 /// Set this feature as optional.
812 #[no_mangle]
813 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(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_optional()
815 }
816
817 /// Set this feature as required.
818 #[no_mangle]
819 pub extern "C" fn NodeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
820         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
821 }
822
823 /// Checks if this feature is supported.
824 #[must_use]
825 #[no_mangle]
826 pub extern "C" fn NodeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
827         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
828         ret
829 }
830
831 /// Set this feature as optional.
832 #[no_mangle]
833 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(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_optional()
835 }
836
837 /// Set this feature as required.
838 #[no_mangle]
839 pub extern "C" fn ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
840         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_anchors_zero_fee_htlc_tx_required()
841 }
842
843 /// Checks if this feature is supported.
844 #[must_use]
845 #[no_mangle]
846 pub extern "C" fn ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
847         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_anchors_zero_fee_htlc_tx();
848         ret
849 }
850
851 /// Checks if this feature is required.
852 #[must_use]
853 #[no_mangle]
854 pub extern "C" fn InitFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
855         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
856         ret
857 }
858
859 /// Checks if this feature is required.
860 #[must_use]
861 #[no_mangle]
862 pub extern "C" fn NodeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
863         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
864         ret
865 }
866
867 /// Checks if this feature is required.
868 #[must_use]
869 #[no_mangle]
870 pub extern "C" fn ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
871         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_anchors_zero_fee_htlc_tx();
872         ret
873 }
874
875 /// Set this feature as optional.
876 #[no_mangle]
877 pub extern "C" fn InitFeatures_set_route_blinding_optional(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_route_blinding_optional()
879 }
880
881 /// Set this feature as required.
882 #[no_mangle]
883 pub extern "C" fn InitFeatures_set_route_blinding_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
884         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_route_blinding_required()
885 }
886
887 /// Checks if this feature is supported.
888 #[must_use]
889 #[no_mangle]
890 pub extern "C" fn InitFeatures_supports_route_blinding(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
891         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_route_blinding();
892         ret
893 }
894
895 /// Set this feature as optional.
896 #[no_mangle]
897 pub extern "C" fn NodeFeatures_set_route_blinding_optional(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_route_blinding_optional()
899 }
900
901 /// Set this feature as required.
902 #[no_mangle]
903 pub extern "C" fn NodeFeatures_set_route_blinding_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
904         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_route_blinding_required()
905 }
906
907 /// Checks if this feature is supported.
908 #[must_use]
909 #[no_mangle]
910 pub extern "C" fn NodeFeatures_supports_route_blinding(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
911         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_route_blinding();
912         ret
913 }
914
915 /// Checks if this feature is required.
916 #[must_use]
917 #[no_mangle]
918 pub extern "C" fn InitFeatures_requires_route_blinding(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
919         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_route_blinding();
920         ret
921 }
922
923 /// Checks if this feature is required.
924 #[must_use]
925 #[no_mangle]
926 pub extern "C" fn NodeFeatures_requires_route_blinding(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
927         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_route_blinding();
928         ret
929 }
930
931 /// Set this feature as optional.
932 #[no_mangle]
933 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_optional(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_shutdown_any_segwit_optional()
935 }
936
937 /// Set this feature as required.
938 #[no_mangle]
939 pub extern "C" fn InitFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
940         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_shutdown_any_segwit_required()
941 }
942
943 /// Checks if this feature is supported.
944 #[must_use]
945 #[no_mangle]
946 pub extern "C" fn InitFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
947         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
948         ret
949 }
950
951 /// Set this feature as optional.
952 #[no_mangle]
953 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_optional(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_shutdown_any_segwit_optional()
955 }
956
957 /// Set this feature as required.
958 #[no_mangle]
959 pub extern "C" fn NodeFeatures_set_shutdown_any_segwit_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
960         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_shutdown_any_segwit_required()
961 }
962
963 /// Checks if this feature is supported.
964 #[must_use]
965 #[no_mangle]
966 pub extern "C" fn NodeFeatures_supports_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
967         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_shutdown_anysegwit();
968         ret
969 }
970
971 /// Checks if this feature is required.
972 #[must_use]
973 #[no_mangle]
974 pub extern "C" fn InitFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
975         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
976         ret
977 }
978
979 /// Checks if this feature is required.
980 #[must_use]
981 #[no_mangle]
982 pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
983         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_shutdown_anysegwit();
984         ret
985 }
986
987 /// Set this feature as optional.
988 #[no_mangle]
989 pub extern "C" fn InitFeatures_set_taproot_optional(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_taproot_optional()
991 }
992
993 /// Set this feature as required.
994 #[no_mangle]
995 pub extern "C" fn InitFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
996         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_taproot_required()
997 }
998
999 /// Checks if this feature is supported.
1000 #[must_use]
1001 #[no_mangle]
1002 pub extern "C" fn InitFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1003         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
1004         ret
1005 }
1006
1007 /// Set this feature as optional.
1008 #[no_mangle]
1009 pub extern "C" fn NodeFeatures_set_taproot_optional(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_taproot_optional()
1011 }
1012
1013 /// Set this feature as required.
1014 #[no_mangle]
1015 pub extern "C" fn NodeFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1016         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_taproot_required()
1017 }
1018
1019 /// Checks if this feature is supported.
1020 #[must_use]
1021 #[no_mangle]
1022 pub extern "C" fn NodeFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1023         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
1024         ret
1025 }
1026
1027 /// Set this feature as optional.
1028 #[no_mangle]
1029 pub extern "C" fn ChannelTypeFeatures_set_taproot_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1030         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_taproot_optional()
1031 }
1032
1033 /// Set this feature as required.
1034 #[no_mangle]
1035 pub extern "C" fn ChannelTypeFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1036         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_taproot_required()
1037 }
1038
1039 /// Checks if this feature is supported.
1040 #[must_use]
1041 #[no_mangle]
1042 pub extern "C" fn ChannelTypeFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1043         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
1044         ret
1045 }
1046
1047 /// Checks if this feature is required.
1048 #[must_use]
1049 #[no_mangle]
1050 pub extern "C" fn InitFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1051         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
1052         ret
1053 }
1054
1055 /// Checks if this feature is required.
1056 #[must_use]
1057 #[no_mangle]
1058 pub extern "C" fn NodeFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1059         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
1060         ret
1061 }
1062
1063 /// Checks if this feature is required.
1064 #[must_use]
1065 #[no_mangle]
1066 pub extern "C" fn ChannelTypeFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1067         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
1068         ret
1069 }
1070
1071 /// Set this feature as optional.
1072 #[no_mangle]
1073 pub extern "C" fn InitFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1074         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_optional()
1075 }
1076
1077 /// Set this feature as required.
1078 #[no_mangle]
1079 pub extern "C" fn InitFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1080         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_onion_messages_required()
1081 }
1082
1083 /// Checks if this feature is supported.
1084 #[must_use]
1085 #[no_mangle]
1086 pub extern "C" fn InitFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1087         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
1088         ret
1089 }
1090
1091 /// Set this feature as optional.
1092 #[no_mangle]
1093 pub extern "C" fn NodeFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1094         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_optional()
1095 }
1096
1097 /// Set this feature as required.
1098 #[no_mangle]
1099 pub extern "C" fn NodeFeatures_set_onion_messages_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1100         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_onion_messages_required()
1101 }
1102
1103 /// Checks if this feature is supported.
1104 #[must_use]
1105 #[no_mangle]
1106 pub extern "C" fn NodeFeatures_supports_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1107         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_onion_messages();
1108         ret
1109 }
1110
1111 /// Checks if this feature is required.
1112 #[must_use]
1113 #[no_mangle]
1114 pub extern "C" fn InitFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1115         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
1116         ret
1117 }
1118
1119 /// Checks if this feature is required.
1120 #[must_use]
1121 #[no_mangle]
1122 pub extern "C" fn NodeFeatures_requires_onion_messages(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1123         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_onion_messages();
1124         ret
1125 }
1126
1127 /// Set this feature as optional.
1128 #[no_mangle]
1129 pub extern "C" fn InitFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1130         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_optional()
1131 }
1132
1133 /// Set this feature as required.
1134 #[no_mangle]
1135 pub extern "C" fn InitFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1136         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_channel_type_required()
1137 }
1138
1139 /// Checks if this feature is supported.
1140 #[must_use]
1141 #[no_mangle]
1142 pub extern "C" fn InitFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1143         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
1144         ret
1145 }
1146
1147 /// Set this feature as optional.
1148 #[no_mangle]
1149 pub extern "C" fn NodeFeatures_set_channel_type_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1150         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_optional()
1151 }
1152
1153 /// Set this feature as required.
1154 #[no_mangle]
1155 pub extern "C" fn NodeFeatures_set_channel_type_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1156         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_channel_type_required()
1157 }
1158
1159 /// Checks if this feature is supported.
1160 #[must_use]
1161 #[no_mangle]
1162 pub extern "C" fn NodeFeatures_supports_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1163         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_channel_type();
1164         ret
1165 }
1166
1167 /// Checks if this feature is required.
1168 #[must_use]
1169 #[no_mangle]
1170 pub extern "C" fn InitFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1171         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
1172         ret
1173 }
1174
1175 /// Checks if this feature is required.
1176 #[must_use]
1177 #[no_mangle]
1178 pub extern "C" fn NodeFeatures_requires_channel_type(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1179         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_channel_type();
1180         ret
1181 }
1182
1183 /// Set this feature as optional.
1184 #[no_mangle]
1185 pub extern "C" fn InitFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1186         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_optional()
1187 }
1188
1189 /// Set this feature as required.
1190 #[no_mangle]
1191 pub extern "C" fn InitFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1192         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_scid_privacy_required()
1193 }
1194
1195 /// Checks if this feature is supported.
1196 #[must_use]
1197 #[no_mangle]
1198 pub extern "C" fn InitFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1199         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1200         ret
1201 }
1202
1203 /// Set this feature as optional.
1204 #[no_mangle]
1205 pub extern "C" fn NodeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1206         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_optional()
1207 }
1208
1209 /// Set this feature as required.
1210 #[no_mangle]
1211 pub extern "C" fn NodeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1212         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_scid_privacy_required()
1213 }
1214
1215 /// Checks if this feature is supported.
1216 #[must_use]
1217 #[no_mangle]
1218 pub extern "C" fn NodeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1219         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1220         ret
1221 }
1222
1223 /// Set this feature as optional.
1224 #[no_mangle]
1225 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1226         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_optional()
1227 }
1228
1229 /// Set this feature as required.
1230 #[no_mangle]
1231 pub extern "C" fn ChannelTypeFeatures_set_scid_privacy_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1232         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_scid_privacy_required()
1233 }
1234
1235 /// Checks if this feature is supported.
1236 #[must_use]
1237 #[no_mangle]
1238 pub extern "C" fn ChannelTypeFeatures_supports_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1239         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_scid_privacy();
1240         ret
1241 }
1242
1243 /// Checks if this feature is required.
1244 #[must_use]
1245 #[no_mangle]
1246 pub extern "C" fn InitFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1247         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1248         ret
1249 }
1250
1251 /// Checks if this feature is required.
1252 #[must_use]
1253 #[no_mangle]
1254 pub extern "C" fn NodeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1255         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1256         ret
1257 }
1258
1259 /// Checks if this feature is required.
1260 #[must_use]
1261 #[no_mangle]
1262 pub extern "C" fn ChannelTypeFeatures_requires_scid_privacy(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1263         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_scid_privacy();
1264         ret
1265 }
1266
1267 /// Set this feature as optional.
1268 #[no_mangle]
1269 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_metadata_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1270         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_metadata_optional()
1271 }
1272
1273 /// Set this feature as required.
1274 #[no_mangle]
1275 pub extern "C" fn Bolt11InvoiceFeatures_set_payment_metadata_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1276         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_payment_metadata_required()
1277 }
1278
1279 /// Checks if this feature is supported.
1280 #[must_use]
1281 #[no_mangle]
1282 pub extern "C" fn Bolt11InvoiceFeatures_supports_payment_metadata(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1283         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_metadata();
1284         ret
1285 }
1286
1287 /// Checks if this feature is required.
1288 #[must_use]
1289 #[no_mangle]
1290 pub extern "C" fn Bolt11InvoiceFeatures_requires_payment_metadata(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1291         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_payment_metadata();
1292         ret
1293 }
1294
1295 /// Set this feature as optional.
1296 #[no_mangle]
1297 pub extern "C" fn InitFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1298         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_optional()
1299 }
1300
1301 /// Set this feature as required.
1302 #[no_mangle]
1303 pub extern "C" fn InitFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1304         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_zero_conf_required()
1305 }
1306
1307 /// Checks if this feature is supported.
1308 #[must_use]
1309 #[no_mangle]
1310 pub extern "C" fn InitFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1311         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1312         ret
1313 }
1314
1315 /// Set this feature as optional.
1316 #[no_mangle]
1317 pub extern "C" fn NodeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1318         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_optional()
1319 }
1320
1321 /// Set this feature as required.
1322 #[no_mangle]
1323 pub extern "C" fn NodeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1324         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_zero_conf_required()
1325 }
1326
1327 /// Checks if this feature is supported.
1328 #[must_use]
1329 #[no_mangle]
1330 pub extern "C" fn NodeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1331         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1332         ret
1333 }
1334
1335 /// Set this feature as optional.
1336 #[no_mangle]
1337 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1338         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_optional()
1339 }
1340
1341 /// Set this feature as required.
1342 #[no_mangle]
1343 pub extern "C" fn ChannelTypeFeatures_set_zero_conf_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
1344         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_zero_conf_required()
1345 }
1346
1347 /// Checks if this feature is supported.
1348 #[must_use]
1349 #[no_mangle]
1350 pub extern "C" fn ChannelTypeFeatures_supports_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1351         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_zero_conf();
1352         ret
1353 }
1354
1355 /// Checks if this feature is required.
1356 #[must_use]
1357 #[no_mangle]
1358 pub extern "C" fn InitFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1359         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1360         ret
1361 }
1362
1363 /// Checks if this feature is required.
1364 #[must_use]
1365 #[no_mangle]
1366 pub extern "C" fn NodeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1367         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1368         ret
1369 }
1370
1371 /// Checks if this feature is required.
1372 #[must_use]
1373 #[no_mangle]
1374 pub extern "C" fn ChannelTypeFeatures_requires_zero_conf(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1375         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_zero_conf();
1376         ret
1377 }
1378
1379 /// Set this feature as optional.
1380 #[no_mangle]
1381 pub extern "C" fn NodeFeatures_set_keysend_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1382         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_optional()
1383 }
1384
1385 /// Set this feature as required.
1386 #[no_mangle]
1387 pub extern "C" fn NodeFeatures_set_keysend_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1388         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_keysend_required()
1389 }
1390
1391 /// Checks if this feature is supported.
1392 #[must_use]
1393 #[no_mangle]
1394 pub extern "C" fn NodeFeatures_supports_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1395         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_keysend();
1396         ret
1397 }
1398
1399 /// Checks if this feature is required.
1400 #[must_use]
1401 #[no_mangle]
1402 pub extern "C" fn NodeFeatures_requires_keysend(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1403         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_keysend();
1404         ret
1405 }
1406
1407 /// Set this feature as optional.
1408 #[no_mangle]
1409 pub extern "C" fn InitFeatures_set_trampoline_routing_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1410         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_trampoline_routing_optional()
1411 }
1412
1413 /// Set this feature as required.
1414 #[no_mangle]
1415 pub extern "C" fn InitFeatures_set_trampoline_routing_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
1416         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_trampoline_routing_required()
1417 }
1418
1419 /// Checks if this feature is supported.
1420 #[must_use]
1421 #[no_mangle]
1422 pub extern "C" fn InitFeatures_supports_trampoline_routing(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1423         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_trampoline_routing();
1424         ret
1425 }
1426
1427 /// Set this feature as optional.
1428 #[no_mangle]
1429 pub extern "C" fn NodeFeatures_set_trampoline_routing_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1430         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_trampoline_routing_optional()
1431 }
1432
1433 /// Set this feature as required.
1434 #[no_mangle]
1435 pub extern "C" fn NodeFeatures_set_trampoline_routing_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
1436         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_trampoline_routing_required()
1437 }
1438
1439 /// Checks if this feature is supported.
1440 #[must_use]
1441 #[no_mangle]
1442 pub extern "C" fn NodeFeatures_supports_trampoline_routing(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1443         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_trampoline_routing();
1444         ret
1445 }
1446
1447 /// Set this feature as optional.
1448 #[no_mangle]
1449 pub extern "C" fn Bolt11InvoiceFeatures_set_trampoline_routing_optional(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1450         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_trampoline_routing_optional()
1451 }
1452
1453 /// Set this feature as required.
1454 #[no_mangle]
1455 pub extern "C" fn Bolt11InvoiceFeatures_set_trampoline_routing_required(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures) {
1456         unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_trampoline_routing_required()
1457 }
1458
1459 /// Checks if this feature is supported.
1460 #[must_use]
1461 #[no_mangle]
1462 pub extern "C" fn Bolt11InvoiceFeatures_supports_trampoline_routing(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1463         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_trampoline_routing();
1464         ret
1465 }
1466
1467 /// Checks if this feature is required.
1468 #[must_use]
1469 #[no_mangle]
1470 pub extern "C" fn InitFeatures_requires_trampoline_routing(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1471         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_trampoline_routing();
1472         ret
1473 }
1474
1475 /// Checks if this feature is required.
1476 #[must_use]
1477 #[no_mangle]
1478 pub extern "C" fn NodeFeatures_requires_trampoline_routing(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1479         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_trampoline_routing();
1480         ret
1481 }
1482
1483 /// Checks if this feature is required.
1484 #[must_use]
1485 #[no_mangle]
1486 pub extern "C" fn Bolt11InvoiceFeatures_requires_trampoline_routing(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
1487         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_trampoline_routing();
1488         ret
1489 }
1490
1491 }
1492 /// Checks if two InitFeaturess contain equal inner contents.
1493 /// This ignores pointers and is_owned flags and looks at the values in fields.
1494 /// Two objects with NULL inner values will be considered "equal" here.
1495 #[no_mangle]
1496 pub extern "C" fn InitFeatures_eq(a: &InitFeatures, b: &InitFeatures) -> bool {
1497         if a.inner == b.inner { return true; }
1498         if a.inner.is_null() || b.inner.is_null() { return false; }
1499         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1500 }
1501 /// Checks if two NodeFeaturess contain equal inner contents.
1502 /// This ignores pointers and is_owned flags and looks at the values in fields.
1503 /// Two objects with NULL inner values will be considered "equal" here.
1504 #[no_mangle]
1505 pub extern "C" fn NodeFeatures_eq(a: &NodeFeatures, b: &NodeFeatures) -> bool {
1506         if a.inner == b.inner { return true; }
1507         if a.inner.is_null() || b.inner.is_null() { return false; }
1508         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1509 }
1510 /// Checks if two ChannelFeaturess contain equal inner contents.
1511 /// This ignores pointers and is_owned flags and looks at the values in fields.
1512 /// Two objects with NULL inner values will be considered "equal" here.
1513 #[no_mangle]
1514 pub extern "C" fn ChannelFeatures_eq(a: &ChannelFeatures, b: &ChannelFeatures) -> bool {
1515         if a.inner == b.inner { return true; }
1516         if a.inner.is_null() || b.inner.is_null() { return false; }
1517         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1518 }
1519 /// Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
1520 /// This ignores pointers and is_owned flags and looks at the values in fields.
1521 /// Two objects with NULL inner values will be considered "equal" here.
1522 #[no_mangle]
1523 pub extern "C" fn Bolt11InvoiceFeatures_eq(a: &Bolt11InvoiceFeatures, b: &Bolt11InvoiceFeatures) -> bool {
1524         if a.inner == b.inner { return true; }
1525         if a.inner.is_null() || b.inner.is_null() { return false; }
1526         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1527 }
1528 /// Checks if two OfferFeaturess contain equal inner contents.
1529 /// This ignores pointers and is_owned flags and looks at the values in fields.
1530 /// Two objects with NULL inner values will be considered "equal" here.
1531 #[no_mangle]
1532 pub extern "C" fn OfferFeatures_eq(a: &OfferFeatures, b: &OfferFeatures) -> bool {
1533         if a.inner == b.inner { return true; }
1534         if a.inner.is_null() || b.inner.is_null() { return false; }
1535         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1536 }
1537 /// Checks if two InvoiceRequestFeaturess contain equal inner contents.
1538 /// This ignores pointers and is_owned flags and looks at the values in fields.
1539 /// Two objects with NULL inner values will be considered "equal" here.
1540 #[no_mangle]
1541 pub extern "C" fn InvoiceRequestFeatures_eq(a: &InvoiceRequestFeatures, b: &InvoiceRequestFeatures) -> bool {
1542         if a.inner == b.inner { return true; }
1543         if a.inner.is_null() || b.inner.is_null() { return false; }
1544         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1545 }
1546 /// Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
1547 /// This ignores pointers and is_owned flags and looks at the values in fields.
1548 /// Two objects with NULL inner values will be considered "equal" here.
1549 #[no_mangle]
1550 pub extern "C" fn Bolt12InvoiceFeatures_eq(a: &Bolt12InvoiceFeatures, b: &Bolt12InvoiceFeatures) -> bool {
1551         if a.inner == b.inner { return true; }
1552         if a.inner.is_null() || b.inner.is_null() { return false; }
1553         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1554 }
1555 /// Checks if two BlindedHopFeaturess contain equal inner contents.
1556 /// This ignores pointers and is_owned flags and looks at the values in fields.
1557 /// Two objects with NULL inner values will be considered "equal" here.
1558 #[no_mangle]
1559 pub extern "C" fn BlindedHopFeatures_eq(a: &BlindedHopFeatures, b: &BlindedHopFeatures) -> bool {
1560         if a.inner == b.inner { return true; }
1561         if a.inner.is_null() || b.inner.is_null() { return false; }
1562         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1563 }
1564 /// Checks if two ChannelTypeFeaturess contain equal inner contents.
1565 /// This ignores pointers and is_owned flags and looks at the values in fields.
1566 /// Two objects with NULL inner values will be considered "equal" here.
1567 #[no_mangle]
1568 pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
1569         if a.inner == b.inner { return true; }
1570         if a.inner.is_null() || b.inner.is_null() { return false; }
1571         if a.get_native_ref() == b.get_native_ref() { true } else { false }
1572 }
1573 impl Clone for InitFeatures {
1574         fn clone(&self) -> Self {
1575                 Self {
1576                         inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1577                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1578                         is_owned: true,
1579                 }
1580         }
1581 }
1582 #[allow(unused)]
1583 /// Used only if an object of this type is returned as a trait impl by a method
1584 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1585         Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeInitFeatures)).clone() })) as *mut c_void
1586 }
1587 #[no_mangle]
1588 /// Creates a copy of the InitFeatures
1589 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1590         orig.clone()
1591 }
1592 impl Clone for NodeFeatures {
1593         fn clone(&self) -> Self {
1594                 Self {
1595                         inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1596                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1597                         is_owned: true,
1598                 }
1599         }
1600 }
1601 #[allow(unused)]
1602 /// Used only if an object of this type is returned as a trait impl by a method
1603 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1604         Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeNodeFeatures)).clone() })) as *mut c_void
1605 }
1606 #[no_mangle]
1607 /// Creates a copy of the NodeFeatures
1608 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1609         orig.clone()
1610 }
1611 impl Clone for ChannelFeatures {
1612         fn clone(&self) -> Self {
1613                 Self {
1614                         inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1615                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1616                         is_owned: true,
1617                 }
1618         }
1619 }
1620 #[allow(unused)]
1621 /// Used only if an object of this type is returned as a trait impl by a method
1622 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1623         Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeChannelFeatures)).clone() })) as *mut c_void
1624 }
1625 #[no_mangle]
1626 /// Creates a copy of the ChannelFeatures
1627 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1628         orig.clone()
1629 }
1630 impl Clone for Bolt11InvoiceFeatures {
1631         fn clone(&self) -> Self {
1632                 Self {
1633                         inner: if <*mut nativeBolt11InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1634                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1635                         is_owned: true,
1636                 }
1637         }
1638 }
1639 #[allow(unused)]
1640 /// Used only if an object of this type is returned as a trait impl by a method
1641 pub(crate) extern "C" fn Bolt11InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1642         Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt11InvoiceFeatures)).clone() })) as *mut c_void
1643 }
1644 #[no_mangle]
1645 /// Creates a copy of the Bolt11InvoiceFeatures
1646 pub extern "C" fn Bolt11InvoiceFeatures_clone(orig: &Bolt11InvoiceFeatures) -> Bolt11InvoiceFeatures {
1647         orig.clone()
1648 }
1649 impl Clone for OfferFeatures {
1650         fn clone(&self) -> Self {
1651                 Self {
1652                         inner: if <*mut nativeOfferFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1653                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1654                         is_owned: true,
1655                 }
1656         }
1657 }
1658 #[allow(unused)]
1659 /// Used only if an object of this type is returned as a trait impl by a method
1660 pub(crate) extern "C" fn OfferFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1661         Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeOfferFeatures)).clone() })) as *mut c_void
1662 }
1663 #[no_mangle]
1664 /// Creates a copy of the OfferFeatures
1665 pub extern "C" fn OfferFeatures_clone(orig: &OfferFeatures) -> OfferFeatures {
1666         orig.clone()
1667 }
1668 impl Clone for InvoiceRequestFeatures {
1669         fn clone(&self) -> Self {
1670                 Self {
1671                         inner: if <*mut nativeInvoiceRequestFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1672                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1673                         is_owned: true,
1674                 }
1675         }
1676 }
1677 #[allow(unused)]
1678 /// Used only if an object of this type is returned as a trait impl by a method
1679 pub(crate) extern "C" fn InvoiceRequestFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1680         Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
1681 }
1682 #[no_mangle]
1683 /// Creates a copy of the InvoiceRequestFeatures
1684 pub extern "C" fn InvoiceRequestFeatures_clone(orig: &InvoiceRequestFeatures) -> InvoiceRequestFeatures {
1685         orig.clone()
1686 }
1687 impl Clone for Bolt12InvoiceFeatures {
1688         fn clone(&self) -> Self {
1689                 Self {
1690                         inner: if <*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1691                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1692                         is_owned: true,
1693                 }
1694         }
1695 }
1696 #[allow(unused)]
1697 /// Used only if an object of this type is returned as a trait impl by a method
1698 pub(crate) extern "C" fn Bolt12InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1699         Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt12InvoiceFeatures)).clone() })) as *mut c_void
1700 }
1701 #[no_mangle]
1702 /// Creates a copy of the Bolt12InvoiceFeatures
1703 pub extern "C" fn Bolt12InvoiceFeatures_clone(orig: &Bolt12InvoiceFeatures) -> Bolt12InvoiceFeatures {
1704         orig.clone()
1705 }
1706 impl Clone for BlindedHopFeatures {
1707         fn clone(&self) -> Self {
1708                 Self {
1709                         inner: if <*mut nativeBlindedHopFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1710                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1711                         is_owned: true,
1712                 }
1713         }
1714 }
1715 #[allow(unused)]
1716 /// Used only if an object of this type is returned as a trait impl by a method
1717 pub(crate) extern "C" fn BlindedHopFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1718         Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBlindedHopFeatures)).clone() })) as *mut c_void
1719 }
1720 #[no_mangle]
1721 /// Creates a copy of the BlindedHopFeatures
1722 pub extern "C" fn BlindedHopFeatures_clone(orig: &BlindedHopFeatures) -> BlindedHopFeatures {
1723         orig.clone()
1724 }
1725 impl Clone for ChannelTypeFeatures {
1726         fn clone(&self) -> Self {
1727                 Self {
1728                         inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1729                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1730                         is_owned: true,
1731                 }
1732         }
1733 }
1734 #[allow(unused)]
1735 /// Used only if an object of this type is returned as a trait impl by a method
1736 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1737         Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeChannelTypeFeatures)).clone() })) as *mut c_void
1738 }
1739 #[no_mangle]
1740 /// Creates a copy of the ChannelTypeFeatures
1741 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1742         orig.clone()
1743 }
1744 /// Generates a non-cryptographic 64-bit hash of the InitFeatures.
1745 #[no_mangle]
1746 pub extern "C" fn InitFeatures_hash(o: &InitFeatures) -> u64 {
1747         if o.inner.is_null() { return 0; }
1748         // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1749         #[allow(deprecated)]
1750         let mut hasher = core::hash::SipHasher::new();
1751         core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1752         core::hash::Hasher::finish(&hasher)
1753 }
1754 /// Generates a non-cryptographic 64-bit hash of the NodeFeatures.
1755 #[no_mangle]
1756 pub extern "C" fn NodeFeatures_hash(o: &NodeFeatures) -> u64 {
1757         if o.inner.is_null() { return 0; }
1758         // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1759         #[allow(deprecated)]
1760         let mut hasher = core::hash::SipHasher::new();
1761         core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1762         core::hash::Hasher::finish(&hasher)
1763 }
1764 /// Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
1765 #[no_mangle]
1766 pub extern "C" fn ChannelFeatures_hash(o: &ChannelFeatures) -> u64 {
1767         if o.inner.is_null() { return 0; }
1768         // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1769         #[allow(deprecated)]
1770         let mut hasher = core::hash::SipHasher::new();
1771         core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1772         core::hash::Hasher::finish(&hasher)
1773 }
1774 /// Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
1775 #[no_mangle]
1776 pub extern "C" fn Bolt11InvoiceFeatures_hash(o: &Bolt11InvoiceFeatures) -> u64 {
1777         if o.inner.is_null() { return 0; }
1778         // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1779         #[allow(deprecated)]
1780         let mut hasher = core::hash::SipHasher::new();
1781         core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1782         core::hash::Hasher::finish(&hasher)
1783 }
1784 /// Generates a non-cryptographic 64-bit hash of the OfferFeatures.
1785 #[no_mangle]
1786 pub extern "C" fn OfferFeatures_hash(o: &OfferFeatures) -> u64 {
1787         if o.inner.is_null() { return 0; }
1788         // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1789         #[allow(deprecated)]
1790         let mut hasher = core::hash::SipHasher::new();
1791         core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1792         core::hash::Hasher::finish(&hasher)
1793 }
1794 /// Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
1795 #[no_mangle]
1796 pub extern "C" fn InvoiceRequestFeatures_hash(o: &InvoiceRequestFeatures) -> u64 {
1797         if o.inner.is_null() { return 0; }
1798         // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1799         #[allow(deprecated)]
1800         let mut hasher = core::hash::SipHasher::new();
1801         core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1802         core::hash::Hasher::finish(&hasher)
1803 }
1804 /// Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
1805 #[no_mangle]
1806 pub extern "C" fn Bolt12InvoiceFeatures_hash(o: &Bolt12InvoiceFeatures) -> u64 {
1807         if o.inner.is_null() { return 0; }
1808         // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1809         #[allow(deprecated)]
1810         let mut hasher = core::hash::SipHasher::new();
1811         core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1812         core::hash::Hasher::finish(&hasher)
1813 }
1814 /// Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
1815 #[no_mangle]
1816 pub extern "C" fn BlindedHopFeatures_hash(o: &BlindedHopFeatures) -> u64 {
1817         if o.inner.is_null() { return 0; }
1818         // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1819         #[allow(deprecated)]
1820         let mut hasher = core::hash::SipHasher::new();
1821         core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1822         core::hash::Hasher::finish(&hasher)
1823 }
1824 /// Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
1825 #[no_mangle]
1826 pub extern "C" fn ChannelTypeFeatures_hash(o: &ChannelTypeFeatures) -> u64 {
1827         if o.inner.is_null() { return 0; }
1828         // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
1829         #[allow(deprecated)]
1830         let mut hasher = core::hash::SipHasher::new();
1831         core::hash::Hash::hash(o.get_native_ref(), &mut hasher);
1832         core::hash::Hasher::finish(&hasher)
1833 }
1834 /// Get a string which allows debug introspection of a InitFeatures object
1835 pub extern "C" fn InitFeatures_debug_str_void(o: *const c_void) -> Str {
1836         alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::InitFeatures }).into()}
1837 /// Get a string which allows debug introspection of a NodeFeatures object
1838 pub extern "C" fn NodeFeatures_debug_str_void(o: *const c_void) -> Str {
1839         alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::NodeFeatures }).into()}
1840 /// Get a string which allows debug introspection of a ChannelFeatures object
1841 pub extern "C" fn ChannelFeatures_debug_str_void(o: *const c_void) -> Str {
1842         alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::ChannelFeatures }).into()}
1843 /// Get a string which allows debug introspection of a Bolt11InvoiceFeatures object
1844 pub extern "C" fn Bolt11InvoiceFeatures_debug_str_void(o: *const c_void) -> Str {
1845         alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::Bolt11InvoiceFeatures }).into()}
1846 /// Get a string which allows debug introspection of a OfferFeatures object
1847 pub extern "C" fn OfferFeatures_debug_str_void(o: *const c_void) -> Str {
1848         alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::OfferFeatures }).into()}
1849 /// Get a string which allows debug introspection of a InvoiceRequestFeatures object
1850 pub extern "C" fn InvoiceRequestFeatures_debug_str_void(o: *const c_void) -> Str {
1851         alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::InvoiceRequestFeatures }).into()}
1852 /// Get a string which allows debug introspection of a Bolt12InvoiceFeatures object
1853 pub extern "C" fn Bolt12InvoiceFeatures_debug_str_void(o: *const c_void) -> Str {
1854         alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::Bolt12InvoiceFeatures }).into()}
1855 /// Get a string which allows debug introspection of a BlindedHopFeatures object
1856 pub extern "C" fn BlindedHopFeatures_debug_str_void(o: *const c_void) -> Str {
1857         alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::BlindedHopFeatures }).into()}
1858 /// Get a string which allows debug introspection of a ChannelTypeFeatures object
1859 pub extern "C" fn ChannelTypeFeatures_debug_str_void(o: *const c_void) -> Str {
1860         alloc::format!("{:?}", unsafe { o as *const crate::lightning::ln::features::ChannelTypeFeatures }).into()}
1861
1862 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1863 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1864
1865 /// Features used within an `init` message.
1866 #[must_use]
1867 #[repr(C)]
1868 pub struct InitFeatures {
1869         /// A pointer to the opaque Rust object.
1870
1871         /// Nearly everywhere, inner must be non-null, however in places where
1872         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1873         pub inner: *mut nativeInitFeatures,
1874         /// Indicates that this is the only struct which contains the same pointer.
1875
1876         /// Rust functions which take ownership of an object provided via an argument require
1877         /// this to be true and invalidate the object pointed to by inner.
1878         pub is_owned: bool,
1879 }
1880
1881 impl Drop for InitFeatures {
1882         fn drop(&mut self) {
1883                 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1884                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1885                 }
1886         }
1887 }
1888 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1889 #[no_mangle]
1890 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1891 #[allow(unused)]
1892 /// Used only if an object of this type is returned as a trait impl by a method
1893 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1894         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInitFeatures) };
1895 }
1896 #[allow(unused)]
1897 impl InitFeatures {
1898         pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1899                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1900         }
1901         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1902                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1903         }
1904         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1905         pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1906                 assert!(self.is_owned);
1907                 let ret = ObjOps::untweak_ptr(self.inner);
1908                 self.inner = core::ptr::null_mut();
1909                 ret
1910         }
1911 }
1912
1913 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1914 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1915
1916 /// Features used within a `node_announcement` message.
1917 #[must_use]
1918 #[repr(C)]
1919 pub struct NodeFeatures {
1920         /// A pointer to the opaque Rust object.
1921
1922         /// Nearly everywhere, inner must be non-null, however in places where
1923         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1924         pub inner: *mut nativeNodeFeatures,
1925         /// Indicates that this is the only struct which contains the same pointer.
1926
1927         /// Rust functions which take ownership of an object provided via an argument require
1928         /// this to be true and invalidate the object pointed to by inner.
1929         pub is_owned: bool,
1930 }
1931
1932 impl Drop for NodeFeatures {
1933         fn drop(&mut self) {
1934                 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1935                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1936                 }
1937         }
1938 }
1939 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1940 #[no_mangle]
1941 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1942 #[allow(unused)]
1943 /// Used only if an object of this type is returned as a trait impl by a method
1944 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1945         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeNodeFeatures) };
1946 }
1947 #[allow(unused)]
1948 impl NodeFeatures {
1949         pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1950                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1951         }
1952         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1953                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1954         }
1955         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1956         pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1957                 assert!(self.is_owned);
1958                 let ret = ObjOps::untweak_ptr(self.inner);
1959                 self.inner = core::ptr::null_mut();
1960                 ret
1961         }
1962 }
1963
1964 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1965 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1966
1967 /// Features used within a `channel_announcement` message.
1968 #[must_use]
1969 #[repr(C)]
1970 pub struct ChannelFeatures {
1971         /// A pointer to the opaque Rust object.
1972
1973         /// Nearly everywhere, inner must be non-null, however in places where
1974         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1975         pub inner: *mut nativeChannelFeatures,
1976         /// Indicates that this is the only struct which contains the same pointer.
1977
1978         /// Rust functions which take ownership of an object provided via an argument require
1979         /// this to be true and invalidate the object pointed to by inner.
1980         pub is_owned: bool,
1981 }
1982
1983 impl Drop for ChannelFeatures {
1984         fn drop(&mut self) {
1985                 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1986                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1987                 }
1988         }
1989 }
1990 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1991 #[no_mangle]
1992 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1993 #[allow(unused)]
1994 /// Used only if an object of this type is returned as a trait impl by a method
1995 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1996         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelFeatures) };
1997 }
1998 #[allow(unused)]
1999 impl ChannelFeatures {
2000         pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
2001                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2002         }
2003         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
2004                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2005         }
2006         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2007         pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
2008                 assert!(self.is_owned);
2009                 let ret = ObjOps::untweak_ptr(self.inner);
2010                 self.inner = core::ptr::null_mut();
2011                 ret
2012         }
2013 }
2014
2015 use lightning::ln::features::Bolt11InvoiceFeatures as nativeBolt11InvoiceFeaturesImport;
2016 pub(crate) type nativeBolt11InvoiceFeatures = nativeBolt11InvoiceFeaturesImport;
2017
2018 /// Features used within an invoice.
2019 #[must_use]
2020 #[repr(C)]
2021 pub struct Bolt11InvoiceFeatures {
2022         /// A pointer to the opaque Rust object.
2023
2024         /// Nearly everywhere, inner must be non-null, however in places where
2025         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2026         pub inner: *mut nativeBolt11InvoiceFeatures,
2027         /// Indicates that this is the only struct which contains the same pointer.
2028
2029         /// Rust functions which take ownership of an object provided via an argument require
2030         /// this to be true and invalidate the object pointed to by inner.
2031         pub is_owned: bool,
2032 }
2033
2034 impl Drop for Bolt11InvoiceFeatures {
2035         fn drop(&mut self) {
2036                 if self.is_owned && !<*mut nativeBolt11InvoiceFeatures>::is_null(self.inner) {
2037                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2038                 }
2039         }
2040 }
2041 /// Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
2042 #[no_mangle]
2043 pub extern "C" fn Bolt11InvoiceFeatures_free(this_obj: Bolt11InvoiceFeatures) { }
2044 #[allow(unused)]
2045 /// Used only if an object of this type is returned as a trait impl by a method
2046 pub(crate) extern "C" fn Bolt11InvoiceFeatures_free_void(this_ptr: *mut c_void) {
2047         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt11InvoiceFeatures) };
2048 }
2049 #[allow(unused)]
2050 impl Bolt11InvoiceFeatures {
2051         pub(crate) fn get_native_ref(&self) -> &'static nativeBolt11InvoiceFeatures {
2052                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2053         }
2054         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt11InvoiceFeatures {
2055                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2056         }
2057         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2058         pub(crate) fn take_inner(mut self) -> *mut nativeBolt11InvoiceFeatures {
2059                 assert!(self.is_owned);
2060                 let ret = ObjOps::untweak_ptr(self.inner);
2061                 self.inner = core::ptr::null_mut();
2062                 ret
2063         }
2064 }
2065
2066 use lightning::ln::features::OfferFeatures as nativeOfferFeaturesImport;
2067 pub(crate) type nativeOfferFeatures = nativeOfferFeaturesImport;
2068
2069 /// Features used within an `offer`.
2070 #[must_use]
2071 #[repr(C)]
2072 pub struct OfferFeatures {
2073         /// A pointer to the opaque Rust object.
2074
2075         /// Nearly everywhere, inner must be non-null, however in places where
2076         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2077         pub inner: *mut nativeOfferFeatures,
2078         /// Indicates that this is the only struct which contains the same pointer.
2079
2080         /// Rust functions which take ownership of an object provided via an argument require
2081         /// this to be true and invalidate the object pointed to by inner.
2082         pub is_owned: bool,
2083 }
2084
2085 impl Drop for OfferFeatures {
2086         fn drop(&mut self) {
2087                 if self.is_owned && !<*mut nativeOfferFeatures>::is_null(self.inner) {
2088                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2089                 }
2090         }
2091 }
2092 /// Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
2093 #[no_mangle]
2094 pub extern "C" fn OfferFeatures_free(this_obj: OfferFeatures) { }
2095 #[allow(unused)]
2096 /// Used only if an object of this type is returned as a trait impl by a method
2097 pub(crate) extern "C" fn OfferFeatures_free_void(this_ptr: *mut c_void) {
2098         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferFeatures) };
2099 }
2100 #[allow(unused)]
2101 impl OfferFeatures {
2102         pub(crate) fn get_native_ref(&self) -> &'static nativeOfferFeatures {
2103                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2104         }
2105         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferFeatures {
2106                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2107         }
2108         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2109         pub(crate) fn take_inner(mut self) -> *mut nativeOfferFeatures {
2110                 assert!(self.is_owned);
2111                 let ret = ObjOps::untweak_ptr(self.inner);
2112                 self.inner = core::ptr::null_mut();
2113                 ret
2114         }
2115 }
2116
2117 use lightning::ln::features::InvoiceRequestFeatures as nativeInvoiceRequestFeaturesImport;
2118 pub(crate) type nativeInvoiceRequestFeatures = nativeInvoiceRequestFeaturesImport;
2119
2120 /// Features used within an `invoice_request`.
2121 #[must_use]
2122 #[repr(C)]
2123 pub struct InvoiceRequestFeatures {
2124         /// A pointer to the opaque Rust object.
2125
2126         /// Nearly everywhere, inner must be non-null, however in places where
2127         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2128         pub inner: *mut nativeInvoiceRequestFeatures,
2129         /// Indicates that this is the only struct which contains the same pointer.
2130
2131         /// Rust functions which take ownership of an object provided via an argument require
2132         /// this to be true and invalidate the object pointed to by inner.
2133         pub is_owned: bool,
2134 }
2135
2136 impl Drop for InvoiceRequestFeatures {
2137         fn drop(&mut self) {
2138                 if self.is_owned && !<*mut nativeInvoiceRequestFeatures>::is_null(self.inner) {
2139                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2140                 }
2141         }
2142 }
2143 /// Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
2144 #[no_mangle]
2145 pub extern "C" fn InvoiceRequestFeatures_free(this_obj: InvoiceRequestFeatures) { }
2146 #[allow(unused)]
2147 /// Used only if an object of this type is returned as a trait impl by a method
2148 pub(crate) extern "C" fn InvoiceRequestFeatures_free_void(this_ptr: *mut c_void) {
2149         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceRequestFeatures) };
2150 }
2151 #[allow(unused)]
2152 impl InvoiceRequestFeatures {
2153         pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceRequestFeatures {
2154                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2155         }
2156         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceRequestFeatures {
2157                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2158         }
2159         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2160         pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceRequestFeatures {
2161                 assert!(self.is_owned);
2162                 let ret = ObjOps::untweak_ptr(self.inner);
2163                 self.inner = core::ptr::null_mut();
2164                 ret
2165         }
2166 }
2167
2168 use lightning::ln::features::Bolt12InvoiceFeatures as nativeBolt12InvoiceFeaturesImport;
2169 pub(crate) type nativeBolt12InvoiceFeatures = nativeBolt12InvoiceFeaturesImport;
2170
2171 /// Features used within an `invoice`.
2172 #[must_use]
2173 #[repr(C)]
2174 pub struct Bolt12InvoiceFeatures {
2175         /// A pointer to the opaque Rust object.
2176
2177         /// Nearly everywhere, inner must be non-null, however in places where
2178         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2179         pub inner: *mut nativeBolt12InvoiceFeatures,
2180         /// Indicates that this is the only struct which contains the same pointer.
2181
2182         /// Rust functions which take ownership of an object provided via an argument require
2183         /// this to be true and invalidate the object pointed to by inner.
2184         pub is_owned: bool,
2185 }
2186
2187 impl Drop for Bolt12InvoiceFeatures {
2188         fn drop(&mut self) {
2189                 if self.is_owned && !<*mut nativeBolt12InvoiceFeatures>::is_null(self.inner) {
2190                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2191                 }
2192         }
2193 }
2194 /// Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
2195 #[no_mangle]
2196 pub extern "C" fn Bolt12InvoiceFeatures_free(this_obj: Bolt12InvoiceFeatures) { }
2197 #[allow(unused)]
2198 /// Used only if an object of this type is returned as a trait impl by a method
2199 pub(crate) extern "C" fn Bolt12InvoiceFeatures_free_void(this_ptr: *mut c_void) {
2200         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt12InvoiceFeatures) };
2201 }
2202 #[allow(unused)]
2203 impl Bolt12InvoiceFeatures {
2204         pub(crate) fn get_native_ref(&self) -> &'static nativeBolt12InvoiceFeatures {
2205                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2206         }
2207         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt12InvoiceFeatures {
2208                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2209         }
2210         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2211         pub(crate) fn take_inner(mut self) -> *mut nativeBolt12InvoiceFeatures {
2212                 assert!(self.is_owned);
2213                 let ret = ObjOps::untweak_ptr(self.inner);
2214                 self.inner = core::ptr::null_mut();
2215                 ret
2216         }
2217 }
2218
2219 use lightning::ln::features::BlindedHopFeatures as nativeBlindedHopFeaturesImport;
2220 pub(crate) type nativeBlindedHopFeatures = nativeBlindedHopFeaturesImport;
2221
2222 /// Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
2223 #[must_use]
2224 #[repr(C)]
2225 pub struct BlindedHopFeatures {
2226         /// A pointer to the opaque Rust object.
2227
2228         /// Nearly everywhere, inner must be non-null, however in places where
2229         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2230         pub inner: *mut nativeBlindedHopFeatures,
2231         /// Indicates that this is the only struct which contains the same pointer.
2232
2233         /// Rust functions which take ownership of an object provided via an argument require
2234         /// this to be true and invalidate the object pointed to by inner.
2235         pub is_owned: bool,
2236 }
2237
2238 impl Drop for BlindedHopFeatures {
2239         fn drop(&mut self) {
2240                 if self.is_owned && !<*mut nativeBlindedHopFeatures>::is_null(self.inner) {
2241                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2242                 }
2243         }
2244 }
2245 /// Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
2246 #[no_mangle]
2247 pub extern "C" fn BlindedHopFeatures_free(this_obj: BlindedHopFeatures) { }
2248 #[allow(unused)]
2249 /// Used only if an object of this type is returned as a trait impl by a method
2250 pub(crate) extern "C" fn BlindedHopFeatures_free_void(this_ptr: *mut c_void) {
2251         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBlindedHopFeatures) };
2252 }
2253 #[allow(unused)]
2254 impl BlindedHopFeatures {
2255         pub(crate) fn get_native_ref(&self) -> &'static nativeBlindedHopFeatures {
2256                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2257         }
2258         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBlindedHopFeatures {
2259                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2260         }
2261         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2262         pub(crate) fn take_inner(mut self) -> *mut nativeBlindedHopFeatures {
2263                 assert!(self.is_owned);
2264                 let ret = ObjOps::untweak_ptr(self.inner);
2265                 self.inner = core::ptr::null_mut();
2266                 ret
2267         }
2268 }
2269
2270 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
2271 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
2272
2273 /// Features used within the channel_type field in an OpenChannel message.
2274 ///
2275 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
2276 /// semantics of our interaction with our peer.
2277 ///
2278 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
2279 /// the counterparty, only required features are allowed here.
2280 ///
2281 /// This is serialized differently from other feature types - it is not prefixed by a length, and
2282 /// thus must only appear inside a TLV where its length is known in advance.
2283 #[must_use]
2284 #[repr(C)]
2285 pub struct ChannelTypeFeatures {
2286         /// A pointer to the opaque Rust object.
2287
2288         /// Nearly everywhere, inner must be non-null, however in places where
2289         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
2290         pub inner: *mut nativeChannelTypeFeatures,
2291         /// Indicates that this is the only struct which contains the same pointer.
2292
2293         /// Rust functions which take ownership of an object provided via an argument require
2294         /// this to be true and invalidate the object pointed to by inner.
2295         pub is_owned: bool,
2296 }
2297
2298 impl Drop for ChannelTypeFeatures {
2299         fn drop(&mut self) {
2300                 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
2301                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
2302                 }
2303         }
2304 }
2305 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
2306 #[no_mangle]
2307 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
2308 #[allow(unused)]
2309 /// Used only if an object of this type is returned as a trait impl by a method
2310 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
2311         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures) };
2312 }
2313 #[allow(unused)]
2314 impl ChannelTypeFeatures {
2315         pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
2316                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
2317         }
2318         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
2319                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
2320         }
2321         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
2322         pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
2323                 assert!(self.is_owned);
2324                 let ret = ObjOps::untweak_ptr(self.inner);
2325                 self.inner = core::ptr::null_mut();
2326                 ret
2327         }
2328 }
2329 /// Create a blank Features with no features set
2330 #[must_use]
2331 #[no_mangle]
2332 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
2333         let mut ret = lightning::ln::features::InitFeatures::empty();
2334         crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2335 }
2336
2337 /// Returns true if this `Features` object contains required features unknown by `other`.
2338 #[must_use]
2339 #[no_mangle]
2340 pub extern "C" fn InitFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InitFeatures, other: &crate::lightning::ln::features::InitFeatures) -> bool {
2341         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2342         ret
2343 }
2344
2345 /// Returns true if this `Features` object contains unknown feature flags which are set as
2346 /// \"required\".
2347 #[must_use]
2348 #[no_mangle]
2349 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
2350         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2351         ret
2352 }
2353
2354 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2355 /// by [BOLT 9].
2356 ///
2357 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2358 /// be set instead (i.e., `bit - 1`).
2359 ///
2360 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2361 #[must_use]
2362 #[no_mangle]
2363 pub extern "C" fn InitFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::InitFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2364         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_required_feature_bit(bit);
2365         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() };
2366         local_ret
2367 }
2368
2369 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2370 /// by [BOLT 9].
2371 ///
2372 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2373 /// set instead (i.e., `bit + 1`).
2374 ///
2375 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2376 #[must_use]
2377 #[no_mangle]
2378 pub extern "C" fn InitFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::InitFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2379         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_optional_feature_bit(bit);
2380         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() };
2381         local_ret
2382 }
2383
2384 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2385 /// by [bLIP 2] or if it is a known `T` feature.
2386 ///
2387 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2388 /// be set instead (i.e., `bit - 1`).
2389 ///
2390 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2391 #[must_use]
2392 #[no_mangle]
2393 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 {
2394         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_required_custom_bit(bit);
2395         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() };
2396         local_ret
2397 }
2398
2399 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2400 /// by [bLIP 2] or if it is a known `T` feature.
2401 ///
2402 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2403 /// set instead (i.e., `bit + 1`).
2404 ///
2405 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2406 #[must_use]
2407 #[no_mangle]
2408 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 {
2409         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_optional_custom_bit(bit);
2410         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() };
2411         local_ret
2412 }
2413
2414 /// Create a blank Features with no features set
2415 #[must_use]
2416 #[no_mangle]
2417 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
2418         let mut ret = lightning::ln::features::NodeFeatures::empty();
2419         crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2420 }
2421
2422 /// Returns true if this `Features` object contains required features unknown by `other`.
2423 #[must_use]
2424 #[no_mangle]
2425 pub extern "C" fn NodeFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::NodeFeatures, other: &crate::lightning::ln::features::NodeFeatures) -> bool {
2426         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2427         ret
2428 }
2429
2430 /// Returns true if this `Features` object contains unknown feature flags which are set as
2431 /// \"required\".
2432 #[must_use]
2433 #[no_mangle]
2434 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
2435         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2436         ret
2437 }
2438
2439 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2440 /// by [BOLT 9].
2441 ///
2442 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2443 /// be set instead (i.e., `bit - 1`).
2444 ///
2445 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2446 #[must_use]
2447 #[no_mangle]
2448 pub extern "C" fn NodeFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::NodeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2449         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_required_feature_bit(bit);
2450         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() };
2451         local_ret
2452 }
2453
2454 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2455 /// by [BOLT 9].
2456 ///
2457 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2458 /// set instead (i.e., `bit + 1`).
2459 ///
2460 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2461 #[must_use]
2462 #[no_mangle]
2463 pub extern "C" fn NodeFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::NodeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2464         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_optional_feature_bit(bit);
2465         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() };
2466         local_ret
2467 }
2468
2469 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2470 /// by [bLIP 2] or if it is a known `T` feature.
2471 ///
2472 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2473 /// be set instead (i.e., `bit - 1`).
2474 ///
2475 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2476 #[must_use]
2477 #[no_mangle]
2478 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 {
2479         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_required_custom_bit(bit);
2480         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() };
2481         local_ret
2482 }
2483
2484 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2485 /// by [bLIP 2] or if it is a known `T` feature.
2486 ///
2487 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2488 /// set instead (i.e., `bit + 1`).
2489 ///
2490 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2491 #[must_use]
2492 #[no_mangle]
2493 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 {
2494         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_optional_custom_bit(bit);
2495         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() };
2496         local_ret
2497 }
2498
2499 /// Create a blank Features with no features set
2500 #[must_use]
2501 #[no_mangle]
2502 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
2503         let mut ret = lightning::ln::features::ChannelFeatures::empty();
2504         crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2505 }
2506
2507 /// Returns true if this `Features` object contains required features unknown by `other`.
2508 #[must_use]
2509 #[no_mangle]
2510 pub extern "C" fn ChannelFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelFeatures, other: &crate::lightning::ln::features::ChannelFeatures) -> bool {
2511         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2512         ret
2513 }
2514
2515 /// Returns true if this `Features` object contains unknown feature flags which are set as
2516 /// \"required\".
2517 #[must_use]
2518 #[no_mangle]
2519 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
2520         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2521         ret
2522 }
2523
2524 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2525 /// by [BOLT 9].
2526 ///
2527 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2528 /// be set instead (i.e., `bit - 1`).
2529 ///
2530 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2531 #[must_use]
2532 #[no_mangle]
2533 pub extern "C" fn ChannelFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::ChannelFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2534         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_required_feature_bit(bit);
2535         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() };
2536         local_ret
2537 }
2538
2539 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2540 /// by [BOLT 9].
2541 ///
2542 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2543 /// set instead (i.e., `bit + 1`).
2544 ///
2545 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2546 #[must_use]
2547 #[no_mangle]
2548 pub extern "C" fn ChannelFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::ChannelFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2549         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_optional_feature_bit(bit);
2550         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() };
2551         local_ret
2552 }
2553
2554 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2555 /// by [bLIP 2] or if it is a known `T` feature.
2556 ///
2557 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2558 /// be set instead (i.e., `bit - 1`).
2559 ///
2560 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2561 #[must_use]
2562 #[no_mangle]
2563 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 {
2564         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_required_custom_bit(bit);
2565         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() };
2566         local_ret
2567 }
2568
2569 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2570 /// by [bLIP 2] or if it is a known `T` feature.
2571 ///
2572 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2573 /// set instead (i.e., `bit + 1`).
2574 ///
2575 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2576 #[must_use]
2577 #[no_mangle]
2578 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 {
2579         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_optional_custom_bit(bit);
2580         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() };
2581         local_ret
2582 }
2583
2584 /// Create a blank Features with no features set
2585 #[must_use]
2586 #[no_mangle]
2587 pub extern "C" fn Bolt11InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt11InvoiceFeatures {
2588         let mut ret = lightning::ln::features::Bolt11InvoiceFeatures::empty();
2589         crate::lightning::ln::features::Bolt11InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2590 }
2591
2592 /// Returns true if this `Features` object contains required features unknown by `other`.
2593 #[must_use]
2594 #[no_mangle]
2595 pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures, other: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
2596         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2597         ret
2598 }
2599
2600 /// Returns true if this `Features` object contains unknown feature flags which are set as
2601 /// \"required\".
2602 #[must_use]
2603 #[no_mangle]
2604 pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
2605         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2606         ret
2607 }
2608
2609 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2610 /// by [BOLT 9].
2611 ///
2612 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2613 /// be set instead (i.e., `bit - 1`).
2614 ///
2615 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2616 #[must_use]
2617 #[no_mangle]
2618 pub extern "C" fn Bolt11InvoiceFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2619         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_required_feature_bit(bit);
2620         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() };
2621         local_ret
2622 }
2623
2624 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2625 /// by [BOLT 9].
2626 ///
2627 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2628 /// set instead (i.e., `bit + 1`).
2629 ///
2630 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2631 #[must_use]
2632 #[no_mangle]
2633 pub extern "C" fn Bolt11InvoiceFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::Bolt11InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2634         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_optional_feature_bit(bit);
2635         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() };
2636         local_ret
2637 }
2638
2639 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2640 /// by [bLIP 2] or if it is a known `T` feature.
2641 ///
2642 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2643 /// be set instead (i.e., `bit - 1`).
2644 ///
2645 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2646 #[must_use]
2647 #[no_mangle]
2648 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 {
2649         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_required_custom_bit(bit);
2650         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() };
2651         local_ret
2652 }
2653
2654 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2655 /// by [bLIP 2] or if it is a known `T` feature.
2656 ///
2657 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2658 /// set instead (i.e., `bit + 1`).
2659 ///
2660 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2661 #[must_use]
2662 #[no_mangle]
2663 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 {
2664         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_optional_custom_bit(bit);
2665         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() };
2666         local_ret
2667 }
2668
2669 /// Create a blank Features with no features set
2670 #[must_use]
2671 #[no_mangle]
2672 pub extern "C" fn OfferFeatures_empty() -> crate::lightning::ln::features::OfferFeatures {
2673         let mut ret = lightning::ln::features::OfferFeatures::empty();
2674         crate::lightning::ln::features::OfferFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2675 }
2676
2677 /// Returns true if this `Features` object contains required features unknown by `other`.
2678 #[must_use]
2679 #[no_mangle]
2680 pub extern "C" fn OfferFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::OfferFeatures, other: &crate::lightning::ln::features::OfferFeatures) -> bool {
2681         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2682         ret
2683 }
2684
2685 /// Returns true if this `Features` object contains unknown feature flags which are set as
2686 /// \"required\".
2687 #[must_use]
2688 #[no_mangle]
2689 pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::OfferFeatures) -> bool {
2690         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2691         ret
2692 }
2693
2694 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2695 /// by [BOLT 9].
2696 ///
2697 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2698 /// be set instead (i.e., `bit - 1`).
2699 ///
2700 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2701 #[must_use]
2702 #[no_mangle]
2703 pub extern "C" fn OfferFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::OfferFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2704         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_required_feature_bit(bit);
2705         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() };
2706         local_ret
2707 }
2708
2709 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2710 /// by [BOLT 9].
2711 ///
2712 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2713 /// set instead (i.e., `bit + 1`).
2714 ///
2715 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2716 #[must_use]
2717 #[no_mangle]
2718 pub extern "C" fn OfferFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::OfferFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2719         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_optional_feature_bit(bit);
2720         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() };
2721         local_ret
2722 }
2723
2724 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2725 /// by [bLIP 2] or if it is a known `T` feature.
2726 ///
2727 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2728 /// be set instead (i.e., `bit - 1`).
2729 ///
2730 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2731 #[must_use]
2732 #[no_mangle]
2733 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 {
2734         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_required_custom_bit(bit);
2735         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() };
2736         local_ret
2737 }
2738
2739 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2740 /// by [bLIP 2] or if it is a known `T` feature.
2741 ///
2742 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2743 /// set instead (i.e., `bit + 1`).
2744 ///
2745 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2746 #[must_use]
2747 #[no_mangle]
2748 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 {
2749         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_optional_custom_bit(bit);
2750         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() };
2751         local_ret
2752 }
2753
2754 /// Create a blank Features with no features set
2755 #[must_use]
2756 #[no_mangle]
2757 pub extern "C" fn InvoiceRequestFeatures_empty() -> crate::lightning::ln::features::InvoiceRequestFeatures {
2758         let mut ret = lightning::ln::features::InvoiceRequestFeatures::empty();
2759         crate::lightning::ln::features::InvoiceRequestFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2760 }
2761
2762 /// Returns true if this `Features` object contains required features unknown by `other`.
2763 #[must_use]
2764 #[no_mangle]
2765 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures, other: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
2766         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2767         ret
2768 }
2769
2770 /// Returns true if this `Features` object contains unknown feature flags which are set as
2771 /// \"required\".
2772 #[must_use]
2773 #[no_mangle]
2774 pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
2775         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2776         ret
2777 }
2778
2779 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2780 /// by [BOLT 9].
2781 ///
2782 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2783 /// be set instead (i.e., `bit - 1`).
2784 ///
2785 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2786 #[must_use]
2787 #[no_mangle]
2788 pub extern "C" fn InvoiceRequestFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::InvoiceRequestFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2789         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_required_feature_bit(bit);
2790         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() };
2791         local_ret
2792 }
2793
2794 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2795 /// by [BOLT 9].
2796 ///
2797 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2798 /// set instead (i.e., `bit + 1`).
2799 ///
2800 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2801 #[must_use]
2802 #[no_mangle]
2803 pub extern "C" fn InvoiceRequestFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::InvoiceRequestFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2804         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_optional_feature_bit(bit);
2805         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() };
2806         local_ret
2807 }
2808
2809 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2810 /// by [bLIP 2] or if it is a known `T` feature.
2811 ///
2812 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2813 /// be set instead (i.e., `bit - 1`).
2814 ///
2815 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2816 #[must_use]
2817 #[no_mangle]
2818 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 {
2819         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_required_custom_bit(bit);
2820         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() };
2821         local_ret
2822 }
2823
2824 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2825 /// by [bLIP 2] or if it is a known `T` feature.
2826 ///
2827 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2828 /// set instead (i.e., `bit + 1`).
2829 ///
2830 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2831 #[must_use]
2832 #[no_mangle]
2833 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 {
2834         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_optional_custom_bit(bit);
2835         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() };
2836         local_ret
2837 }
2838
2839 /// Create a blank Features with no features set
2840 #[must_use]
2841 #[no_mangle]
2842 pub extern "C" fn Bolt12InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt12InvoiceFeatures {
2843         let mut ret = lightning::ln::features::Bolt12InvoiceFeatures::empty();
2844         crate::lightning::ln::features::Bolt12InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2845 }
2846
2847 /// Returns true if this `Features` object contains required features unknown by `other`.
2848 #[must_use]
2849 #[no_mangle]
2850 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures, other: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2851         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2852         ret
2853 }
2854
2855 /// Returns true if this `Features` object contains unknown feature flags which are set as
2856 /// \"required\".
2857 #[must_use]
2858 #[no_mangle]
2859 pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> bool {
2860         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2861         ret
2862 }
2863
2864 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2865 /// by [BOLT 9].
2866 ///
2867 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2868 /// be set instead (i.e., `bit - 1`).
2869 ///
2870 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2871 #[must_use]
2872 #[no_mangle]
2873 pub extern "C" fn Bolt12InvoiceFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2874         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_required_feature_bit(bit);
2875         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() };
2876         local_ret
2877 }
2878
2879 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2880 /// by [BOLT 9].
2881 ///
2882 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2883 /// set instead (i.e., `bit + 1`).
2884 ///
2885 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2886 #[must_use]
2887 #[no_mangle]
2888 pub extern "C" fn Bolt12InvoiceFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::Bolt12InvoiceFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2889         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_optional_feature_bit(bit);
2890         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() };
2891         local_ret
2892 }
2893
2894 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2895 /// by [bLIP 2] or if it is a known `T` feature.
2896 ///
2897 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2898 /// be set instead (i.e., `bit - 1`).
2899 ///
2900 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2901 #[must_use]
2902 #[no_mangle]
2903 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 {
2904         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_required_custom_bit(bit);
2905         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() };
2906         local_ret
2907 }
2908
2909 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2910 /// by [bLIP 2] or if it is a known `T` feature.
2911 ///
2912 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2913 /// set instead (i.e., `bit + 1`).
2914 ///
2915 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2916 #[must_use]
2917 #[no_mangle]
2918 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 {
2919         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_optional_custom_bit(bit);
2920         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() };
2921         local_ret
2922 }
2923
2924 /// Create a blank Features with no features set
2925 #[must_use]
2926 #[no_mangle]
2927 pub extern "C" fn BlindedHopFeatures_empty() -> crate::lightning::ln::features::BlindedHopFeatures {
2928         let mut ret = lightning::ln::features::BlindedHopFeatures::empty();
2929         crate::lightning::ln::features::BlindedHopFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
2930 }
2931
2932 /// Returns true if this `Features` object contains required features unknown by `other`.
2933 #[must_use]
2934 #[no_mangle]
2935 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::BlindedHopFeatures, other: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2936         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
2937         ret
2938 }
2939
2940 /// Returns true if this `Features` object contains unknown feature flags which are set as
2941 /// \"required\".
2942 #[must_use]
2943 #[no_mangle]
2944 pub extern "C" fn BlindedHopFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::BlindedHopFeatures) -> bool {
2945         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
2946         ret
2947 }
2948
2949 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
2950 /// by [BOLT 9].
2951 ///
2952 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2953 /// be set instead (i.e., `bit - 1`).
2954 ///
2955 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2956 #[must_use]
2957 #[no_mangle]
2958 pub extern "C" fn BlindedHopFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::BlindedHopFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2959         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_required_feature_bit(bit);
2960         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() };
2961         local_ret
2962 }
2963
2964 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
2965 /// by [BOLT 9].
2966 ///
2967 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2968 /// set instead (i.e., `bit + 1`).
2969 ///
2970 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
2971 #[must_use]
2972 #[no_mangle]
2973 pub extern "C" fn BlindedHopFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::BlindedHopFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
2974         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_optional_feature_bit(bit);
2975         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() };
2976         local_ret
2977 }
2978
2979 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
2980 /// by [bLIP 2] or if it is a known `T` feature.
2981 ///
2982 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
2983 /// be set instead (i.e., `bit - 1`).
2984 ///
2985 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
2986 #[must_use]
2987 #[no_mangle]
2988 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 {
2989         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_required_custom_bit(bit);
2990         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() };
2991         local_ret
2992 }
2993
2994 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
2995 /// by [bLIP 2] or if it is a known `T` feature.
2996 ///
2997 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
2998 /// set instead (i.e., `bit + 1`).
2999 ///
3000 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
3001 #[must_use]
3002 #[no_mangle]
3003 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 {
3004         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_optional_custom_bit(bit);
3005         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() };
3006         local_ret
3007 }
3008
3009 /// Create a blank Features with no features set
3010 #[must_use]
3011 #[no_mangle]
3012 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
3013         let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
3014         crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
3015 }
3016
3017 /// Returns true if this `Features` object contains required features unknown by `other`.
3018 #[must_use]
3019 #[no_mangle]
3020 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures, other: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
3021         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
3022         ret
3023 }
3024
3025 /// Returns true if this `Features` object contains unknown feature flags which are set as
3026 /// \"required\".
3027 #[must_use]
3028 #[no_mangle]
3029 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
3030         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
3031         ret
3032 }
3033
3034 /// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
3035 /// by [BOLT 9].
3036 ///
3037 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
3038 /// be set instead (i.e., `bit - 1`).
3039 ///
3040 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
3041 #[must_use]
3042 #[no_mangle]
3043 pub extern "C" fn ChannelTypeFeatures_set_required_feature_bit(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
3044         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_required_feature_bit(bit);
3045         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() };
3046         local_ret
3047 }
3048
3049 /// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
3050 /// by [BOLT 9].
3051 ///
3052 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
3053 /// set instead (i.e., `bit + 1`).
3054 ///
3055 /// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
3056 #[must_use]
3057 #[no_mangle]
3058 pub extern "C" fn ChannelTypeFeatures_set_optional_feature_bit(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures, mut bit: usize) -> crate::c_types::derived::CResult_NoneNoneZ {
3059         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_optional_feature_bit(bit);
3060         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() };
3061         local_ret
3062 }
3063
3064 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
3065 /// by [bLIP 2] or if it is a known `T` feature.
3066 ///
3067 /// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
3068 /// be set instead (i.e., `bit - 1`).
3069 ///
3070 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
3071 #[must_use]
3072 #[no_mangle]
3073 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 {
3074         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_required_custom_bit(bit);
3075         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() };
3076         local_ret
3077 }
3078
3079 /// Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
3080 /// by [bLIP 2] or if it is a known `T` feature.
3081 ///
3082 /// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
3083 /// set instead (i.e., `bit + 1`).
3084 ///
3085 /// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
3086 #[must_use]
3087 #[no_mangle]
3088 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 {
3089         let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_optional_custom_bit(bit);
3090         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() };
3091         local_ret
3092 }
3093
3094 #[no_mangle]
3095 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
3096 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
3097         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3098 }
3099 #[allow(unused)]
3100 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3101         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
3102 }
3103 #[no_mangle]
3104 /// Read a InitFeatures from a byte array, created by InitFeatures_write
3105 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
3106         let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3107         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() };
3108         local_res
3109 }
3110 #[no_mangle]
3111 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
3112 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
3113         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3114 }
3115 #[allow(unused)]
3116 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3117         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
3118 }
3119 #[no_mangle]
3120 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
3121 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
3122         let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3123         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() };
3124         local_res
3125 }
3126 #[no_mangle]
3127 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
3128 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
3129         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3130 }
3131 #[allow(unused)]
3132 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3133         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
3134 }
3135 #[no_mangle]
3136 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
3137 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
3138         let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3139         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() };
3140         local_res
3141 }
3142 #[no_mangle]
3143 /// Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
3144 pub extern "C" fn Bolt11InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
3145         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3146 }
3147 #[allow(unused)]
3148 pub(crate) extern "C" fn Bolt11InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3149         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt11InvoiceFeatures) })
3150 }
3151 #[no_mangle]
3152 /// Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
3153 pub extern "C" fn Bolt11InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_Bolt11InvoiceFeaturesDecodeErrorZ {
3154         let res: Result<lightning::ln::features::Bolt11InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3155         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() };
3156         local_res
3157 }
3158 #[no_mangle]
3159 /// Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
3160 pub extern "C" fn Bolt12InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
3161         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3162 }
3163 #[allow(unused)]
3164 pub(crate) extern "C" fn Bolt12InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3165         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt12InvoiceFeatures) })
3166 }
3167 #[no_mangle]
3168 /// Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
3169 pub extern "C" fn Bolt12InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_Bolt12InvoiceFeaturesDecodeErrorZ {
3170         let res: Result<lightning::ln::features::Bolt12InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3171         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() };
3172         local_res
3173 }
3174 #[no_mangle]
3175 /// Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
3176 pub extern "C" fn BlindedHopFeatures_write(obj: &crate::lightning::ln::features::BlindedHopFeatures) -> crate::c_types::derived::CVec_u8Z {
3177         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3178 }
3179 #[allow(unused)]
3180 pub(crate) extern "C" fn BlindedHopFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3181         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedHopFeatures) })
3182 }
3183 #[no_mangle]
3184 /// Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
3185 pub extern "C" fn BlindedHopFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_BlindedHopFeaturesDecodeErrorZ {
3186         let res: Result<lightning::ln::features::BlindedHopFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3187         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() };
3188         local_res
3189 }
3190 #[no_mangle]
3191 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
3192 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
3193         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
3194 }
3195 #[allow(unused)]
3196 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
3197         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
3198 }
3199 #[no_mangle]
3200 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
3201 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
3202         let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
3203         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() };
3204         local_res
3205 }