-/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
-impl InvoiceFeatures {
- pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceFeatures {
- assert!(self.is_owned);
- let ret = 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: Box::into_raw(Box::new(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: Box::into_raw(Box::new(ret)), is_owned: true }
-}
-
-/// 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: Box::into_raw(Box::new(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: Box::into_raw(Box::new(ret)), is_owned: true }
-}
-
-/// 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: Box::into_raw(Box::new(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: Box::into_raw(Box::new(ret)), is_owned: true }
-}
-
-/// 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: Box::into_raw(Box::new(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: Box::into_raw(Box::new(ret)), is_owned: true }
-}
-
-/// 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 { &*this_arg.inner }.supports_payment_secret();
- ret