File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 1- //! Support for deserializing configuration via `serde`
1+ //! Deserialization for converting [`ConfigValue`] instances to target types.
2+ //!
3+ //! The [`Deserializer`] type is the main driver of deserialization.
4+ //! The workflow is roughly:
5+ //!
6+ //! 1. [`GlobalContext::get<T>()`] creates [`Deserializer`] and calls `T::deserialize()`
7+ //! 2. Then call type-specific deserialize methods as in normal serde deserialization.
8+ //! - For primitives, `deserialize_*` methods look up [`ConfigValue`] instances
9+ //! in [`GlobalContext`] and convert.
10+ //! - Structs and maps are handled by [`ConfigMapAccess`].
11+ //! - Sequences are handled by [`ConfigSeqAccess`],
12+ //! which later uses [`ArrayItemDeserializer`] for each array item.
13+ //! - [`Value<T>`] is delegated to [`ValueDeserializer`] in `deserialize_struct`.
14+ //!
15+ //! The purpose of this workflow is to:
16+ //!
17+ //! - Retrieve the correct config value based on source location precedence
18+ //! - Provide richer error context showing where a config is defined
19+ //! - Provide a richer internal API to map to concrete config types
20+ //! without touching underlying [`ConfigValue`] directly
21+ //!
22+ //! [`ConfigValue`]: CV
223
324use crate :: util:: context:: value;
425use crate :: util:: context:: { ConfigError , ConfigKey , GlobalContext } ;
You can’t perform that action at this time.
0 commit comments