Trait tor_config::load::Resolvable
source · [−]pub trait Resolvable: Sized {
fn resolve(input: &mut ResolveContext) -> Result<Self, ConfigResolveError>;
}Expand description
Collection of configuration settings that can be deserialized and then built
Do not implement directly.
Instead, implement TopLevel: doing so engages the blanket impl
for (loosely) TopLevel + Builder.
Each Resolvable corresponds to one or more configuration consumers.
Ultimately, one Resolvable for all the configuration consumers in an entire
program will be resolved from a single configuration tree (usually parsed from TOML).
Multiple config collections can be resolved from the same configuration,
via the implementation of Resolvable on tuples of Resolvables.
Use this rather than #[serde(flatten)]; the latter prevents useful introspection
(necessary for reporting unrecognized configuration keys, and testing).
(The resolve method will be called only from within the tor_config::load module.)
Required Methods
fn resolve(input: &mut ResolveContext) -> Result<Self, ConfigResolveError>
fn resolve(input: &mut ResolveContext) -> Result<Self, ConfigResolveError>
Deserialize and build from a configuration