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