Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Arti Arti
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 320
    • Issues 320
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 24
    • Merge requests 24
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • ArtiArti
  • Issues
  • #284

arti_client: Restructure client construction API

IMO:

One should construct a new client like this:

use arti_client::tokio_native_tls as tor; 
tor::TorClient::new_config().some_setting(42)?.bootstrap()?`

I.e.:

  • bootstrap should be a method on TorClientCfg, not an inherent impl on TorClient. (I think providing the same function with two names is confusing unless it's done for convenience for a the function which is is used very frequently.)

  • The distinction between TorClientConfigBuilder and TorClientCfg should be abolished. The distinction between validated and unvalidated configs should not be exposed; instead, bootstrap should operate on the unvalidated config and validate it before proceeding.

  • There should be modules with ready-specialised (for runtime, etc.) versions of TorClient etc. which avoids having to wrestle runtime and other generics.

See also #278 (closed), which requests a version of bootstrap that does lazy init instead. That would be another method on TorClientCfg.

Edited Jan 12, 2022 by Nick Mathewson
Assignee
Assign to
Time tracking