Configuration (id_effect_config)
Workspace crate id_effect_config loads configuration in a way aligned with Effect.ts configuration: lazy descriptors, optional Figment layering, and low-level effectful reads from a provider installed in R.
Three complementary styles
-
Config<T>descriptors (recommended for parity with EffectConfig.*)
Compose values likeConfig::string("HOST"),Config::integer("PORT").with_default(3000), then evaluate withConfig::loadagainst a concrete provider orConfig::runas anEffectwith config capabilities inR. -
Figment + serde
Build a Figment (TOML + env + …), thenextract/ provider helpers for whole-document deserialization when you prefer serde-shaped config files. -
Low-level
read_*helpers
Declarecaps!(ConfigProviderService)(or the crate's config key) and callread_string,read_integer, … for imperative-style reads that still stay inside the effect environment.
Wiring
At the stack root, install a config provider with provide!(…) and combine with Providers the same way as databases or loggers:
#![allow(unused)] fn main() { run_with([provide!(ConfigLive), provide!(DatabaseLive)], app())?; }
Further reading
cargo doc --open -p id_effect_config— extensive crate-level examples- Schema for validating structured values after config strings become wire data