Update auto-generated bindings
[ldk-c-bindings] / lightning-c-bindings / src / lightning / ln / features.rs
1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
3 //
4 // This file is licensed under the license available in the LICENSE or LICENSE.md
5 // file in the root of this repository or, if no such file exists, the same
6 // license as that which applies to the original source files from which this
7 // source was automatically generated.
8
9 //! Feature flag definitions for the Lightning protocol according to [BOLT #9].
10 //!
11 //! Lightning nodes advertise a supported set of operation through feature flags. Features are
12 //! applicable for a specific context as indicated in some [messages]. [`Features`] encapsulates
13 //! behavior for specifying and checking feature flags for a particular context. Each feature is
14 //! defined internally by a trait specifying the corresponding flags (i.e., even and odd bits).
15 //!
16 //! Whether a feature is considered \"known\" or \"unknown\" is relative to the implementation, whereas
17 //! the term \"supports\" is used in reference to a particular set of [`Features`]. That is, a node
18 //! supports a feature if it advertises the feature (as either required or optional) to its peers.
19 //! And the implementation can interpret a feature if the feature is known to it.
20 //!
21 //! The following features are currently required in the LDK:
22 //! - `VariableLengthOnion` - requires/supports variable-length routing onion payloads
23 //!     (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for more information).
24 //! - `StaticRemoteKey` - requires/supports static key for remote output
25 //!     (see [BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md) for more information).
26 //!
27 //! The following features are currently supported in the LDK:
28 //! - `DataLossProtect` - requires/supports that a node which has somehow fallen behind, e.g., has been restored from an old backup,
29 //!     can detect that it has fallen behind
30 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
31 //! - `InitialRoutingSync` - requires/supports that the sending node needs a complete routing information dump
32 //!     (see [BOLT-7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#initial-sync) for more information).
33 //! - `UpfrontShutdownScript` - commits to a shutdown scriptpubkey when opening a channel
34 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message) for more information).
35 //! - `GossipQueries` - requires/supports more sophisticated gossip control
36 //!     (see [BOLT-7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md) for more information).
37 //! - `PaymentSecret` - requires/supports that a node supports payment_secret field
38 //!     (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md) for more information).
39 //! - `BasicMPP` - requires/supports that a node can receive basic multi-part payments
40 //!     (see [BOLT-4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#basic-multi-part-payments) for more information).
41 //! - `Wumbo` - requires/supports that a node create large channels. Called `option_support_large_channel` in the spec.
42 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message) for more information).
43 //! - `ShutdownAnySegwit` - requires/supports that future segwit versions are allowed in `shutdown`
44 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
45 //! - `OnionMessages` - requires/supports forwarding onion messages
46 //!     (see [BOLT-7](https://github.com/lightning/bolts/pull/759/files) for more information).
47 //!     TODO: update link
48 //! - `ChannelType` - node supports the channel_type field in open/accept
49 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
50 //! - `SCIDPrivacy` - supply channel aliases for routing
51 //!     (see [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md) for more information).
52 //! - `Keysend` - send funds to a node without an invoice
53 //!     (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
54 //!
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 ChannelTypeFeaturess 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 ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> 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 impl Clone for InitFeatures {
1067         fn clone(&self) -> Self {
1068                 Self {
1069                         inner: if <*mut nativeInitFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1070                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1071                         is_owned: true,
1072                 }
1073         }
1074 }
1075 #[allow(unused)]
1076 /// Used only if an object of this type is returned as a trait impl by a method
1077 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1078         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
1079 }
1080 #[no_mangle]
1081 /// Creates a copy of the InitFeatures
1082 pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
1083         orig.clone()
1084 }
1085 impl Clone for NodeFeatures {
1086         fn clone(&self) -> Self {
1087                 Self {
1088                         inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1089                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1090                         is_owned: true,
1091                 }
1092         }
1093 }
1094 #[allow(unused)]
1095 /// Used only if an object of this type is returned as a trait impl by a method
1096 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1097         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
1098 }
1099 #[no_mangle]
1100 /// Creates a copy of the NodeFeatures
1101 pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
1102         orig.clone()
1103 }
1104 impl Clone for ChannelFeatures {
1105         fn clone(&self) -> Self {
1106                 Self {
1107                         inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1108                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1109                         is_owned: true,
1110                 }
1111         }
1112 }
1113 #[allow(unused)]
1114 /// Used only if an object of this type is returned as a trait impl by a method
1115 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1116         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
1117 }
1118 #[no_mangle]
1119 /// Creates a copy of the ChannelFeatures
1120 pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
1121         orig.clone()
1122 }
1123 impl Clone for InvoiceFeatures {
1124         fn clone(&self) -> Self {
1125                 Self {
1126                         inner: if <*mut nativeInvoiceFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1127                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1128                         is_owned: true,
1129                 }
1130         }
1131 }
1132 #[allow(unused)]
1133 /// Used only if an object of this type is returned as a trait impl by a method
1134 pub(crate) extern "C" fn InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1135         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceFeatures)).clone() })) as *mut c_void
1136 }
1137 #[no_mangle]
1138 /// Creates a copy of the InvoiceFeatures
1139 pub extern "C" fn InvoiceFeatures_clone(orig: &InvoiceFeatures) -> InvoiceFeatures {
1140         orig.clone()
1141 }
1142 impl Clone for ChannelTypeFeatures {
1143         fn clone(&self) -> Self {
1144                 Self {
1145                         inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { core::ptr::null_mut() } else {
1146                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
1147                         is_owned: true,
1148                 }
1149         }
1150 }
1151 #[allow(unused)]
1152 /// Used only if an object of this type is returned as a trait impl by a method
1153 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
1154         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
1155 }
1156 #[no_mangle]
1157 /// Creates a copy of the ChannelTypeFeatures
1158 pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
1159         orig.clone()
1160 }
1161
1162 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
1163 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
1164
1165 /// Features used within an `init` message.
1166 #[must_use]
1167 #[repr(C)]
1168 pub struct InitFeatures {
1169         /// A pointer to the opaque Rust object.
1170
1171         /// Nearly everywhere, inner must be non-null, however in places where
1172         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1173         pub inner: *mut nativeInitFeatures,
1174         /// Indicates that this is the only struct which contains the same pointer.
1175
1176         /// Rust functions which take ownership of an object provided via an argument require
1177         /// this to be true and invalidate the object pointed to by inner.
1178         pub is_owned: bool,
1179 }
1180
1181 impl Drop for InitFeatures {
1182         fn drop(&mut self) {
1183                 if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) {
1184                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1185                 }
1186         }
1187 }
1188 /// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
1189 #[no_mangle]
1190 pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
1191 #[allow(unused)]
1192 /// Used only if an object of this type is returned as a trait impl by a method
1193 pub(crate) extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
1194         unsafe { let _ = Box::from_raw(this_ptr as *mut nativeInitFeatures); }
1195 }
1196 #[allow(unused)]
1197 impl InitFeatures {
1198         pub(crate) fn get_native_ref(&self) -> &'static nativeInitFeatures {
1199                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1200         }
1201         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInitFeatures {
1202                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1203         }
1204         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1205         pub(crate) fn take_inner(mut self) -> *mut nativeInitFeatures {
1206                 assert!(self.is_owned);
1207                 let ret = ObjOps::untweak_ptr(self.inner);
1208                 self.inner = core::ptr::null_mut();
1209                 ret
1210         }
1211 }
1212
1213 use lightning::ln::features::NodeFeatures as nativeNodeFeaturesImport;
1214 pub(crate) type nativeNodeFeatures = nativeNodeFeaturesImport;
1215
1216 /// Features used within a `node_announcement` message.
1217 #[must_use]
1218 #[repr(C)]
1219 pub struct NodeFeatures {
1220         /// A pointer to the opaque Rust object.
1221
1222         /// Nearly everywhere, inner must be non-null, however in places where
1223         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1224         pub inner: *mut nativeNodeFeatures,
1225         /// Indicates that this is the only struct which contains the same pointer.
1226
1227         /// Rust functions which take ownership of an object provided via an argument require
1228         /// this to be true and invalidate the object pointed to by inner.
1229         pub is_owned: bool,
1230 }
1231
1232 impl Drop for NodeFeatures {
1233         fn drop(&mut self) {
1234                 if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) {
1235                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1236                 }
1237         }
1238 }
1239 /// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
1240 #[no_mangle]
1241 pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
1242 #[allow(unused)]
1243 /// Used only if an object of this type is returned as a trait impl by a method
1244 pub(crate) extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
1245         unsafe { let _ = Box::from_raw(this_ptr as *mut nativeNodeFeatures); }
1246 }
1247 #[allow(unused)]
1248 impl NodeFeatures {
1249         pub(crate) fn get_native_ref(&self) -> &'static nativeNodeFeatures {
1250                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1251         }
1252         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeNodeFeatures {
1253                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1254         }
1255         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1256         pub(crate) fn take_inner(mut self) -> *mut nativeNodeFeatures {
1257                 assert!(self.is_owned);
1258                 let ret = ObjOps::untweak_ptr(self.inner);
1259                 self.inner = core::ptr::null_mut();
1260                 ret
1261         }
1262 }
1263
1264 use lightning::ln::features::ChannelFeatures as nativeChannelFeaturesImport;
1265 pub(crate) type nativeChannelFeatures = nativeChannelFeaturesImport;
1266
1267 /// Features used within a `channel_announcement` message.
1268 #[must_use]
1269 #[repr(C)]
1270 pub struct ChannelFeatures {
1271         /// A pointer to the opaque Rust object.
1272
1273         /// Nearly everywhere, inner must be non-null, however in places where
1274         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1275         pub inner: *mut nativeChannelFeatures,
1276         /// Indicates that this is the only struct which contains the same pointer.
1277
1278         /// Rust functions which take ownership of an object provided via an argument require
1279         /// this to be true and invalidate the object pointed to by inner.
1280         pub is_owned: bool,
1281 }
1282
1283 impl Drop for ChannelFeatures {
1284         fn drop(&mut self) {
1285                 if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) {
1286                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1287                 }
1288         }
1289 }
1290 /// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
1291 #[no_mangle]
1292 pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
1293 #[allow(unused)]
1294 /// Used only if an object of this type is returned as a trait impl by a method
1295 pub(crate) extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
1296         unsafe { let _ = Box::from_raw(this_ptr as *mut nativeChannelFeatures); }
1297 }
1298 #[allow(unused)]
1299 impl ChannelFeatures {
1300         pub(crate) fn get_native_ref(&self) -> &'static nativeChannelFeatures {
1301                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1302         }
1303         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelFeatures {
1304                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1305         }
1306         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1307         pub(crate) fn take_inner(mut self) -> *mut nativeChannelFeatures {
1308                 assert!(self.is_owned);
1309                 let ret = ObjOps::untweak_ptr(self.inner);
1310                 self.inner = core::ptr::null_mut();
1311                 ret
1312         }
1313 }
1314
1315 use lightning::ln::features::InvoiceFeatures as nativeInvoiceFeaturesImport;
1316 pub(crate) type nativeInvoiceFeatures = nativeInvoiceFeaturesImport;
1317
1318 /// Features used within an invoice.
1319 #[must_use]
1320 #[repr(C)]
1321 pub struct InvoiceFeatures {
1322         /// A pointer to the opaque Rust object.
1323
1324         /// Nearly everywhere, inner must be non-null, however in places where
1325         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1326         pub inner: *mut nativeInvoiceFeatures,
1327         /// Indicates that this is the only struct which contains the same pointer.
1328
1329         /// Rust functions which take ownership of an object provided via an argument require
1330         /// this to be true and invalidate the object pointed to by inner.
1331         pub is_owned: bool,
1332 }
1333
1334 impl Drop for InvoiceFeatures {
1335         fn drop(&mut self) {
1336                 if self.is_owned && !<*mut nativeInvoiceFeatures>::is_null(self.inner) {
1337                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1338                 }
1339         }
1340 }
1341 /// Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
1342 #[no_mangle]
1343 pub extern "C" fn InvoiceFeatures_free(this_obj: InvoiceFeatures) { }
1344 #[allow(unused)]
1345 /// Used only if an object of this type is returned as a trait impl by a method
1346 pub(crate) extern "C" fn InvoiceFeatures_free_void(this_ptr: *mut c_void) {
1347         unsafe { let _ = Box::from_raw(this_ptr as *mut nativeInvoiceFeatures); }
1348 }
1349 #[allow(unused)]
1350 impl InvoiceFeatures {
1351         pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceFeatures {
1352                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1353         }
1354         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceFeatures {
1355                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1356         }
1357         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1358         pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceFeatures {
1359                 assert!(self.is_owned);
1360                 let ret = ObjOps::untweak_ptr(self.inner);
1361                 self.inner = core::ptr::null_mut();
1362                 ret
1363         }
1364 }
1365
1366 use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
1367 pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
1368
1369 /// Features used within the channel_type field in an OpenChannel message.
1370 ///
1371 /// A channel is always of some known \"type\", describing the transaction formats used and the exact
1372 /// semantics of our interaction with our peer.
1373 ///
1374 /// Note that because a channel is a specific type which is proposed by the opener and accepted by
1375 /// the counterparty, only required features are allowed here.
1376 ///
1377 /// This is serialized differently from other feature types - it is not prefixed by a length, and
1378 /// thus must only appear inside a TLV where its length is known in advance.
1379 #[must_use]
1380 #[repr(C)]
1381 pub struct ChannelTypeFeatures {
1382         /// A pointer to the opaque Rust object.
1383
1384         /// Nearly everywhere, inner must be non-null, however in places where
1385         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
1386         pub inner: *mut nativeChannelTypeFeatures,
1387         /// Indicates that this is the only struct which contains the same pointer.
1388
1389         /// Rust functions which take ownership of an object provided via an argument require
1390         /// this to be true and invalidate the object pointed to by inner.
1391         pub is_owned: bool,
1392 }
1393
1394 impl Drop for ChannelTypeFeatures {
1395         fn drop(&mut self) {
1396                 if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
1397                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
1398                 }
1399         }
1400 }
1401 /// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
1402 #[no_mangle]
1403 pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
1404 #[allow(unused)]
1405 /// Used only if an object of this type is returned as a trait impl by a method
1406 pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
1407         unsafe { let _ = Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures); }
1408 }
1409 #[allow(unused)]
1410 impl ChannelTypeFeatures {
1411         pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
1412                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
1413         }
1414         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
1415                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
1416         }
1417         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
1418         pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
1419                 assert!(self.is_owned);
1420                 let ret = ObjOps::untweak_ptr(self.inner);
1421                 self.inner = core::ptr::null_mut();
1422                 ret
1423         }
1424 }
1425 /// Returns the set of known init features that are related to channels. At least some of
1426 /// these features are likely required for peers to talk to us.
1427 #[must_use]
1428 #[no_mangle]
1429 pub extern "C" fn InitFeatures_known_channel_features() -> crate::lightning::ln::features::InitFeatures {
1430         let mut ret = lightning::ln::features::InitFeatures::known_channel_features();
1431         crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1432 }
1433
1434 /// Returns the set of known node features that are related to channels.
1435 #[must_use]
1436 #[no_mangle]
1437 pub extern "C" fn NodeFeatures_known_channel_features() -> crate::lightning::ln::features::NodeFeatures {
1438         let mut ret = lightning::ln::features::NodeFeatures::known_channel_features();
1439         crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1440 }
1441
1442 /// Create a blank Features with no features set
1443 #[must_use]
1444 #[no_mangle]
1445 pub extern "C" fn InitFeatures_empty() -> crate::lightning::ln::features::InitFeatures {
1446         let mut ret = lightning::ln::features::InitFeatures::empty();
1447         crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1448 }
1449
1450 /// Creates a Features with the bits set which are known by the implementation
1451 #[must_use]
1452 #[no_mangle]
1453 pub extern "C" fn InitFeatures_known() -> crate::lightning::ln::features::InitFeatures {
1454         let mut ret = lightning::ln::features::InitFeatures::known();
1455         crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1456 }
1457
1458 /// Returns true if this `Features` object contains unknown feature flags which are set as
1459 /// \"required\".
1460 #[must_use]
1461 #[no_mangle]
1462 pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
1463         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1464         ret
1465 }
1466
1467 /// Create a blank Features with no features set
1468 #[must_use]
1469 #[no_mangle]
1470 pub extern "C" fn NodeFeatures_empty() -> crate::lightning::ln::features::NodeFeatures {
1471         let mut ret = lightning::ln::features::NodeFeatures::empty();
1472         crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1473 }
1474
1475 /// Creates a Features with the bits set which are known by the implementation
1476 #[must_use]
1477 #[no_mangle]
1478 pub extern "C" fn NodeFeatures_known() -> crate::lightning::ln::features::NodeFeatures {
1479         let mut ret = lightning::ln::features::NodeFeatures::known();
1480         crate::lightning::ln::features::NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1481 }
1482
1483 /// Returns true if this `Features` object contains unknown feature flags which are set as
1484 /// \"required\".
1485 #[must_use]
1486 #[no_mangle]
1487 pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
1488         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1489         ret
1490 }
1491
1492 /// Create a blank Features with no features set
1493 #[must_use]
1494 #[no_mangle]
1495 pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
1496         let mut ret = lightning::ln::features::ChannelFeatures::empty();
1497         crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1498 }
1499
1500 /// Creates a Features with the bits set which are known by the implementation
1501 #[must_use]
1502 #[no_mangle]
1503 pub extern "C" fn ChannelFeatures_known() -> crate::lightning::ln::features::ChannelFeatures {
1504         let mut ret = lightning::ln::features::ChannelFeatures::known();
1505         crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1506 }
1507
1508 /// Returns true if this `Features` object contains unknown feature flags which are set as
1509 /// \"required\".
1510 #[must_use]
1511 #[no_mangle]
1512 pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
1513         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1514         ret
1515 }
1516
1517 /// Create a blank Features with no features set
1518 #[must_use]
1519 #[no_mangle]
1520 pub extern "C" fn InvoiceFeatures_empty() -> crate::lightning::ln::features::InvoiceFeatures {
1521         let mut ret = lightning::ln::features::InvoiceFeatures::empty();
1522         crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1523 }
1524
1525 /// Creates a Features with the bits set which are known by the implementation
1526 #[must_use]
1527 #[no_mangle]
1528 pub extern "C" fn InvoiceFeatures_known() -> crate::lightning::ln::features::InvoiceFeatures {
1529         let mut ret = lightning::ln::features::InvoiceFeatures::known();
1530         crate::lightning::ln::features::InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1531 }
1532
1533 /// Returns true if this `Features` object contains unknown feature flags which are set as
1534 /// \"required\".
1535 #[must_use]
1536 #[no_mangle]
1537 pub extern "C" fn InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::InvoiceFeatures) -> bool {
1538         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1539         ret
1540 }
1541
1542 /// Create a blank Features with no features set
1543 #[must_use]
1544 #[no_mangle]
1545 pub extern "C" fn ChannelTypeFeatures_empty() -> crate::lightning::ln::features::ChannelTypeFeatures {
1546         let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
1547         crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1548 }
1549
1550 /// Creates a Features with the bits set which are known by the implementation
1551 #[must_use]
1552 #[no_mangle]
1553 pub extern "C" fn ChannelTypeFeatures_known() -> crate::lightning::ln::features::ChannelTypeFeatures {
1554         let mut ret = lightning::ln::features::ChannelTypeFeatures::known();
1555         crate::lightning::ln::features::ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
1556 }
1557
1558 /// Returns true if this `Features` object contains unknown feature flags which are set as
1559 /// \"required\".
1560 #[must_use]
1561 #[no_mangle]
1562 pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
1563         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
1564         ret
1565 }
1566
1567 #[no_mangle]
1568 /// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
1569 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
1570         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1571 }
1572 #[no_mangle]
1573 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1574         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
1575 }
1576 #[no_mangle]
1577 /// Read a InitFeatures from a byte array, created by InitFeatures_write
1578 pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
1579         let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1580         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 { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
1581         local_res
1582 }
1583 #[no_mangle]
1584 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
1585 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
1586         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1587 }
1588 #[no_mangle]
1589 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1590         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
1591 }
1592 #[no_mangle]
1593 /// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
1594 pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
1595         let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1596         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 { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
1597         local_res
1598 }
1599 #[no_mangle]
1600 /// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
1601 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
1602         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1603 }
1604 #[no_mangle]
1605 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1606         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
1607 }
1608 #[no_mangle]
1609 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
1610 pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
1611         let res: Result<lightning::ln::features::NodeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1612         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 { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
1613         local_res
1614 }
1615 #[no_mangle]
1616 /// Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
1617 pub extern "C" fn InvoiceFeatures_write(obj: &crate::lightning::ln::features::InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
1618         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1619 }
1620 #[no_mangle]
1621 pub(crate) extern "C" fn InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1622         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceFeatures) })
1623 }
1624 #[no_mangle]
1625 /// Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
1626 pub extern "C" fn InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InvoiceFeaturesDecodeErrorZ {
1627         let res: Result<lightning::ln::features::InvoiceFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1628         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 { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
1629         local_res
1630 }
1631 #[no_mangle]
1632 /// Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
1633 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
1634         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
1635 }
1636 #[no_mangle]
1637 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
1638         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
1639 }
1640 #[no_mangle]
1641 /// Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
1642 pub extern "C" fn ChannelTypeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTypeFeaturesDecodeErrorZ {
1643         let res: Result<lightning::ln::features::ChannelTypeFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
1644         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 { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
1645         local_res
1646 }