pub enum PaymentSendFailure {
    ParameterError(APIError),
    PathParameterError(Vec<Result<(), APIError>>),
    AllFailedRetrySafe(Vec<APIError>),
    PartialFailure {
        results: Vec<Result<(), APIError>>,
        failed_paths_retry: Option<RouteParameters>,
        payment_id: PaymentId,
    },
}
Expand description

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.

Variants

ParameterError(APIError)

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.

PathParameterError(Vec<Result<(), 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.

AllFailedRetrySafe(Vec<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).

PartialFailure

Fields

results: Vec<Result<(), APIError>>

The errors themselves, in the same order as the route hops.

failed_paths_retry: Option<RouteParameters>

If some paths failed without irrevocably committing to the new HTLC(s), this will contain a RouteParameters object which can be used to calculate a new route that will pay all remaining unpaid balance.

payment_id: PaymentId

The payment id for the payment, which is now at least partially pending.

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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.