X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning%2Foffers%2Finvoice_error.rs;h=11b392d7f457e042118f3f815bf9587b49c7a81a;hb=636543d86915837013c3eb1e0a9ea96114ef73fc;hp=acf381e192adbda1fc432da668d48129a6e2dd62;hpb=fd396cecbaf30cd771a268d2dcd4e9afa85e18e1;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/lightning/offers/invoice_error.rs b/lightning-c-bindings/src/lightning/offers/invoice_error.rs index acf381e..11b392d 100644 --- a/lightning-c-bindings/src/lightning/offers/invoice_error.rs +++ b/lightning-c-bindings/src/lightning/offers/invoice_error.rs @@ -136,6 +136,9 @@ pub(crate) extern "C" fn InvoiceError_clone_void(this_ptr: *const c_void) -> *mu pub extern "C" fn InvoiceError_clone(orig: &InvoiceError) -> InvoiceError { orig.clone() } +/// Get a string which allows debug introspection of a InvoiceError object +pub extern "C" fn InvoiceError_debug_str_void(o: *const c_void) -> Str { + alloc::format!("{:?}", unsafe { o as *const crate::lightning::offers::invoice_error::InvoiceError }).into()} use lightning::offers::invoice_error::ErroneousField as nativeErroneousFieldImport; pub(crate) type nativeErroneousField = nativeErroneousFieldImport; @@ -245,6 +248,9 @@ pub(crate) extern "C" fn ErroneousField_clone_void(this_ptr: *const c_void) -> * pub extern "C" fn ErroneousField_clone(orig: &ErroneousField) -> ErroneousField { orig.clone() } +/// Get a string which allows debug introspection of a ErroneousField object +pub extern "C" fn ErroneousField_debug_str_void(o: *const c_void) -> Str { + alloc::format!("{:?}", unsafe { o as *const crate::lightning::offers::invoice_error::ErroneousField }).into()} /// Creates an [`InvoiceError`] with the given message. #[must_use] #[no_mangle] @@ -253,6 +259,11 @@ pub extern "C" fn InvoiceError_from_string(mut s: crate::c_types::Str) -> crate: crate::lightning::offers::invoice_error::InvoiceError { inner: ObjOps::heap_alloc(ret), is_owned: true } } +#[no_mangle] +/// Get the string representation of a InvoiceError object +pub extern "C" fn InvoiceError_to_str(o: &crate::lightning::offers::invoice_error::InvoiceError) -> Str { + alloc::format!("{}", o.get_native_ref()).into() +} #[no_mangle] /// Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read pub extern "C" fn InvoiceError_write(obj: &crate::lightning::offers::invoice_error::InvoiceError) -> crate::c_types::derived::CVec_u8Z {