pub trait Resolvable: Sized {
// Required methods
fn resolve(input: &mut ResolveContext) -> Result<Self, ConfigResolveError>;
fn enumerate_deprecated_keys<F>(f: &mut F)
where F: FnMut(&'static [&'static str]);
}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§
Sourcefn resolve(input: &mut ResolveContext) -> Result<Self, ConfigResolveError>
fn resolve(input: &mut ResolveContext) -> Result<Self, ConfigResolveError>
Deserialize and build from a configuration
Sourcefn enumerate_deprecated_keys<F>(f: &mut F)
fn enumerate_deprecated_keys<F>(f: &mut F)
Return a list of deprecated config keys, as “.”-separated strings
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.