X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Fln%2Fpeer_handler.rs;h=e9894dd9b72990107162efb5f6c04d02b1c23bdd;hb=954e66ed08dd1e6f92974938244c9442b03bfe60;hp=d901385eb4a4db39fd4d963e11e9122b0ab2ffc4;hpb=879e309c128e2e2980846bfbb9a80a4c2bf8cbb4;p=rust-lightning diff --git a/lightning-c-bindings/src/ln/peer_handler.rs b/lightning-c-bindings/src/ln/peer_handler.rs index d901385e..e9894dd9 100644 --- a/lightning-c-bindings/src/ln/peer_handler.rs +++ b/lightning-c-bindings/src/ln/peer_handler.rs @@ -218,24 +218,6 @@ impl PeerHandleError { ret } } -impl Clone for PeerHandleError { - fn clone(&self) -> Self { - Self { - inner: if self.inner.is_null() { std::ptr::null_mut() } else { - Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) }, - is_owned: true, - } - } -} -#[allow(unused)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn PeerHandleError_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePeerHandleError)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn PeerHandleError_clone(orig: &PeerHandleError) -> PeerHandleError { - orig.clone() -} /// Used to indicate that we probably can't make any future connections to this peer, implying /// we should go ahead and force-close any channels we have with it. #[no_mangle] @@ -256,6 +238,24 @@ pub extern "C" fn PeerHandleError_new(mut no_connection_possible_arg: bool) -> P no_connection_possible: no_connection_possible_arg, })), is_owned: true } } +impl Clone for PeerHandleError { + fn clone(&self) -> Self { + Self { + inner: if self.inner.is_null() { std::ptr::null_mut() } else { + Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) }, + is_owned: true, + } + } +} +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn PeerHandleError_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePeerHandleError)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn PeerHandleError_clone(orig: &PeerHandleError) -> PeerHandleError { + orig.clone() +} use lightning::ln::peer_handler::PeerManager as nativePeerManagerImport; type nativePeerManager = nativePeerManagerImport;