Expand description
Deserialization for converting ConfigValue instances to target types.
The Deserializer type is the main driver of deserialization.
The workflow is roughly:
GlobalContext::get<T>()createsDeserializerand callsT::deserialize()- Then call type-specific deserialize methods as in normal serde deserialization.
- For primitives,
deserialize_*methods look upConfigValueinstances inGlobalContextand convert. - Structs and maps are handled by
ConfigMapAccess. - Sequences are handled by
ConfigSeqAccess, which later usesArrayItemDeserializerfor each array item. Value<T>is delegated toValueDeserializerindeserialize_struct.
- For primitives,
The purpose of this workflow is to:
- Retrieve the correct config value based on source location precedence
- Provide richer error context showing where a config is defined
- Provide a richer internal API to map to concrete config types
without touching underlying
ConfigValuedirectly
Re-exportsยง
use crate::config::ArrayItemKeyPath;๐use crate::context::value;๐use crate::context::ConfigError;๐use crate::context::ConfigKey;๐use crate::context::GlobalContext;๐use crate::context::ConfigValue as CV;๐use crate::context::Definition;๐use crate::context::Value;๐use crate::util::data_structures::HashSet;๐use serde::de;๐use serde::de::IntoDeserializer;๐use std::vec;๐use std::vec;๐
Macrosยง
- deserialize_
method ๐
Structsยง
- Array
Item ๐Deserializer - A deserializer for individual
ConfigValueitems in arrays - Array
Item ๐MapAccess - Map access for nested tables within
ArrayItemDeserializer - Array
Item ๐SeqAccess - Sequence access for nested arrays within
ArrayItemDeserializer - Config
MapAccess ๐ - Config
SeqAccess ๐ - Deserializer ๐
- Serde deserializer used to convert config values to a target type using
GlobalContext::get. - Tuple2
Deserializer ๐ - A deserializer which takes two values and deserializes into a tuple of those
two values. This is similar to types like
StrDeserializerin upstream serde itself. - Value
Deserializer ๐ - This is a deserializer that deserializes into a
Value<T>for configuration.
Enumsยง
- KeyKind ๐
- Value
Source ๐ - Source of data for
ValueDeserializer