X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning_invoice%2Fpayment.rs;fp=lightning-c-bindings%2Fsrc%2Flightning_invoice%2Fpayment.rs;h=593a68324c1cfd3d8881cfeafa3a9dd2bddf71cd;hp=e94f0da5618268f63b44b97415decce36a46e42f;hb=5502fccd64611f16f5ebba3759c68b1a4d69b537;hpb=1ec49fac7433e5b8693c3858a3e25998bc888eeb diff --git a/lightning-c-bindings/src/lightning_invoice/payment.rs b/lightning-c-bindings/src/lightning_invoice/payment.rs index e94f0da..593a683 100644 --- a/lightning-c-bindings/src/lightning_invoice/payment.rs +++ b/lightning-c-bindings/src/lightning_invoice/payment.rs @@ -194,6 +194,16 @@ pub extern "C" fn PaymentError_free(this_ptr: PaymentError) { } pub extern "C" fn PaymentError_clone(orig: &PaymentError) -> PaymentError { orig.clone() } +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn PaymentError_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *const PaymentError)).clone() })) as *mut c_void +} +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn PaymentError_free_void(this_ptr: *mut c_void) { + let _ = unsafe { Box::from_raw(this_ptr as *mut PaymentError) }; +} #[no_mangle] /// Utility method to constructs a new Invoice-variant PaymentError pub extern "C" fn PaymentError_invoice(a: crate::c_types::Str) -> PaymentError { @@ -299,6 +309,16 @@ pub extern "C" fn ProbingError_free(this_ptr: ProbingError) { } pub extern "C" fn ProbingError_clone(orig: &ProbingError) -> ProbingError { orig.clone() } +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ProbingError_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *const ProbingError)).clone() })) as *mut c_void +} +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ProbingError_free_void(this_ptr: *mut c_void) { + let _ = unsafe { Box::from_raw(this_ptr as *mut ProbingError) }; +} #[no_mangle] /// Utility method to constructs a new Invoice-variant ProbingError pub extern "C" fn ProbingError_invoice(a: crate::c_types::Str) -> ProbingError {