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
The Tor Project
Core
Arti
Commits
5187b05c
Commit
5187b05c
authored
3 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Use script to update README.md files.
parent
427e07ec
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
crates/arti-client/README.md
+8
-6
8 additions, 6 deletions
crates/arti-client/README.md
crates/tor-proto/README.md
+0
-3
0 additions, 3 deletions
crates/tor-proto/README.md
crates/tor-rtcompat/README.md
+8
-6
8 additions, 6 deletions
crates/tor-rtcompat/README.md
with
16 additions
and
15 deletions
crates/arti-client/README.md
+
8
−
6
View file @
5187b05c
...
...
@@ -57,7 +57,7 @@ If you really want to connect to a raw IP address and know what you're doing, ta
let
config
=
TorClientConfig
::
default
();
// Arti needs a handle to an async runtime in order to spawn tasks and use the
// network. (See "Multiple runtime support" below.)
let
rt
=
tor_rtcompat
::
tokio
::
current_runtime
()
?
;
let
rt
=
tor_rtcompat
::
tokio
::
TokioNativeTlsRuntime
::
current
()
?
;
// Start the Arti client, and let it bootstrap a connection to the Tor network.
// (This takes a while to gather the necessary directory information.
...
...
@@ -113,14 +113,16 @@ Functions in this crate, like [`TorClient::bootstrap`],
will expect a type that implements [
`tor_rtcompat::Runtime`
], which can be obtained:
-
for Tokio:
-
by calling [
`tor_rtcompat::tokio::
current_runtime
`
], if a Tokio reactor is already running
-
by calling [
`tor_rtcompat::tokio::
c
re
ate_runtime
`
], to start a new reactor if one is not
-
by calling [
`tor_rtcompat::tokio::
PreferredRuntime::current()
`
], if a Tokio reactor is already running
-
by calling [
`tor_rtcompat::tokio::
P
re
ferredRuntime::create()
`
], to start a new reactor if one is not
already running
-
by manually creat
ing
a
[
`TokioRuntim
eHandl
e`
](
tor_rtcompat::tokio::Tokio
RuntimeHandle
)
from
an existing Tokio runtime handle
-
as above, but explicitly specify
ing
[
`Tokio
NativeTls
Runtime`
](
tor_rtcompat::tokio::Tokio
NativeTlsRuntime
)
or
[
`TokioRustlsRuntime`
](
tor_rtcompat::tokio::TokioRustlsRuntime
)
in place of
`PreferredRuntime`
.
-
for async-std:
-
by calling [
`tor_rtcompat::async_std::
current_runtime
`
], which will create a runtime or
-
by calling [
`tor_rtcompat::async_std::
PreferredRuntime::current()
`
], which will create a runtime or
retrieve the existing one, if one has already been started
-
as above, but explicitly specifying
[
`AsyncStdNativeTlsRuntime`
](
tor_rtcompat::async_std::AsyncStdNativeTlsRuntime
)
or
[
`AsyncStdRustlsRuntime`
](
tor_rtcompat::async_std::AsyncStdRustlsRuntime
)
in place of
`PreferredRuntime`
.
## Feature flags
...
...
This diff is collapsed.
Click to expand it.
crates/tor-proto/README.md
+
0
−
3
View file @
5187b05c
...
...
@@ -84,7 +84,4 @@ I bet that there are deadlocks somewhere in this code. I fixed
all the ones I could find or think of, but it would be great to
find a good way to eliminate every lock that we have.
This crate doesn't work with rusttls because of a limitation in the
webpki crate.
License: MIT OR Apache-2.0
This diff is collapsed.
Click to expand it.
crates/tor-rtcompat/README.md
+
8
−
6
View file @
5187b05c
...
...
@@ -42,7 +42,7 @@ traits it provides.
The
`tor-rtcompat`
crate provides several traits that
encapsulate different runtime capabilities.
*
A runtime is a [
`
Spawn
Block
ing
`
] if it can block on a future.
*
A runtime is a [
`Block
On
`
] if it can block on a future.
*
A runtime is a [
`SleepProvider`
] if it can make timer futures that
become Ready after a given interval of time.
*
A runtime is a [
`TcpProvider`
] if it can make and receive TCP
...
...
@@ -62,11 +62,13 @@ You can get a [`Runtime`] in several ways:
*
If you want to construct a default runtime that you won't be
using for anything besides Arti, you can use [
`create_runtime()`
].
*
If you want to explicitly construct a runtime with a specific
backend, you can do so with [
`async_std::create_async_std_runtime`
] or
[
`tokio::create_tokio_runtime`
]. Or if you have already constructed a
*
If you want to use a runtime with an explicitly chosen backend,
name its type directly as [
`async_std::AsyncStdNativeTlsRuntime`
],
[
`async_std::AsyncStdRustlsRuntime`
], [
`tokio::TokioNativeTlsRuntime`
],
or [
`tokio::TokioRustlsRuntime`
]. To construct one of these runtimes,
call its
`create()`
method. Or if you have already constructed a
tokio runtime that you want to use, you can wrap it as a
[
`Runtime`
] explicitly with
[
`tokio::TokioRuntimeHandle`
]
.
[
`Runtime`
] explicitly with
`current()`
.
## Cargo features
...
...
@@ -94,7 +96,7 @@ to other environments (like WASM) in the future.
We could simplify this code significantly by removing most of the
traits it exposes, and instead just exposing a single
implementation. For example, instead of exposing a
[
`
Spawn
Block
ing
`
] trait to represent blocking until a task is
[
`Block
On
`
] trait to represent blocking until a task is
done, we could just provide a single global
`block_on`
function.
That simplification would come at a cost, however. First of all,
...
...
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