Skip to main content

retry

Function retry 

Source
pub async fn retry<T, E, F, Fut>(count: usize, f: F) -> Result<T, E>
where F: FnMut() -> Fut, Fut: Future<Output = Result<T, E>>,
Expand description

Call f until it succeeds, at most count times, without delays.

Returns the last error when every attempt fails. count is clamped to at least one attempt.