pub async fn with_backoff<T, F, Fut>(policy: RetryPolicy, op: F) -> Result<T>Expand description
Run op under policy, retrying transient failures with exponential backoff.
Retries on Error::Server / Error::Network (doubled base_delay) and
Error::RateLimited (sleeps for the server-supplied retry_after). Any
other variant — or exhausting max_attempts — propagates the last error.
op receives the 1-indexed attempt number so callers can log per-try state.