aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat/src/tokio.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.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* *: use std::io::Error::other in many placesNick Mathewson2025-05-151-2/+2
| | | | | | | The `IoError::other` function is an easier way to say `IoError::new(IoErrorKind::Other, ...)`. It's been around since 1.74, but clippy started warning about the more verbose version in 1.87.
* tor-rt*: Apply deferred formatting churnIan Jackson2025-03-041-1/+1
| | | | rustfmt.
* tor-rtcompat: Rename BlockOn to ToplevelBlockOnIan Jackson2025-03-041-1/+1
| | | | | | | | | | 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..)
* CI: run miri, currently on tor-rtcompatIan Jackson2024-09-261-1/+4
| | | | | | I'm about to add some unsafe which I want tested in CI. We must disable two tests.
* rtcompat: Add NetStreamProvider<Unix> to CompoundRuntimeNick Mathewson2024-09-241-3/+14
|
* tor-rtcompat: CompoundRuntime: Add a CoarseTimeProvider, and impl (fmt)Ian Jackson2024-03-251-2/+4
|
* tor-rtcompat: CompoundRuntime: Add a CoarseTimeProvider, and implIan Jackson2024-03-251-3/+7
| | | | | | In all the uses in-crate, this is just a RealCoarseTimeProvider. Now all the compound runtimes impl CoarseTimeProvider.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* add udp to runtimetrinity-1686a2022-03-141-6/+30
|
* tor-rtcompat: refactor PreferredRuntime, clean up docseta2022-02-251-0/+10
| | | | | | | | | | | | | | | `PreferredRuntime` is now an opaque wrapper struct that contains the "actual" preferred runtime as a type alias. The `current_user_runtime` and `create_runtime` functions become `PreferredRuntime::current` and `PreferredRuntime::create`, respectively. This removes the dependence on `impl Trait`, meaning we can now name the returned runtime (yay!). In addition, the documentation was cleaned up a bit to make it (hopefully) flow better. Items that don't make sense to publicize, like testing implementation details, have been marked #[doc(hidden)] and semver warnings added.
* tor-rtcompat: Provide TLS wrapping for all streamsIan Jackson2022-02-241-3/+2
| | | | | | | | Now all of the runtime types we provide all impl<S> TlsProvider<S> where S: ... rather than merely TlsProvider<Self::TcpStream>. And we document and intent to perhaps require this in the future.
* tor-rtcompat: Add some miscellaneous testsNick Mathewson2022-01-271-0/+50
| | | | | These probably aren't for things that will fail IRL, but it's nice to have coverage on the code, just in case.
* Apply @eta's suggestions from review on !263eta2022-01-271-1/+1
| | | Comment-only.
* Fix documentation references for tor-rtcompat refactoring.Nick Mathewson2022-01-261-4/+4
|
* Rename `SpawnBlocking` trait to `BlockOn`.Nick Mathewson2022-01-261-1/+1
| | | | | This avoids a future confusion with the new `SpawnBlocking` trait in async_executors v0.5, and better describes what the trait provides.
* Make test_with_all_runtimes cover _all_ the runtimes.Nick Mathewson2022-01-261-15/+28
| | | | | | | | | | | This took some refactoring, so that I wouldn't need to define 9 different versions of the function. It also required that we change the behavior of test_with_all_runtimes slightly, so that it asserts on _any_ failure rather than asserting on most but returning Err() for others. That in turn required changes to a few of its callers. There's probably a better way to do all of this macro business, but this is the best I could find.
* Make the native-tls crate optional.Nick Mathewson2022-01-261-1/+12
| | | | | | | | | | | This commit puts the native-tls crate behind a feature. The feature is off-by-default in the tor-rtcompat crate, but can be enabled either from arti or arti-client. There is an included script that I used to test that tor-rtcompat could build and run its tests with all subsets of its features. Closes #300
* Define aliases for "the best enabled runtime".Nick Mathewson2022-01-261-2/+13
| | | | | This helps us simplify our code in a few ways, and will help even more once native_tls is optional.
* Make current/create functions into runtime member functions.Nick Mathewson2022-01-261-62/+60
| | | | | This should help avoid some amount of temptation towards API proliferation.
* Rename FooRuntime to FooNativeTlsRuntime for consistency.Nick Mathewson2022-01-261-8/+8
|
* Unify TokioRuntime and TokioRuntimeHandleNick Mathewson2022-01-261-52/+24
| | | | | | | | | Having separate types here doesn't justify the (very limited) benefit of distinguishing between the case where we have created an executor that we own and the case where we have a handle to an already-running tokio executor. Part of #301.
* Refactor native_tls usage into its own moduleNick Mathewson2022-01-251-7/+7
| | | | | This change uses the async-native-tls crate for everything, and deletes some duplicated code.
* tor-rtcompat: Add support for rustls.Nick Mathewson2022-01-251-0/+75
| | | | | | | | | | | | | | | | | | | This is based on @janimo's approach in !74, but diverges in a few important ways. 1. It assumes that something like !251 will merge, so that we can have separate implementations for native_tls and rustls compiled at the same time. 2. It assumes that we can implement this for the futures::io traits only with no real penalty. 3. It uses the `x509-signature` crate to work around the pickiness of the `webpki` crate. If webpki eventually solves their [bug 219](https://github.com/briansmith/webpki/issues/219), we can remove a lot of that workaround. Closes #86.
* Refactor Runtimes to use separate TLS implementations internally.Nick Mathewson2022-01-191-9/+61
| | | | | This will make it easier to implement them using some other TLS provider as well, without having to duplicate all of our code.
* Improve the layout of crate exports; add runtime convenience functionseta2022-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | This commit addresses multiple problems highlighted by arti#182: - `arti-client` had some types in its public API that weren't accessible without importing another crate (`CfgPath`, `DataReader`, `DataWriter`). This has been fixed. - In addition, the doc comments for `DataReader` and `DataWriter` were cleaned up to be of better quality, now that they're public. - It was impossible to use `arti-client` without also importing `tor-rtcompat`. This is now fixed by the addition of two convenience methods: `TorClient::bootstrap_with_tokio` and `TorClient::bootstrap_with_async_std`. - Potentially controversially: `tor-rtcompat` now returns *concrete* types from methods like `current_runtime`, instead of `impl Runtime`. - This was needed in order to actually be able to name the `TorClient` type that results from using these methods. - This does mean we lose API flexibility, but on balance I think this is a good thing, because the API we *do* have is actually usable...
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+53
This will cause some pain for now, but now is really the best time to do this kind of thing.