Skip to main content

ConfigValueType

Trait ConfigValueType 

Source
pub trait ConfigValueType {
    type Value;

    // Required methods
    fn from_conf(conf: &ConfigValue) -> Result<Self::Value, ConfigError>;
    fn into_config_value(value: Self::Value) -> ConfigValue;

    // Provided method
    fn config_string(value: Self::Value) -> String { ... }
}
Expand description

A value extractor for config values.

Required Associated Types§

Source

type Value

The type of the value extracted by this type.

Required Methods§

Source

fn from_conf(conf: &ConfigValue) -> Result<Self::Value, ConfigError>

Extract the value from a config instance.

Source

fn into_config_value(value: Self::Value) -> ConfigValue

Convert a runtime value into a config value.

Provided Methods§

Source

fn config_string(value: Self::Value) -> String

Produce a TOML fragment for the value.

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§