with_retry

Function with_retry 

Source
pub async fn with_retry<F, Fut, T, E>(
    operation: F,
    config: &RetryConfig,
    operation_name: &str,
) -> Result<T, E>
where F: FnMut() -> Fut, Fut: Future<Output = Result<T, E>>, E: RetryableError + Display,
Expand description

Execute an operation with retry logic

§Arguments

  • operation - A closure that returns a future with the operation to retry
  • config - Retry configuration
  • operation_name - A descriptive name for logging

§Returns

Returns the result of the operation, or the last error if all retries failed