config_from

Function config_from 

Source
pub async fn config_from(file_values: Value) -> GenericConfiguration
Expand description

Builds a GenericConfiguration from an in-memory JSON body, for use in tests.

This is a thin convenience wrapper around ConfigurationLoader::for_tests for the common case of a test that only needs file-based configuration values, with no environment variables and no dynamic configuration. The dynamic-configuration sender that for_tests can optionally return is unused in that case and is discarded here.

Callers that need a typed configuration should build it from the returned GenericConfiguration (for example, via a SomeConfiguration::from_configuration constructor or GenericConfiguration::as_typed).

This is exposed publicly so that tests in downstream crates can share a single loader helper instead of re-implementing it per file.