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