+/// If a payment fails to send, it can be in one of several states. This enum is returned as the
+/// Err() type describing which state the payment is in, see the description of individual enum
+/// states for more.
+#[derive(Debug)]
+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(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(Vec<Result<(), APIError>>),
+ /// 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(Vec<APIError>),
+ /// 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(Vec<Result<(), APIError>>),
+}
+