Registry / utility / tryhard

tryhard

JSON →
library0.5.2rscratesunverified

Easily retry futures with configurable backoff strategies.

# Cargo.toml [dependencies] tryhard = "0.5.2"
INSTALL
IMPORT
SIG · TRYHARD
T
tryhard
utilityrustv0.5.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

retry_fn
use tryhard::retry_fn;

Retry a future up to 3 times

use tryhard::retry_fn; use std::future::ready; #[tokio::main] async fn main() { let result = retry_fn(|| ready(Ok::<_, String>("success"))) .retries(3) .await .unwrap(); println!("{}", result); }
Debug
Known issues
gotchaRequires an async runtime (e.g., Tokio) for execution.
fix
Add tokio as a dependency and use #[tokio::main].
affects: >=0.5.0
Upgrade
Version history
0.5.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
60 hits · last 30 days
node
56
Resources
tryhard — cargo add tryhard · libregistry