retry-tools 0.1.0
Retry a flaky operation with exponential backoff
Install
cargo add retry-tools --registry rupm
In Ruststudio: Packages, search for retry-tools, Install.
Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-22.
Versions
- 0.1.0 2026-11-22
README
# retry-tools
Retry a flaky operation with exponential backoff
Add it with `rupm add retry-tools` (or `cargo add retry-tools --registry rupm`).
```rust
let data = retry_tools::retry(3, 200, || std::fs::read_to_string("//server/share/report.txt"))?;
// only retry what is worth retrying:
let mut get = || http_tools::get_text("https://example.org");
let page = retry_tools::retry_if(4, 250, |e| matches!(e, http_tools::Error::Network(_)), &mut get)?;
```