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 anEffectwithconfig_envinR. -
Figment + serde
Build a Figment (TOML + env + …), thenextract/FigmentLayerfor whole-document deserialization when you prefer serde-shaped config files. -
Low-level
read_*helpers
InjectNeedsConfigProviderand callread_string,read_integer, … for imperative-style reads that still stay inside the effect environment.
Wiring
At the stack root, install a config provider service and (for descriptor run) the config_env helper so R: NeedsConfigProvider (and friends) resolve. Combine with Layers the same way as databases or loggers.
Further reading
cargo doc --open -p id_effect_config— extensive crate-level examples- Schema for validating structured values after config strings become wire data