summaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* 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.)
* rtcompat: Remove accept() from TcpListenerNick Mathewson2024-09-241-1/+1
| | | | | | | | | | It's redundant with the incoming() method (which turns the TcpListener into a Stream of connections), and nothing actually used it outside of tests. Removing this method allows us to simplify our TcpListener code a good deal, as can be seen by some of the implementations we removed from our example and testing code.
* rtcompat: Add definitions for unix::SocketAddr.Nick Mathewson2024-09-241-0/+1
|
* rtcompat: Add an extension trait for building modified RuntimesNick Mathewson2024-09-241-1/+1
| | | | | | | With this extension trait, we no longer need to construct `CompoundRuntime` directly outside of tor-rtcompat. This in turn will make it a little less painful when we have to add more generics to CompoundRuntime.
* Discourage use of `tor_rtmock_test_with_*` macrosIan Jackson2024-08-281-0/+16
| | | | New tests should usually use tor_rtmock::MockRuntime.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* tor-rtcompat: Rename coarsetime module to coarse_timeIan Jackson2024-03-251-2/+2
| | | | | Modules with the same name as external crates don't work well with our MSRV.
* tor-rtcompat: Provide coarsetime APIs and RealCoarseTimeProvider (fmt)Ian Jackson2024-03-251-3/+2
|
* tor-rtcompat: Provide coarsetime APIs and RealCoarseTimeProviderIan Jackson2024-03-251-0/+3
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Fix new "useless_vec" warning from clippy +nightlyIan Jackson2023-07-101-2/+2
| | | | | | | | | | | Explanation at https://rust-lang.github.io/rust-clippy/master/index.html#/useless_vec This is the non-tests subset of the same-named commmit in !1388, (recreated by hand by me, and then checked against that commit; I stole the commit message from Nick's.) This should be uncontroversial I think.