+/// Checks if two PaymentSendFailures contain equal inner contents.
+/// This ignores pointers and is_owned flags and looks at the values in fields.
+#[no_mangle]
+pub extern "C" fn PaymentSendFailure_eq(a: &PaymentSendFailure, b: &PaymentSendFailure) -> bool {
+ if &a.to_native() == &b.to_native() { true } else { false }
+}
+/// Indicates that we failed to send a payment probe. Further errors may be surfaced later via
+/// [`Event::ProbeFailed`].
+///
+/// [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
+#[derive(Clone)]
+#[must_use]
+#[repr(C)]
+pub enum ProbeSendFailure {
+ /// We were unable to find a route to the destination.
+ RouteNotFound,
+ /// We failed to send the payment probes.
+ SendingFailed(
+ crate::lightning::ln::outbound_payment::PaymentSendFailure),
+}
+use lightning::ln::outbound_payment::ProbeSendFailure as ProbeSendFailureImport;
+pub(crate) type nativeProbeSendFailure = ProbeSendFailureImport;
+
+impl ProbeSendFailure {
+ #[allow(unused)]
+ pub(crate) fn to_native(&self) -> nativeProbeSendFailure {
+ match self {
+ ProbeSendFailure::RouteNotFound => nativeProbeSendFailure::RouteNotFound,
+ ProbeSendFailure::SendingFailed (ref a, ) => {
+ let mut a_nonref = Clone::clone(a);
+ nativeProbeSendFailure::SendingFailed (
+ a_nonref.into_native(),
+ )
+ },
+ }
+ }
+ #[allow(unused)]
+ pub(crate) fn into_native(self) -> nativeProbeSendFailure {
+ match self {
+ ProbeSendFailure::RouteNotFound => nativeProbeSendFailure::RouteNotFound,
+ ProbeSendFailure::SendingFailed (mut a, ) => {
+ nativeProbeSendFailure::SendingFailed (
+ a.into_native(),
+ )
+ },
+ }
+ }
+ #[allow(unused)]
+ pub(crate) fn from_native(native: &nativeProbeSendFailure) -> Self {
+ match native {
+ nativeProbeSendFailure::RouteNotFound => ProbeSendFailure::RouteNotFound,
+ nativeProbeSendFailure::SendingFailed (ref a, ) => {
+ let mut a_nonref = Clone::clone(a);
+ ProbeSendFailure::SendingFailed (
+ crate::lightning::ln::outbound_payment::PaymentSendFailure::native_into(a_nonref),
+ )
+ },
+ }
+ }
+ #[allow(unused)]
+ pub(crate) fn native_into(native: nativeProbeSendFailure) -> Self {
+ match native {
+ nativeProbeSendFailure::RouteNotFound => ProbeSendFailure::RouteNotFound,
+ nativeProbeSendFailure::SendingFailed (mut a, ) => {
+ ProbeSendFailure::SendingFailed (
+ crate::lightning::ln::outbound_payment::PaymentSendFailure::native_into(a),
+ )
+ },
+ }
+ }
+}
+/// Frees any resources used by the ProbeSendFailure
+#[no_mangle]
+pub extern "C" fn ProbeSendFailure_free(this_ptr: ProbeSendFailure) { }
+/// Creates a copy of the ProbeSendFailure
+#[no_mangle]
+pub extern "C" fn ProbeSendFailure_clone(orig: &ProbeSendFailure) -> ProbeSendFailure {
+ 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 ProbeSendFailure_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *const ProbeSendFailure)).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 ProbeSendFailure_free_void(this_ptr: *mut c_void) {
+ let _ = unsafe { Box::from_raw(this_ptr as *mut ProbeSendFailure) };
+}
+#[no_mangle]
+/// Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
+pub extern "C" fn ProbeSendFailure_route_not_found() -> ProbeSendFailure {
+ ProbeSendFailure::RouteNotFound}
+#[no_mangle]
+/// Utility method to constructs a new SendingFailed-variant ProbeSendFailure
+pub extern "C" fn ProbeSendFailure_sending_failed(a: crate::lightning::ln::outbound_payment::PaymentSendFailure) -> ProbeSendFailure {
+ ProbeSendFailure::SendingFailed(a, )
+}
+/// Checks if two ProbeSendFailures contain equal inner contents.
+/// This ignores pointers and is_owned flags and looks at the values in fields.
+#[no_mangle]
+pub extern "C" fn ProbeSendFailure_eq(a: &ProbeSendFailure, b: &ProbeSendFailure) -> bool {
+ if &a.to_native() == &b.to_native() { true } else { false }
+}