Trait RetryPolicy

Source
pub trait RetryPolicy {
    // Required method
    fn should_retry(err: &Status, tries: u8) -> RetryPolicyResult;
}
Expand description

Retry policy for the request.

This trait is used to determine whether a request should be retried or not based on the error returned by the server and number of attempts. It also provides information about the status of the server and the time to wait before retrying the request.

§Note

This trait is designed to be used by clients generated by [soda-pool-build] crate. While it can be useful in other cases too, it is not used directly anywhere in this crate.

§Warning

If there are no more alive connections in the pool, the request will not be retried and the last error will be returned to the caller. The retry policy cannot be used to override this behavior.

Required Methods§

Source

fn should_retry(err: &Status, tries: u8) -> RetryPolicyResult

Called to determine the status of the server and whether the request should be retried or not.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§