-impl InvoiceFeatures {
- pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceFeatures {
- unsafe { &*ObjOps::untweak_ptr(self.inner) }
- }
- pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceFeatures {
- unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
- }
- /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
- pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceFeatures {
- assert!(self.is_owned);
- let ret = ObjOps::untweak_ptr(self.inner);
- self.inner = std::ptr::null_mut();
- ret
- }
-}
-/// Create a blank Features with no features set
-#[must_use]
-#[no_mangle]
-pub extern "C" fn InitFeatures_empty() -> InitFeatures {
- let mut ret = lightning::ln::features::InitFeatures::empty();
- InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
-}
-
-/// Creates a Features with the bits set which are known by the implementation
-#[must_use]
-#[no_mangle]
-pub extern "C" fn InitFeatures_known() -> InitFeatures {
- let mut ret = lightning::ln::features::InitFeatures::known();
- InitFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
-}
-
-/// Returns true if this `Features` object contains unknown feature flags which are set as
-/// \"required\".
-#[must_use]
-#[no_mangle]
-pub extern "C" fn InitFeatures_requires_unknown_bits(this_arg: &InitFeatures) -> bool {
- let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
- ret
-}
-
-/// Create a blank Features with no features set
-#[must_use]
-#[no_mangle]
-pub extern "C" fn NodeFeatures_empty() -> NodeFeatures {
- let mut ret = lightning::ln::features::NodeFeatures::empty();
- NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
-}
-
-/// Creates a Features with the bits set which are known by the implementation
-#[must_use]
-#[no_mangle]
-pub extern "C" fn NodeFeatures_known() -> NodeFeatures {
- let mut ret = lightning::ln::features::NodeFeatures::known();
- NodeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
-}
-
-/// Returns true if this `Features` object contains unknown feature flags which are set as
-/// \"required\".
-#[must_use]
-#[no_mangle]
-pub extern "C" fn NodeFeatures_requires_unknown_bits(this_arg: &NodeFeatures) -> bool {
- let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
- ret
-}
-
-/// Create a blank Features with no features set
-#[must_use]
-#[no_mangle]
-pub extern "C" fn ChannelFeatures_empty() -> ChannelFeatures {
- let mut ret = lightning::ln::features::ChannelFeatures::empty();
- ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
-}
-
-/// Creates a Features with the bits set which are known by the implementation
-#[must_use]
-#[no_mangle]
-pub extern "C" fn ChannelFeatures_known() -> ChannelFeatures {
- let mut ret = lightning::ln::features::ChannelFeatures::known();
- ChannelFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
-}
-
-/// 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: &ChannelFeatures) -> bool {
- let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
- ret
-}
-
-/// Create a blank Features with no features set
-#[must_use]
-#[no_mangle]
-pub extern "C" fn InvoiceFeatures_empty() -> InvoiceFeatures {
- let mut ret = lightning::ln::features::InvoiceFeatures::empty();
- InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
-}
-
-/// Creates a Features with the bits set which are known by the implementation
-#[must_use]
-#[no_mangle]
-pub extern "C" fn InvoiceFeatures_known() -> InvoiceFeatures {
- let mut ret = lightning::ln::features::InvoiceFeatures::known();
- InvoiceFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
-}
-
-/// Returns true if this `Features` object contains unknown feature flags which are set as
-/// \"required\".
-#[must_use]
-#[no_mangle]
-pub extern "C" fn InvoiceFeatures_requires_unknown_bits(this_arg: &InvoiceFeatures) -> bool {
- let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
- ret
-}
-
-/// Returns whether the `payment_secret` feature is supported.
-#[must_use]
-#[no_mangle]
-pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &InitFeatures) -> bool {
- let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
- ret
-}
-
-/// Returns whether the `payment_secret` feature is supported.
-#[must_use]
-#[no_mangle]
-pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &NodeFeatures) -> bool {
- let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
- ret