named-retry 0.2.0

A simple utility for retrying fallible asynchronous operations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# named-retry

This is a simple, `impl Copy` utility for retrying fallible asynchronous operations, with helpful log messages through `tracing`.

```rust
use std::time::Duration;
use named_retry::Retry;

let retry = Retry::new("test")
    .attempts(5)
    .base_delay(Duration::from_secs(1))
    .delay_factor(2.0);

let result = retry.run(|| async { Ok::<_, ()>("done!") }).await;
assert_eq!(result, Ok("done!"));
```