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