aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-config/src/map_builder.rs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* config: Update doctests to use Deftly, and to passNick Mathewson2026-05-271-12/+10
| | | | | | | | Some of the tests used derive(Builder), which is not current practice for our configuration. Additionally, they didn't implement the requisite ConfigBuilder logic to pass with the other changes in this branch.
* config: Add a method to fill in a builder with unset defaultsNick Mathewson2026-05-271-0/+22
| | | | | | | | | | | | | | | This new method modifies a builder by replacing any unset values that have a default with that default. We're using this method so that we can re-serialize a builder into a `ConfigurationTree` with all of its default values included. In all cases, `b.apply_defaults()?; b.build()` should produce the same output as `b.build()`. The interesting parts of this commit are in tor_config::load and tor_config::derive. The rest of this commit just adds `apply_defaults` to other builders that _aren't_ made with `derive_deftly(TorConfig)`.
* config: Implement Builder for ListBuilders and MapBuilders.Nick Mathewson2026-05-271-0/+6
| | | | This isn't strictly necessary, but it helps for consistency.
* config: Use derive(TorConfig) for map builder tests.Nick Mathewson2026-05-181-14/+8
|
* tor-config: Have macros document more types and fnsNick Mathewson2026-02-241-0/+1
|
* map_builder: Alternative syntax for use by derive(TorConfig)Nick Mathewson2025-12-091-5/+51
| | | | | | | | | | derive_deftly wants to expand types before passing them to macro_rules macros, which is quite reasonable. But map_builder wants its input collection type to be an `ident`, not a `path`. (And macro_rules doesn't accept `path` before a `<`.) To fix this, we're providing an alternative syntax for map_builder, where the inputs are the map type and the builder map type.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* map_builder: Document deserialize implemntation.Nick Mathewson2024-12-191-0/+3
|
* map_builder: Extensively rework example.Nick Mathewson2024-12-191-9/+64
|
* map_builder: Add support for default settings.Nick Mathewson2024-12-191-10/+133
| | | | | | This is a little tricky (beyond the usual macro fun) because we needed to use ExtendBuilder to get reasonable behavior for our default trees.
* Define macros to create a map-builder type.Nick Mathewson2024-12-191-0/+215
We're about to need this to define some of the configuration for RPC listeners. The provided map-builder type is much less voluminous in terms of APIs added than the list-builder type: It just uses Deref* and sub_builder. I think this simplicity may be a win. I'll need to rethink how this type handles defaults in order to implement connect points properly; I've left XXXXs for that issue.