Skip to main content

Module config

Module config 

Source
Expand description

Per-environment cache configuration loaded from the cache section of config/<env>.yml.

CacheConfig selects the backend (memory, redis, or memcache) and its endpoint, and CacheConfig::build turns that into a live Arc<dyn CacheStore>. The Redis and Memcache backends are behind the cache-redis / cache-memcache cargo features; selecting a backend whose feature is not enabled yields a clear error.

Structs§

CacheConfig
Cache settings, deserialized from the cache section of config/<env>.yml.
YamlConfig
File-based config deserialized from config/<env>.yml. Only the cache section is read; other sections (server, database, logger…) are ignored.

Enums§

CacheBackend
Which cache backend to use.

Functions§

load
Loads the current environment’s CacheConfig, falling back to the default (in-memory) when the file is missing or has no cache section.