diff options
author | Nick Mathewson <nickm@torproject.org> | 2024-02-15 11:04:40 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2024-03-13 09:48:35 -0400 |
commit | 54863b653dd1e4910e288d44c74e0a21a8b58596 (patch) | |
tree | 328e56d51e984660bdff50f148c0ee15ae70d635 | |
parent | 1e002b6472e17b57f9a750d0aa2fbbb7855a4565 (diff) | |
download | arti-54863b653dd1e4910e288d44c74e0a21a8b58596.tar.gz arti-54863b653dd1e4910e288d44c74e0a21a8b58596.zip |
tor-config: Update documentation to not refer to config crate.
-rw-r--r-- | crates/tor-config/README.md | 2 | ||||
-rw-r--r-- | crates/tor-config/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/tor-config/src/load.rs | 8 | ||||
-rw-r--r-- | crates/tor-config/src/sources.rs | 11 |
4 files changed, 12 insertions, 11 deletions
diff --git a/crates/tor-config/README.md b/crates/tor-config/README.md index 48a254243..cdea6d420 100644 --- a/crates/tor-config/README.md +++ b/crates/tor-config/README.md @@ -25,7 +25,7 @@ works as follows: 2. [`ConfigurationSources::load`] actually *reads* all of these sources, parses them (eg, as TOML files), - and returns a [`config::Config`]. + and returns a [`ConfigurationTree`]. This is a tree-structured dynamically typed data structure, mirroring the input configuration structure, largely unvalidated, and containing everything in the input config sources. diff --git a/crates/tor-config/src/lib.rs b/crates/tor-config/src/lib.rs index d26f88011..5ba0a1675 100644 --- a/crates/tor-config/src/lib.rs +++ b/crates/tor-config/src/lib.rs @@ -336,7 +336,7 @@ where /// * `impl Default for $Config` /// * `impl Builder for $ConfigBuilder` /// * a self-test that the `Default` impl actually works -/// * a test that the `Builder` can be deserialized from an empty [`config::Config`], +/// * a test that the `Builder` can be deserialized from an empty [`ConfigurationTree`], /// and then built, and that the result is the same as the ordinary default. // // The implementation munches fake "trait bounds" (`: !Deserialize + !Wombat ...`) off the RHS. diff --git a/crates/tor-config/src/load.rs b/crates/tor-config/src/load.rs index b6ec97e02..6f872f94f 100644 --- a/crates/tor-config/src/load.rs +++ b/crates/tor-config/src/load.rs @@ -1,8 +1,8 @@ -//! Processing a config::Config into a validated configuration +//! Processing a `ConfigurationTree` into a validated configuration //! //! This module, and particularly [`resolve`], takes care of: //! -//! * Deserializing a [`config::Config`] into various `FooConfigBuilder` +//! * Deserializing a [`ConfigurationTree`] into various `FooConfigBuilder` //! * Calling the `build()` methods to get various `FooConfig`. //! * Reporting unrecognised configuration keys //! (eg to help the user detect misspellings). @@ -21,7 +21,7 @@ //! //! * [`impl TopLevel`](TopLevel) for your *top level* structures (only). //! -//! * Call [`resolve`] (or one of its variants) with a `config::Config`, +//! * Call [`resolve`] (or one of its variants) with a `ConfigurationTree`, //! to obtain your top-level configuration(s). //! //! # Example @@ -33,7 +33,7 @@ //! for additional configuration settings for the added features. //! * Establishes some configuration sources //! (the trivial empty `ConfigSources`, to avoid clutter in the example) -//! * Reads those sources into a single configuration taxonomy [`config::Config`]. +//! * Reads those sources into a single configuration taxonomy [`ConfigurationTree`]. //! * Processes that configuration into a 3-tuple of configuration //! structs for the three components, namely: //! - `TorClientConfig`, the configuration for the `arti_client` crate's `TorClient` diff --git a/crates/tor-config/src/sources.rs b/crates/tor-config/src/sources.rs index ed1006b91..d40378357 100644 --- a/crates/tor-config/src/sources.rs +++ b/crates/tor-config/src/sources.rs @@ -2,7 +2,8 @@ //! //! This module provides [`ConfigurationSources`]. //! -//! This layer brings together the functionality of [`config::File`], +//! This layer brings together the functionality of +//! our underlying configuration library, //! [`fs_mistrust`] and [`tor_config::cmdline`](crate::cmdline). //! //! A `ConfigurationSources` records a set of filenames of TOML files, @@ -12,7 +13,7 @@ //! Usually, call [`ConfigurationSources::from_cmdline`], //! perhaps [`set_mistrust`](ConfigurationSources::set_mistrust), //! and finally [`load`](ConfigurationSources::load). -//! The resulting [`config::Config`] can then be deserialized. +//! The resulting [`ConfigurationTree`] can then be deserialized. //! //! If you want to watch for config file changes, //! use [`ConfigurationSources::scan()`], @@ -251,7 +252,7 @@ impl ConfigurationSources { &self.mistrust } - /// Scan for files and load the configuration into a new [`config::Config`]. + /// Scan for files and load the configuration into a new [`ConfigurationTree`]. /// /// This is a convenience method for [`scan()`](Self::scan) /// followed by [`files.load`]. @@ -392,8 +393,8 @@ impl FoundConfigFiles<'_> { Ok(builder) } - /// Load the configuration into a new [`config::Config`]. - pub fn load(self) -> Result<ConfigurationFields, ConfigError> { + /// Load the configuration into a new [`ConfigurationTree`]. + pub fn load(self) -> Result<ConfigurationTree, ConfigError> { let mut builder = config::Config::builder(); builder = self.add_sources(builder)?; Ok(ConfigurationTree( |