Skip to main content

Crate reliakit

Crate reliakit 

Source
Expand description

Umbrella crate for the Reliakit reliability toolkit.

This crate has no logic of its own. It re-exports the individual reliakit-* crates behind feature flags so you can depend on a single name and enable only the building blocks you need. Nothing is pulled in by default beyond the std flag; each module below appears only when its feature is enabled.

Add it and pick the pieces you want:

reliakit = { version = "0.1", features = ["ratelimit", "secret"] }
use reliakit::ratelimit::RateLimiter;
use reliakit::secret::SecretString;

let mut limiter = RateLimiter::new(5, 1, 1);
assert!(limiter.try_acquire_one(0));

let api_key = SecretString::from_string("rk_live_value");
assert_eq!(format!("{api_key}"), "[REDACTED]");

For no_std, disable default features and add alloc where a module needs owned storage:

reliakit = { version = "0.1", default-features = false, features = ["alloc", "primitives"] }

§Features

FeatureRe-exports
corereliakit_core as core; also enables the clock-aware *_now methods of any enabled resilience crate
primitivesreliakit_primitives as primitives
secretreliakit_secret as secret
validatereliakit_validate as validate
collectionsreliakit_collections as collections
codecreliakit_codec as codec
backoffreliakit_backoff as backoff
circuitreliakit_circuit as circuit
ratelimitreliakit_ratelimit as ratelimit
timeoutreliakit_timeout as timeout
jsonreliakit_json as json
derivereliakit_derive as derive
decidereliakit_decide as decide
fullall of the above

std (on by default) implies alloc; both forward to the enabled crates. The integration features json-canonical, json-primitives, json-validate, and codec-primitives turn on the matching cross-crate features.

Re-exports§

pub use reliakit_core as core;
pub use reliakit_primitives as primitives;
pub use reliakit_secret as secret;
pub use reliakit_validate as validate;
pub use reliakit_collections as collections;
pub use reliakit_codec as codec;
pub use reliakit_backoff as backoff;
pub use reliakit_circuit as circuit;
pub use reliakit_ratelimit as ratelimit;
pub use reliakit_timeout as timeout;
pub use reliakit_json as json;
pub use reliakit_derive as derive;
pub use reliakit_decide as decide;