aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'remove-lint' into 'main'Jim Newsome2026-07-151-1/+1
|\ | | | | | | | | | | | | Removed unnecessary lint Closes #2556 See merge request tpo/core/arti!4210
| * add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
| |
| * Removed unnecessary lintpryty262026-07-151-1/+1
| | | | | | | | Removed unnecessary lint
* | multiple crates: Fix clippy warningshjrgrn2026-07-101-2/+2
|/
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+2
| | | | | | | | | | | | 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.
* tor-rtcompat+misc: add `NetStreamProvider::ConnectOptions`Steven Engler2026-06-081-5/+9
| | | | | | | | | This adds the trait type `ConnectOptions` to `NetStreamProvider` and adds this `ConnectOptions` as an argument to `NetStreamProvider::connect()`. You probably want to look at the changes in tor-rtcompat first, then the rest of this commit is updating the various places we use `NetStreamProvider`.
* tor-rtcompat: add structs to hold connect() optionsSteven Engler2026-06-081-1/+4
| | | | | For now this just sets up the structure. We'll add options for TCP later.
* tor-rtcompat+misc: add `NetStreamProvider::ListenOptions`Steven Engler2026-05-071-3/+7
| | | | | | | | | This adds the trait type `ListenOptions` to `NetStreamProvider` and adds this `ListenOptions` as an argument to `NetStreamProvider::listen()`. You probably want to look at the changes in tor-rtcompat first, then the rest of this commit is updating the various places we use `NetStreamProvider`.
* tor-rtcompat: add structs to hold listen() optionsSteven Engler2026-05-071-0/+2
| | | | | For now this just sets up the structure. We'll add options for TCP later.
* rtcompat, rtmock: Port to web-time-compat.Nick Mathewson2026-03-261-6/+6
|
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* rtcompat: Return certificates as Cow.Nick Mathewson2026-02-021-4/+4
|
* rtcompat: Improved tls-server key/cert handling.Nick Mathewson2026-02-021-9/+4
| | | | | Now that we can admit to knowing about tor-cert-x509, we can use TlsCertAndKeys to simplify everything.
* rtcompat: restore tls-server test.Nick Mathewson2026-02-021-7/+3
| | | | | | | Now that tor-cert-x509 is its own crate, we can use that, and avoid the circular dependency. Closes #2330.
* rtcompat: Temporarily disable tls-server test.Nick Mathewson2026-01-291-3/+5
| | | | | | It would introduce a circular dev-dependency, which is not well-supported by cargo publish. I hope to resolve this and re-enable the test in #2330.
* rustls: Improve test output; use standard warnings.Nick Mathewson2026-01-291-4/+16
|
* rtcompat: Unit test for TLS server code.Nick Mathewson2026-01-291-2/+76
|
* rustls: add an error for unimplemented tls server support.Nick Mathewson2026-01-291-1/+3
|
* rtcompat: Implement TLS server support for rustls.Nick Mathewson2026-01-291-0/+6
| | | | Closes #2316.
* rtcompat: new server-related members on TlsProvider trait.Nick Mathewson2026-01-291-1/+2
| | | | | These are as yet unimplemented; there's a stub type for the providers (nativetls) that won't actually have them.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* tor-rtcompat: add our own `SpawnExt` traitSteven Engler2025-11-041-1/+1
| | | | This new trait is compatible with tokio-console.
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* smol: Implement smol in tor-rtcompatNiel Duysters2025-08-211-7/+44
|
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-3/+1
| | | | | | | | | | | | | | 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.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* tor-rtcompat: xref to fork policy from PreferredRuntimeIan Jackson2025-04-071-0/+11
|
* tor-rt*: Apply deferred formatting churnIan Jackson2025-03-041-3/+3
| | | | rustfmt.
* tor-rtcompat: Remove ToplevelBlockon from RuntimeIan Jackson2025-03-041-9/+9
| | | | | | | | 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.
* tor-rtcompat: Provide a new function for executor re-entryIan Jackson2025-03-041-1/+1
| | | | | | | | | | | | | | | 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.
* tor-rtcompat: New plan for blocking interaction, Blocking traitIan Jackson2025-03-041-1/+1
| | | | | | | | | | | | | | | * 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`.
* 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..)
* tor-rtcompat: Rename UnsupportedStreamOps to NoOpStreamOpsHandle (fmt).Gabriela Moldovan2025-01-151-3/+3
|
* tor-rtcompat: Rename UnsupportedStreamOps to NoOpStreamOpsHandle.Gabriela Moldovan2025-01-151-1/+1
| | | | | This renames UnsupportedStreamOpsHandle to NoOpStreamOpsHandle for clarity (the old name kind of sounded like the name of an error type).
* tor-rtcompat: Implement new_handle() using TcpSockFd.Gabriela Moldovan2025-01-151-1/+1
|
* tor-rtcompat: Add spawn_blocking to Runtime trait.Wesley Aptekar-Cassels2025-01-071-1/+2
| | | | | This adds a new SpawnBlocking trait, which exposes the spawn_blocking function that tokio, async-std, and other runtimes have.
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* tor-rtcompat: Add an error type for unsupported StreamOps.Gabriela Moldovan2024-12-101-1/+1
|
* tor-rtcompat: Add a StreamOps trait.Gabriela Moldovan2024-12-101-1/+1
| | | | | | | | This trait will provide additional operations on `Stream`s. For now, the only supported operation is `set_tcp_notsent_lowat` (needed for #1728). Part of #1769
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* Merge branch 'dyn-time' into 'main'Ian Jackson2024-10-011-1/+4
|\ | | | | | | | | Provide a type-erased SleepProvider + CoarseTimeProvider and use it for memquota queues See merge request tpo/core/arti!2460
| * tor-rtcompat: Introduce DynTimeProviderIan Jackson2024-09-261-0/+2
| | | | | | | | | | | | | | | | | | This will replace the internal ad-hoc DynCoarseTimeProvider in tor-memquota. We need this to be public because it's going to be shared by many of our protocol elements (eg ClientCirc, Channel, etc.) as they need to use it for their mq queues.
| * CI: run miri, currently on tor-rtcompatIan Jackson2024-09-261-1/+2
| | | | | | | | | | | | I'm about to add some unsafe which I want tested in CI. We must disable two tests.
* | tor-rtcompat: Suppress a dead code warningIan Jackson2024-09-301-0/+3
|/ | | | | | | | | | | | | | | Fixes cargo check --all-features -p tor-async-utils --all-targets which otherwise prints warning: function `new_unnamed_socketaddr` is never used --> crates/tor-rtcompat/src/unix.rs:14:15 | 14 | pub(crate) fn new_unnamed_socketaddr() -> std::io::Result<SocketAddr> { | ^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
* rtcompat: Finalize names for general::SocketAddr.Nick Mathewson2024-09-241-1/+1
|
* rtcompat: Expose FakeStream and friends; fix compilation in tor-rtmockNick Mathewson2024-09-241-0/+1
| | | | | It turns out that these types are generally useful, and that they are in fact needed for tor-rtmock to compile without a PreferredRuntime.
* Make Runtime require NetStreamProvider<unix::SocketAddr>Nick Mathewson2024-09-241-2/+5
|
* rtcompat: initial implementation for "Abstract" addresses.Nick Mathewson2024-09-241-0/+1
| | | | | This is feature-complete, but will need tests. I'm holding off at this point so we can discuss naming on these types.
* rtcompat: Rename TcpProvider to NetStreamProvider.Nick Mathewson2024-09-241-2/+2
| | | | | | | | | | | | | | (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.)