Skip to main content

EnvConfig

Trait EnvConfig 

Source
pub trait EnvConfig: Sized {
    // Required method
    fn assemble(sources: &SourceChain<'_>) -> Result<Self, EnvConfigError>;
}
Expand description

A struct that can be assembled from a SourceChain — implemented by #[derive(EnvConfig)].

Required Methods§

Source

fn assemble(sources: &SourceChain<'_>) -> Result<Self, EnvConfigError>

Threads sources through this struct’s per-field assembly instructions to build an instance.

§Errors

Returns EnvConfigError::InvalidField when a present value fails to convert to its field’s type, or EnvConfigError::MissingField when no source has a value and the field has no default.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§