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