#[non_exhaustive]pub struct Config {
pub server: Config,
pub database: Config,
pub tracing: Config,
pub cookie: Option<CookieConfig>,
pub security_headers: SecurityHeadersConfig,
pub cors: CorsConfig,
pub csrf: CsrfConfig,
pub rate_limit: RateLimitConfig,
pub trusted_proxies: Vec<String>,
}Expand description
Top-level framework configuration.
Deserializes from a YAML file loaded by crate::config::load. All fields
use #[serde(default)], so any section omitted from the YAML file falls
back to the type’s own Default implementation.
Applications that need extra config fields can embed Config with
#[serde(flatten)] inside their own config struct.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.server: ConfigHTTP server bind address and shutdown behaviour.
database: Configlibsql database settings. Requires the db feature.
tracing: ConfigLog level, format, and optional Sentry integration.
Signed cookie secret and attributes. When absent, signed/private cookies are disabled.
security_headers: SecurityHeadersConfigHTTP security-header middleware settings.
cors: CorsConfigCORS policy.
csrf: CsrfConfigCSRF protection settings.
rate_limit: RateLimitConfigToken-bucket rate-limiting settings.
trusted_proxies: Vec<String>CIDR ranges of trusted reverse proxies used by crate::ip::ClientIpLayer.
Accepts any string parseable as ipnet::IpNet, e.g. "10.0.0.0/8".