Skip to content

ApplicationConfig

Every configuration entry becomes a field in ApplicationConfig, a code-generated struct in the server SDK crate that represents the entire set of configuration options for your application.

server_sdk/src/lib.rs
// [...]
pub struct ApplicationConfig {
    pub database: configuration::base::DatabaseConfig,
    pub server: configuration::server::ServerConfig,
}

Usage

ApplicationConfig is used as the generic parameter for ConfigLoader::load when assembling the configuration as the application starts.

You can also use ApplicationConfig as the source of truth to determine the names of environment variables and the expected schema for configuration files.

Other than that, you won't need to interact with ApplicationConfig directly unless you're implementing a custom configuration loading mechanism.