Trait cfg_rs::FromConfig
source · pub trait FromConfig: Sized {
// Required method
fn from_config(
context: &mut ConfigContext<'_>,
value: Option<ConfigValue<'_>>
) -> Result<Self, ConfigError>;
}Expand description
Generate config instance from configuration.
The most power of this crate is automatically deriving this trait. Please refer to Derive FromConfig for details.
Required Methods§
sourcefn from_config(
context: &mut ConfigContext<'_>,
value: Option<ConfigValue<'_>>
) -> Result<Self, ConfigError>
fn from_config( context: &mut ConfigContext<'_>, value: Option<ConfigValue<'_>> ) -> Result<Self, ConfigError>
Generate config from ConfigValue under context.