X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning_background_processor.rs;h=c35788f72b72c1fdec5f0a4ac631812409ec877f;hp=c3c7ee3545abdca12332587d427771ecf1e346e8;hb=5271372bfe3ddc870c806f7b7ee13c4a7660e7e5;hpb=64b43a0fb5351d990192119e27c1c3f248a30d85 diff --git a/lightning-c-bindings/src/lightning_background_processor.rs b/lightning-c-bindings/src/lightning_background_processor.rs index c3c7ee3..c35788f 100644 --- a/lightning-c-bindings/src/lightning_background_processor.rs +++ b/lightning-c-bindings/src/lightning_background_processor.rs @@ -18,7 +18,7 @@ use crate::c_types::*; use lightning_background_processor::BackgroundProcessor as nativeBackgroundProcessorImport; -type nativeBackgroundProcessor = nativeBackgroundProcessorImport; +pub(crate) type nativeBackgroundProcessor = nativeBackgroundProcessorImport; /// `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep /// Rust-Lightning running properly, and (2) either can or should be run in the background. Its @@ -70,7 +70,7 @@ impl Drop for BackgroundProcessor { pub extern "C" fn BackgroundProcessor_free(this_obj: BackgroundProcessor) { } #[allow(unused)] /// Used only if an object of this type is returned as a trait impl by a method -extern "C" fn BackgroundProcessor_free_void(this_ptr: *mut c_void) { +pub(crate) extern "C" fn BackgroundProcessor_free_void(this_ptr: *mut c_void) { unsafe { let _ = Box::from_raw(this_ptr as *mut nativeBackgroundProcessor); } } #[allow(unused)] @@ -121,7 +121,7 @@ pub(crate) extern "C" fn ChannelManagerPersister_clone_fields(orig: &ChannelMana use lightning_background_processor::ChannelManagerPersister as rustChannelManagerPersister; impl rustChannelManagerPersister for ChannelManagerPersister { fn persist_manager(&self, mut channel_manager: &lightning::ln::channelmanager::ChannelManager) -> Result<(), std::io::Error> { - let mut ret = (self.persist_manager)(self.this_arg, &crate::lightning::ln::channelmanager::ChannelManager { inner: unsafe { ObjOps::nonnull_ptr_to_inner((channel_manager as *const _) as *mut _) }, is_owned: false }); + let mut ret = (self.persist_manager)(self.this_arg, &crate::lightning::ln::channelmanager::ChannelManager { inner: unsafe { ObjOps::nonnull_ptr_to_inner((channel_manager as *const lightning::ln::channelmanager::ChannelManager<_, _, _, _, _, _, >) as *mut _) }, is_owned: false }); let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) })*/ }), false => Err( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).to_rust() })}; local_ret }