Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Arti
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jill
Arti
Commits
ab352881
Commit
ab352881
authored
3 years ago
by
Ian Jackson
Browse files
Options
Downloads
Patches
Plain Diff
Add rationale for CircMgrConfig transparency and trait
parent
82aa4b90
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
crates/tor-circmgr/src/config.rs
+22
-1
22 additions, 1 deletion
crates/tor-circmgr/src/config.rs
with
22 additions
and
1 deletion
crates/tor-circmgr/src/config.rs
+
22
−
1
View file @
ab352881
...
...
@@ -255,7 +255,28 @@ define_accessor_trait! {
/// If the circuit manager gains new configurabilities, this trait will gain additional
/// supertraits, as an API break.
///
/// Prefer to use [`TorClientConfig`], which will always implement this trait.
/// Prefer to use `TorClientConfig`, which will always implement this trait.
//
// We do not use a builder here. Instead, additions or changes here are API breaks.
//
// Rationale:
//
// The purpose of using a builder is to allow the code to continue to
// compile when new fields are added to the built struct.
//
// However, here, the DirMgrConfig is just a subset of the fields of a
// TorClientConfig, and it is important that all its fields are
// initialised by arti-client.
//
// If it grows a field, arti-client ought not to compile any more.
//
// Indeed, we have already had a bug where a manually-written
// conversion function omitted to copy a config field from
// TorClientConfig into then-existing CircMgrConfigBuilder.
//
// We use this AsRef-based trait, so that we can pass a reference
// to the configuration when we build a new CircMgr, rather than
// cloning all the fields an extra time.
pub
trait
CircMgrConfig
{
path_rules
:
PathConfig
,
circuit_timing
:
CircuitTiming
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment