+use lightning::ln::features::OfferFeatures as nativeOfferFeaturesImport;
+pub(crate) type nativeOfferFeatures = nativeOfferFeaturesImport;
+
+/// Features used within an `offer`.
+#[must_use]
+#[repr(C)]
+pub struct OfferFeatures {
+ /// A pointer to the opaque Rust object.
+
+ /// Nearly everywhere, inner must be non-null, however in places where
+ /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+ pub inner: *mut nativeOfferFeatures,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
+ pub is_owned: bool,
+}
+
+impl Drop for OfferFeatures {
+ fn drop(&mut self) {
+ if self.is_owned && !<*mut nativeOfferFeatures>::is_null(self.inner) {
+ let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
+ }
+ }
+}
+/// Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
+#[no_mangle]
+pub extern "C" fn OfferFeatures_free(this_obj: 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_free_void(this_ptr: *mut c_void) {
+ let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferFeatures) };
+}
+#[allow(unused)]
+impl OfferFeatures {
+ pub(crate) fn get_native_ref(&self) -> &'static nativeOfferFeatures {
+ unsafe { &*ObjOps::untweak_ptr(self.inner) }
+ }
+ pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferFeatures {
+ 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 nativeOfferFeatures {
+ assert!(self.is_owned);
+ let ret = ObjOps::untweak_ptr(self.inner);
+ self.inner = core::ptr::null_mut();
+ ret
+ }
+}
+
+use lightning::ln::features::InvoiceRequestFeatures as nativeInvoiceRequestFeaturesImport;
+pub(crate) type nativeInvoiceRequestFeatures = nativeInvoiceRequestFeaturesImport;
+
+/// Features used within an `invoice_request`.
+#[must_use]
+#[repr(C)]
+pub struct InvoiceRequestFeatures {
+ /// A pointer to the opaque Rust object.
+
+ /// Nearly everywhere, inner must be non-null, however in places where
+ /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+ pub inner: *mut nativeInvoiceRequestFeatures,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
+ pub is_owned: bool,
+}
+
+impl Drop for InvoiceRequestFeatures {
+ fn drop(&mut self) {
+ if self.is_owned && !<*mut nativeInvoiceRequestFeatures>::is_null(self.inner) {
+ let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
+ }
+ }
+}
+/// Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
+#[no_mangle]
+pub extern "C" fn InvoiceRequestFeatures_free(this_obj: 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_free_void(this_ptr: *mut c_void) {
+ let _ = unsafe { Box::from_raw(this_ptr as *mut nativeInvoiceRequestFeatures) };
+}
+#[allow(unused)]
+impl InvoiceRequestFeatures {
+ pub(crate) fn get_native_ref(&self) -> &'static nativeInvoiceRequestFeatures {
+ unsafe { &*ObjOps::untweak_ptr(self.inner) }
+ }
+ pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeInvoiceRequestFeatures {
+ 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 nativeInvoiceRequestFeatures {
+ assert!(self.is_owned);
+ let ret = ObjOps::untweak_ptr(self.inner);
+ self.inner = core::ptr::null_mut();
+ ret
+ }
+}
+