+pub enum PaymentSendFailure {
+ /// A parameter which was passed to send_payment was invalid, preventing us from attempting to
+ /// send the payment at all. No channel state has been changed or messages sent to peers, and
+ /// once you've changed the parameter at error, you can freely retry the payment in full.
+ ParameterError(crate::util::errors::APIError),
+ /// A parameter in a single path which was passed to send_payment was invalid, preventing us
+ /// from attempting to send the payment at all. No channel state has been changed or messages
+ /// sent to peers, and once you've changed the parameter at error, you can freely retry the
+ /// payment in full.
+ ///
+ /// The results here are ordered the same as the paths in the route object which was passed to
+ /// send_payment.
+ PathParameterError(crate::c_types::derived::CVec_CResult_NoneAPIErrorZZ),
+ /// All paths which were attempted failed to send, with no channel state change taking place.
+ /// You can freely retry the payment in full (though you probably want to do so over different
+ /// paths than the ones selected).
+ AllFailedRetrySafe(crate::c_types::derived::CVec_APIErrorZ),
+ /// Some paths which were attempted failed to send, though possibly not all. At least some
+ /// paths have irrevocably committed to the HTLC and retrying the payment in full would result
+ /// in over-/re-payment.
+ ///
+ /// The results here are ordered the same as the paths in the route object which was passed to
+ /// send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
+ /// retried (though there is currently no API with which to do so).
+ ///
+ /// Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
+ /// as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
+ /// case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
+ /// with the latest update_id.
+ PartialFailure(crate::c_types::derived::CVec_CResult_NoneAPIErrorZZ),
+}
+use lightning::ln::channelmanager::PaymentSendFailure as nativePaymentSendFailure;
+impl PaymentSendFailure {
+ #[allow(unused)]
+ pub(crate) fn to_native(&self) -> nativePaymentSendFailure {
+ match self {
+ PaymentSendFailure::ParameterError (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ nativePaymentSendFailure::ParameterError (
+ a_nonref.into_native(),
+ )
+ },
+ PaymentSendFailure::PathParameterError (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ let mut local_a_nonref = Vec::new(); for mut item in a_nonref.into_rust().drain(..) { local_a_nonref.push( { let mut local_a_nonref_0 = match item.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.result)) })*/ }), false => Err( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.err)) }).into_native() })}; local_a_nonref_0 }); };
+ nativePaymentSendFailure::PathParameterError (
+ local_a_nonref,
+ )
+ },
+ PaymentSendFailure::AllFailedRetrySafe (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ let mut local_a_nonref = Vec::new(); for mut item in a_nonref.into_rust().drain(..) { local_a_nonref.push( { item.into_native() }); };
+ nativePaymentSendFailure::AllFailedRetrySafe (
+ local_a_nonref,
+ )
+ },
+ PaymentSendFailure::PartialFailure (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ let mut local_a_nonref = Vec::new(); for mut item in a_nonref.into_rust().drain(..) { local_a_nonref.push( { let mut local_a_nonref_0 = match item.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.result)) })*/ }), false => Err( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.err)) }).into_native() })}; local_a_nonref_0 }); };
+ nativePaymentSendFailure::PartialFailure (
+ local_a_nonref,
+ )
+ },