+/// An error that may occur when sending a payment probe.
+#[derive(Clone)]
+#[must_use]
+#[repr(C)]
+pub enum ProbingError {
+ /// An error resulting from the provided [`Bolt11Invoice`].
+ Invoice(
+ crate::c_types::Str),
+ /// An error occurring when sending a payment probe.
+ Sending(
+ crate::lightning::ln::outbound_payment::ProbeSendFailure),
+}
+use lightning_invoice::payment::ProbingError as ProbingErrorImport;
+pub(crate) type nativeProbingError = ProbingErrorImport;
+
+impl ProbingError {
+ #[allow(unused)]
+ pub(crate) fn to_native(&self) -> nativeProbingError {
+ match self {
+ ProbingError::Invoice (ref a, ) => {
+ let mut a_nonref = Clone::clone(a);
+ nativeProbingError::Invoice (
+ a_nonref.into_str(),
+ )
+ },
+ ProbingError::Sending (ref a, ) => {
+ let mut a_nonref = Clone::clone(a);
+ nativeProbingError::Sending (
+ a_nonref.into_native(),
+ )
+ },
+ }
+ }
+ #[allow(unused)]
+ pub(crate) fn into_native(self) -> nativeProbingError {
+ match self {
+ ProbingError::Invoice (mut a, ) => {
+ nativeProbingError::Invoice (
+ a.into_str(),
+ )
+ },
+ ProbingError::Sending (mut a, ) => {
+ nativeProbingError::Sending (
+ a.into_native(),
+ )
+ },
+ }
+ }
+ #[allow(unused)]
+ pub(crate) fn from_native(native: &nativeProbingError) -> Self {
+ match native {
+ nativeProbingError::Invoice (ref a, ) => {
+ let mut a_nonref = Clone::clone(a);
+ ProbingError::Invoice (
+ a_nonref.into(),
+ )
+ },
+ nativeProbingError::Sending (ref a, ) => {
+ let mut a_nonref = Clone::clone(a);
+ ProbingError::Sending (
+ crate::lightning::ln::outbound_payment::ProbeSendFailure::native_into(a_nonref),
+ )
+ },
+ }
+ }
+ #[allow(unused)]
+ pub(crate) fn native_into(native: nativeProbingError) -> Self {
+ match native {
+ nativeProbingError::Invoice (mut a, ) => {
+ ProbingError::Invoice (
+ a.into(),
+ )
+ },
+ nativeProbingError::Sending (mut a, ) => {
+ ProbingError::Sending (
+ crate::lightning::ln::outbound_payment::ProbeSendFailure::native_into(a),
+ )
+ },
+ }
+ }
+}
+/// Frees any resources used by the ProbingError
+#[no_mangle]
+pub extern "C" fn ProbingError_free(this_ptr: ProbingError) { }
+/// Creates a copy of the ProbingError
+#[no_mangle]
+pub extern "C" fn ProbingError_clone(orig: &ProbingError) -> ProbingError {
+ orig.clone()
+}
+#[no_mangle]
+/// Utility method to constructs a new Invoice-variant ProbingError
+pub extern "C" fn ProbingError_invoice(a: crate::c_types::Str) -> ProbingError {
+ ProbingError::Invoice(a, )
+}
+#[no_mangle]
+/// Utility method to constructs a new Sending-variant ProbingError
+pub extern "C" fn ProbingError_sending(a: crate::lightning::ln::outbound_payment::ProbeSendFailure) -> ProbingError {
+ ProbingError::Sending(a, )
+}
+/// Checks if two ProbingErrors contain equal inner contents.
+/// This ignores pointers and is_owned flags and looks at the values in fields.
+#[no_mangle]
+pub extern "C" fn ProbingError_eq(a: &ProbingError, b: &ProbingError) -> bool {
+ if &a.to_native() == &b.to_native() { true } else { false }
+}