| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| |
|
|
| |
These only serve as a compile-time check.
|
| |
|
|
| |
The future no longer needs to be `Send + 'static`.
|
| |
|
|
|
|
| |
We change `NoUnixAddressSupport` to `NoAfUnixSocketSupport` because it
doesn't make much sense to talk about support for the addresses
separately from support for the sockets.
|
| |
|
|
| |
Let's use Tokio terminology here.
|
| |
|
|
| |
rustfmt.
|
| |
|
|
|
|
|
|
| |
Introduce ToplevelRuntime as an alias, and use it in the top-level
programs.
Now none of the principal protocol implementation code has access to
the executor's toplevel entrypoint, and can't call it by mistake.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Forbid re-entering the executor using ToplevelBlockOn::block_on.
This was always forbidden in the case of MockExecutor, but that meant
that tests using MockExecutor would malfunction if the code under test
needed to re-enter the executor from sync code (since the code under test
would have to use block_on, which wrong). See #1835.
Provide a function which *can* do this, reenter_block_on. The
MockExecutor needs to know the difference, and other runtimes may too.
They are conceptually quite different operations.
Introduce ToplevelRuntime as a convenience alias.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Document the new plan for blocking interaction in the trait-level
docs for the Blocking trait (used to be SpawnBlocking).
Add cross-references (in some cases to not-yet-existing pieces).
* Rename: spawn_blocking to spawn_thread. We're going to distinguish
thread-creation (relatively expensive) from brief entry to sync code
(relatively cheap, but more restricted).
* Rename the SpawnBlocking trait to Blocking, and its ThreadHandle
to ThreadHandle. This trait is going to gain more functionality.
* Add the missing mention of `Blocking` to the docs for `Runtime`.
|
| |
|
|
|
|
|
|
|
|
| |
We're going to distinguish top-level runtime entry, from *re*-entry to
an existing executor. It is most convenient to rename this trait
first. Documentation of the distinction will come later.
(We're going to retain the function name `block_on`, but we want the trait
to be more obviously a top-level only thing, though, so we give it a
name that will hopefully avoid it peroulating throughout the codebase..)
|
| |
|
|
| |
Due to the limitations on RPIT, it's better to use a GAT for now.
|
| |
|
|
|
| |
This adds a new SpawnBlocking trait, which exposes the spawn_blocking
function that tokio, async-std, and other runtimes have.
|
| | |
|
| | |
|
| |
|
|
|
| |
It turns out that these types are generally useful, and that they
are in fact needed for tor-rtmock to compile without a PreferredRuntime.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(And similarly rename TcpListener to NetStreamListener,
along with their TcpStream/TcpListener associated types.)
These types are about to become generic over addresses,
and therefore shouldn't be named after TCP.
Renaming was done mostly with Rust Analyzer,
except for some macros that needed to be hand-edited.
(I'll revise the comments in the next commit;
this one is all about renaming.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Add a function to get the keying material as detailed by RFC 5705.
Because native-tls doesn't have such support, there is a place holder
panic!() for now.
This means that for the forseable future, relay would only work with
rustls until we figure out a solution for native-tls.
Closes #1432
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
* Change `pub` to `export`
* Change the `=` in define to `:`
* Change `pub_template_semver_check` to `template_export_semver_check`
Right now, 0.12.1 supports both syntaxes. I have verified this branch
also compiles with
https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/402
ee171ffaf56d7dcb7d75584054921153fe19b222
|
| |
|
|
| |
derive-deftly 0.10.x rejects unrecognised `#[deftly]` attributes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the combination of a number of separate commits, many of which
were generated by seddery, and then rebased and squashed.
Cargo.toml
perl -i~ -pe 's{^derive-adhoc}{derive-deftly = "0.10"}' crates/*/Cargo.toml
(not regenerated during rebase)
update Cargo.lock
`cargo fetch` without --locked
(regenerated during rebase)
seddery
git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{^use derive_adhoc}{use derive_deftly}'
git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bdefine_derive_adhoc\b}{define_derive_deftly}g'
git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bAdhoc\b}{Deftly}g if m{derive}'
git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[derive_adhoc\b}{#[derive_deftly}g'
git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{use derive_adhoc}{use derive_deftly}'
git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc\b}{derive_deftly_adhoc} if m{use.*deftly}'
git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc!}{derive_deftly_adhoc!}'
(not regenerated during rebase)
Manually add `#[derive_deftly_adhoc]` where needed.
seddery
git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[adhoc\b}{#[deftly}g'
git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc_template}{derive_deftly_template}'
(not regenerated during rebase)
Manually fix up an import
Manually update some builder attrs
Manually fix up tor_rtmock::time_core
This was missed in my seddery, due to me rebasing the branch and not
redoing the seddery.
|
| | |
|
| |
|
|
| |
We must also impl CoarseTimeProvider for mocked runtimes.
|
| | |
|
| | |
|
| |
|
|
| |
These are always the same and probably always will be.
|
| |
|
|
|
|
|
|
|
|
| |
Nothing in our tree actually *uses* the UDP in tests.
We want a mock UDP provider that isn't part of a real runtime, so that
we can make a totally-mock runtime for properly controlled testing.
It seems best to make this part of MockNetProvider rather than a
separate type.
|
| | |
|
| |
|
|
|
| |
This deduplicates some imports, which would otherwise be about to
become triplicated.
|
|
|
This deduplicates some trait delegation.
We want this now because we're about to introduce a third mock
runtime, so this would become triplication otherwise.
|