+impl From<nativeInMemorySigner> for crate::lightning::chain::keysinterface::EntropySource {
+ fn from(obj: nativeInMemorySigner) -> Self {
+ let mut rust_obj = InMemorySigner { inner: ObjOps::heap_alloc(obj), is_owned: true };
+ let mut ret = InMemorySigner_as_EntropySource(&rust_obj);
+ // We want to free rust_obj when ret gets drop()'d, not rust_obj, so wipe rust_obj's pointer and set ret's free() fn
+ rust_obj.inner = core::ptr::null_mut();
+ ret.free = Some(InMemorySigner_free_void);
+ ret
+ }
+}
+/// Constructs a new EntropySource which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
+#[no_mangle]
+pub extern "C" fn InMemorySigner_as_EntropySource(this_arg: &InMemorySigner) -> crate::lightning::chain::keysinterface::EntropySource {
+ crate::lightning::chain::keysinterface::EntropySource {
+ this_arg: unsafe { ObjOps::untweak_ptr((*this_arg).inner) as *mut c_void },
+ free: None,
+ get_secure_random_bytes: InMemorySigner_EntropySource_get_secure_random_bytes,
+ }
+}
+
+#[must_use]
+extern "C" fn InMemorySigner_EntropySource_get_secure_random_bytes(this_arg: *const c_void) -> crate::c_types::ThirtyTwoBytes {
+ let mut ret = <nativeInMemorySigner as lightning::chain::keysinterface::EntropySource<>>::get_secure_random_bytes(unsafe { &mut *(this_arg as *mut nativeInMemorySigner) }, );
+ crate::c_types::ThirtyTwoBytes { data: ret }
+}
+