Skip to main content

Config

Trait Config 

Source
pub trait Config: Send + Sync {
    // Required methods
    fn server(&self) -> &ServerConfig;
    fn logger(&self) -> &LoggerConfig;
    fn middleware(&self) -> &MiddlewareConfig;
}
Expand description

Application configuration. Used as a trait object (Box<dyn Config>) so the backing store can be swapped without touching call sites.

Required Methods§

Source

fn server(&self) -> &ServerConfig

Server bind/port settings.

Source

fn logger(&self) -> &LoggerConfig

Logging settings.

Source

fn middleware(&self) -> &MiddlewareConfig

Opt-in middleware settings (CORS, …).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§