mas_config

Trait ConfigurationSection

Source
pub trait ConfigurationSection: Sized + DeserializeOwned {
    const PATH: Option<&'static str> = None;

    // Provided methods
    fn validate(&self, _figment: &Figment) -> Result<(), FigmentError> { ... }
    fn extract(figment: &Figment) -> Result<Self, FigmentError> { ... }
}
Expand description

Trait implemented by all configuration section to help loading specific part of the config and generate the sample config.

Provided Associated Constants§

Source

const PATH: Option<&'static str> = None

Specify where this section should live relative to the root.

Provided Methods§

Source

fn validate(&self, _figment: &Figment) -> Result<(), FigmentError>

Validate the configuration section

§Errors

Returns an error if the configuration is invalid

Source

fn extract(figment: &Figment) -> Result<Self, FigmentError>

Extract configuration from a Figment instance.

§Errors

Returns an error if the configuration could not be loaded

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ConfigurationSection for AccountConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for AppConfig

Source§

impl ConfigurationSection for BrandingConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for CaptchaConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for ClientsConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for DatabaseConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for EmailConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for ExperimentalConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for HttpConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for MatrixConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for PasswordsConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for PolicyConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for RateLimitingConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for RootConfig

Source§

impl ConfigurationSection for SecretsConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for SyncConfig

Source§

impl ConfigurationSection for TelemetryConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for TemplatesConfig

Source§

const PATH: Option<&'static str> = _

Source§

impl ConfigurationSection for UpstreamOAuth2Config

Source§

const PATH: Option<&'static str> = _