Update auto-generated bindings to LDK 0.0.118
[ldk-c-bindings] / lightning-c-bindings / src / lightning / ln / features.rs
index cb7453b190e563a487029fbf892870145d8b4a58..ff4e66daf2299d8e0266260b781891c0b3fa177e 100644 (file)
@@ -73,6 +73,7 @@
 //! [messages]: crate::ln::msgs
 
 use alloc::str::FromStr;
+use alloc::string::String;
 use core::ffi::c_void;
 use core::convert::Infallible;
 use bitcoin::hashes::Hash;
@@ -83,6 +84,7 @@ use alloc::{vec::Vec, boxed::Box};
 mod sealed {
 
 use alloc::str::FromStr;
+use alloc::string::String;
 use core::ffi::c_void;
 use core::convert::Infallible;
 use bitcoin::hashes::Hash;
@@ -922,6 +924,90 @@ pub extern "C" fn NodeFeatures_requires_shutdown_anysegwit(this_arg: &crate::lig
        ret
 }
 
+/// Set this feature as optional.
+#[no_mangle]
+pub extern "C" fn InitFeatures_set_taproot_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
+       unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_taproot_optional()
+}
+
+/// Set this feature as required.
+#[no_mangle]
+pub extern "C" fn InitFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
+       unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_taproot_required()
+}
+
+/// Checks if this feature is supported.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn InitFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
+       ret
+}
+
+/// Set this feature as optional.
+#[no_mangle]
+pub extern "C" fn NodeFeatures_set_taproot_optional(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
+       unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_taproot_optional()
+}
+
+/// Set this feature as required.
+#[no_mangle]
+pub extern "C" fn NodeFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::NodeFeatures) {
+       unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_taproot_required()
+}
+
+/// Checks if this feature is supported.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn NodeFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
+       ret
+}
+
+/// Set this feature as optional.
+#[no_mangle]
+pub extern "C" fn ChannelTypeFeatures_set_taproot_optional(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
+       unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_taproot_optional()
+}
+
+/// Set this feature as required.
+#[no_mangle]
+pub extern "C" fn ChannelTypeFeatures_set_taproot_required(this_arg: &mut crate::lightning::ln::features::ChannelTypeFeatures) {
+       unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_taproot_required()
+}
+
+/// Checks if this feature is supported.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelTypeFeatures_supports_taproot(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_taproot();
+       ret
+}
+
+/// Checks if this feature is required.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn InitFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::InitFeatures) -> bool {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
+       ret
+}
+
+/// Checks if this feature is required.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn NodeFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::NodeFeatures) -> bool {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
+       ret
+}
+
+/// Checks if this feature is required.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelTypeFeatures_requires_taproot(this_arg: &crate::lightning::ln::features::ChannelTypeFeatures) -> bool {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_taproot();
+       ret
+}
+
 /// Set this feature as optional.
 #[no_mangle]
 pub extern "C" fn InitFeatures_set_onion_messages_optional(this_arg: &mut crate::lightning::ln::features::InitFeatures) {
@@ -1352,7 +1438,7 @@ impl Clone for InitFeatures {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeInitFeatures)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the InitFeatures
@@ -1371,7 +1457,7 @@ impl Clone for NodeFeatures {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeNodeFeatures)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the NodeFeatures
@@ -1390,7 +1476,7 @@ impl Clone for ChannelFeatures {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeChannelFeatures)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the ChannelFeatures
@@ -1409,7 +1495,7 @@ impl Clone for Bolt11InvoiceFeatures {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Bolt11InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt11InvoiceFeatures)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt11InvoiceFeatures)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the Bolt11InvoiceFeatures
@@ -1428,7 +1514,7 @@ impl Clone for OfferFeatures {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn OfferFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOfferFeatures)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeOfferFeatures)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the OfferFeatures
@@ -1447,7 +1533,7 @@ impl Clone for InvoiceRequestFeatures {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn InvoiceRequestFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeInvoiceRequestFeatures)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the InvoiceRequestFeatures
@@ -1466,7 +1552,7 @@ impl Clone for Bolt12InvoiceFeatures {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Bolt12InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt12InvoiceFeatures)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt12InvoiceFeatures)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the Bolt12InvoiceFeatures
@@ -1485,7 +1571,7 @@ impl Clone for BlindedHopFeatures {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn BlindedHopFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBlindedHopFeatures)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBlindedHopFeatures)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the BlindedHopFeatures
@@ -1504,7 +1590,7 @@ impl Clone for ChannelTypeFeatures {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeChannelTypeFeatures)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the ChannelTypeFeatures
@@ -2004,6 +2090,36 @@ pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &crate::lightning
        ret
 }
 
+/// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_required_feature_bit(bit);
+       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() };
+       local_ret
+}
+
+/// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInitFeatures)) }.set_optional_feature_bit(bit);
+       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() };
+       local_ret
+}
+
 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
 /// by [bLIP 2] or if it is a known `T` feature.
 ///
@@ -2059,6 +2175,36 @@ pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &crate::lightning
        ret
 }
 
+/// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_required_feature_bit(bit);
+       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() };
+       local_ret
+}
+
+/// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_optional_feature_bit(bit);
+       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() };
+       local_ret
+}
+
 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
 /// by [bLIP 2] or if it is a known `T` feature.
 ///
@@ -2114,6 +2260,36 @@ pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightn
        ret
 }
 
+/// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_required_feature_bit(bit);
+       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() };
+       local_ret
+}
+
+/// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_optional_feature_bit(bit);
+       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() };
+       local_ret
+}
+
 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
 /// by [bLIP 2] or if it is a known `T` feature.
 ///
@@ -2169,6 +2345,36 @@ pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits(this_arg: &crate::
        ret
 }
 
+/// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_required_feature_bit(bit);
+       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() };
+       local_ret
+}
+
+/// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_optional_feature_bit(bit);
+       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() };
+       local_ret
+}
+
 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
 /// by [bLIP 2] or if it is a known `T` feature.
 ///
@@ -2224,6 +2430,36 @@ pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightnin
        ret
 }
 
+/// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_required_feature_bit(bit);
+       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() };
+       local_ret
+}
+
+/// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_optional_feature_bit(bit);
+       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() };
+       local_ret
+}
+
 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
 /// by [bLIP 2] or if it is a known `T` feature.
 ///
@@ -2279,6 +2515,36 @@ pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits(this_arg: &crate:
        ret
 }
 
+/// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_required_feature_bit(bit);
+       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() };
+       local_ret
+}
+
+/// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeInvoiceRequestFeatures)) }.set_optional_feature_bit(bit);
+       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() };
+       local_ret
+}
+
 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
 /// by [bLIP 2] or if it is a known `T` feature.
 ///
@@ -2334,6 +2600,36 @@ pub extern "C" fn Bolt12InvoiceFeatures_requires_unknown_bits(this_arg: &crate::
        ret
 }
 
+/// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_required_feature_bit(bit);
+       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() };
+       local_ret
+}
+
+/// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt12InvoiceFeatures)) }.set_optional_feature_bit(bit);
+       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() };
+       local_ret
+}
+
 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
 /// by [bLIP 2] or if it is a known `T` feature.
 ///
@@ -2389,6 +2685,36 @@ pub extern "C" fn BlindedHopFeatures_requires_unknown_bits(this_arg: &crate::lig
        ret
 }
 
+/// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_required_feature_bit(bit);
+       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() };
+       local_ret
+}
+
+/// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBlindedHopFeatures)) }.set_optional_feature_bit(bit);
+       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() };
+       local_ret
+}
+
 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
 /// by [bLIP 2] or if it is a known `T` feature.
 ///
@@ -2444,6 +2770,36 @@ pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &crate::li
        ret
 }
 
+/// Sets a required feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_required_feature_bit(bit);
+       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() };
+       local_ret
+}
+
+/// Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
+/// by [BOLT 9].
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
+#[must_use]
+#[no_mangle]
+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 {
+       let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelTypeFeatures)) }.set_optional_feature_bit(bit);
+       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() };
+       local_ret
+}
+
 /// Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
 /// by [bLIP 2] or if it is a known `T` feature.
 ///
@@ -2479,7 +2835,7 @@ pub extern "C" fn ChannelTypeFeatures_set_optional_custom_bit(this_arg: &mut cra
 pub extern "C" fn InitFeatures_write(obj: &crate::lightning::ln::features::InitFeatures) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
 }
-#[no_mangle]
+#[allow(unused)]
 pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
 }
@@ -2495,7 +2851,7 @@ pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_ty
 pub extern "C" fn ChannelFeatures_write(obj: &crate::lightning::ln::features::ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
 }
-#[no_mangle]
+#[allow(unused)]
 pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
 }
@@ -2511,7 +2867,7 @@ pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c
 pub extern "C" fn NodeFeatures_write(obj: &crate::lightning::ln::features::NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
 }
-#[no_mangle]
+#[allow(unused)]
 pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
 }
@@ -2527,7 +2883,7 @@ pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_ty
 pub extern "C" fn Bolt11InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
 }
-#[no_mangle]
+#[allow(unused)]
 pub(crate) extern "C" fn Bolt11InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt11InvoiceFeatures) })
 }
@@ -2543,7 +2899,7 @@ pub extern "C" fn Bolt11InvoiceFeatures_read(ser: crate::c_types::u8slice) -> cr
 pub extern "C" fn Bolt12InvoiceFeatures_write(obj: &crate::lightning::ln::features::Bolt12InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
 }
-#[no_mangle]
+#[allow(unused)]
 pub(crate) extern "C" fn Bolt12InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBolt12InvoiceFeatures) })
 }
@@ -2559,7 +2915,7 @@ pub extern "C" fn Bolt12InvoiceFeatures_read(ser: crate::c_types::u8slice) -> cr
 pub extern "C" fn BlindedHopFeatures_write(obj: &crate::lightning::ln::features::BlindedHopFeatures) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
 }
-#[no_mangle]
+#[allow(unused)]
 pub(crate) extern "C" fn BlindedHopFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBlindedHopFeatures) })
 }
@@ -2575,7 +2931,7 @@ pub extern "C" fn BlindedHopFeatures_read(ser: crate::c_types::u8slice) -> crate
 pub extern "C" fn ChannelTypeFeatures_write(obj: &crate::lightning::ln::features::ChannelTypeFeatures) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
 }
-#[no_mangle]
+#[allow(unused)]
 pub(crate) extern "C" fn ChannelTypeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTypeFeatures) })
 }