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