+/// 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.
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+#[must_use]
+#[no_mangle]
+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 {
+ let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_required_custom_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 custom feature bit. Errors if `bit` is outside the custom range as defined
+/// by [bLIP 2] or if it is a known `T` feature.
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+#[must_use]
+#[no_mangle]
+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 {
+ let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeNodeFeatures)) }.set_optional_custom_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
+}
+
+/// Create a blank Features with no features set
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelFeatures_empty() -> crate::lightning::ln::features::ChannelFeatures {
+ let mut ret = lightning::ln::features::ChannelFeatures::empty();
+ crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
+}
+
+/// Returns true if this `Features` object contains required features unknown by `other`.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::ChannelFeatures, other: &crate::lightning::ln::features::ChannelFeatures) -> bool {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
+ ret
+}
+
+/// Returns true if this `Features` object contains unknown feature flags which are set as
+/// \"required\".
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::ChannelFeatures) -> bool {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
+ 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.
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+#[must_use]
+#[no_mangle]
+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 {
+ let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_required_custom_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 custom feature bit. Errors if `bit` is outside the custom range as defined
+/// by [bLIP 2] or if it is a known `T` feature.
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+#[must_use]
+#[no_mangle]
+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 {
+ let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeChannelFeatures)) }.set_optional_custom_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
+}
+
+/// Create a blank Features with no features set
+#[must_use]
+#[no_mangle]
+pub extern "C" fn Bolt11InvoiceFeatures_empty() -> crate::lightning::ln::features::Bolt11InvoiceFeatures {
+ let mut ret = lightning::ln::features::Bolt11InvoiceFeatures::empty();
+ crate::lightning::ln::features::Bolt11InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
+}
+
+/// Returns true if this `Features` object contains required features unknown by `other`.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures, other: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
+ ret
+}
+
+/// Returns true if this `Features` object contains unknown feature flags which are set as
+/// \"required\".
+#[must_use]
+#[no_mangle]
+pub extern "C" fn Bolt11InvoiceFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::Bolt11InvoiceFeatures) -> bool {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
+ 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.
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+#[must_use]
+#[no_mangle]
+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 {
+ let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_required_custom_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 custom feature bit. Errors if `bit` is outside the custom range as defined
+/// by [bLIP 2] or if it is a known `T` feature.
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+#[must_use]
+#[no_mangle]
+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 {
+ let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeBolt11InvoiceFeatures)) }.set_optional_custom_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
+}
+
+/// Create a blank Features with no features set
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferFeatures_empty() -> crate::lightning::ln::features::OfferFeatures {
+ let mut ret = lightning::ln::features::OfferFeatures::empty();
+ crate::lightning::ln::features::OfferFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
+}
+
+/// Returns true if this `Features` object contains required features unknown by `other`.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::OfferFeatures, other: &crate::lightning::ln::features::OfferFeatures) -> bool {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
+ ret
+}
+
+/// Returns true if this `Features` object contains unknown feature flags which are set as
+/// \"required\".
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferFeatures_requires_unknown_bits(this_arg: &crate::lightning::ln::features::OfferFeatures) -> bool {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
+ 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.
+///
+/// Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
+/// be set instead (i.e., `bit - 1`).
+///
+/// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+#[must_use]
+#[no_mangle]
+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 {
+ let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_required_custom_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 custom feature bit. Errors if `bit` is outside the custom range as defined
+/// by [bLIP 2] or if it is a known `T` feature.
+///
+/// Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
+/// set instead (i.e., `bit + 1`).
+///
+/// [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
+#[must_use]
+#[no_mangle]
+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 {
+ let mut ret = unsafe { &mut (*ObjOps::untweak_ptr(this_arg.inner as *mut crate::lightning::ln::features::nativeOfferFeatures)) }.set_optional_custom_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
+}
+
+/// Create a blank Features with no features set
+#[must_use]
+#[no_mangle]
+pub extern "C" fn InvoiceRequestFeatures_empty() -> crate::lightning::ln::features::InvoiceRequestFeatures {
+ let mut ret = lightning::ln::features::InvoiceRequestFeatures::empty();
+ crate::lightning::ln::features::InvoiceRequestFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
+}
+
+/// Returns true if this `Features` object contains required features unknown by `other`.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn InvoiceRequestFeatures_requires_unknown_bits_from(this_arg: &crate::lightning::ln::features::InvoiceRequestFeatures, other: &crate::lightning::ln::features::InvoiceRequestFeatures) -> bool {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits_from(other.get_native_ref());
+ ret
+}
+
+/// Returns true if this `Features` object contains unknown feature flags which are set as
+/// \"required\".