docs.rs failed to build backoff-config-0.0.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
backoff-config-0.1.4
๐ backoff-config โ๏ธ
backoff-config makes configuring backoff more flexible by providing a unified Backoff strategy enum and a
BackoffConfig that supports deserialization.
The actual backoff logic is powered by the awesome backon crate. Make sure to check out backon to explore its amazing features and ergonomics!
backoff-config integrates with backon by implementing:
Usage
-
Add to your
Cargo.toml:= "0.1" -
Load
BackoffConfigfrom your data source. Hereโs an example using environment variables and the figment configuration library:
use Deserialize;
// Example environment variables:
// CONFIG__BACKOFF__STRATEGY=Constant
// CONFIG__BACKOFF__DELAY=1s
// CONFIG__BACKOFF__MAX_RETRIES=123
- Use
config.backoffto build and apply your backoff strategy when calling retryable operations.
Examples
For an end-to-end usage example, see the TOML example and run it with:
For more examples on the data formats, see:
- Env examples โ loading config from environment variables.
- TOML examples โ loading config from a TOML file.