summaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat
Commit message (Collapse)AuthorAgeFilesLines
...
* general::SocketAddr: Add unit testsNick Mathewson2024-10-162-38/+70
|
* general::SocketAddr: Implement PartialEq.Nick Mathewson2024-10-161-0/+39
| | | | Needed for tests.
* general::SocketAddr: Specify and implement string representations.Nick Mathewson2024-10-161-1/+285
| | | | Closes #1681.
* tor-rtmock: dyn_time tests: rustfmtIan Jackson2024-10-081-3/+1
|
* tor-rtmock: dyn_time tests: Check DropCount on type-mismatch pathIan Jackson2024-10-081-1/+7
|
* tor-rtmock: dyn_time tests: Make try_downcast_string return S, not implIan Jackson2024-10-081-3/+3
| | | | | This will make it possible to use on a DropCounter and get a DropCounter back.
* tor-rtmock: dyn_time tests: Break out try_downcast_stringIan Jackson2024-10-081-8/+8
|
* tor-rtmock: dyn_time tests: Rename try_downcast_dc from chkIan Jackson2024-10-081-2/+2
| | | | This will be clearer
* Merge branch 'dyn-time' into 'main'Ian Jackson2024-10-019-3/+324
|\ | | | | | | | | Provide a type-erased SleepProvider + CoarseTimeProvider and use it for memquota queues See merge request tpo/core/arti!2460
| * tor-rtcompat: dyn_time: Combine test cases into module (fmt)Ian Jackson2024-10-011-27/+28
| |
| * tor-rtcompat: dyn_time: Combine test cases into moduleIan Jackson2024-10-011-7/+24
| |
| * tor-rtcompat: Test case demonstrating downcast_value doesn't dropIan Jackson2024-10-011-0/+25
| | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2460#note_3085583
| * tor-rtcompat: Comments about the implementation of downcast_valueIan Jackson2024-10-011-0/+18
| | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2460#note_3085582
| * tor-rtcompat: Comments about tradeoffs in special casing PreferredRuntimeIan Jackson2024-10-011-1/+14
| | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2460#note_3085581
| * tor-rtcompat: Introduce DynTimeProviderIan Jackson2024-09-263-0/+236
| | | | | | | | | | | | | | | | | | 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.
| * tor-memquota: mq_queue: Take Account by referenceIan Jackson2024-09-261-1/+3
| | | | | | | | | | | | It doesn't need an owned value here. (clippy's note about this was defeated by this being a trait method.)
| * CI: run miri, currently on tor-rtcompatIan Jackson2024-09-267-3/+12
| | | | | | | | | | | | I'm about to add some unsafe which I want tested in CI. We must disable two tests.
* | Merge branch 'unused' into 'main'David Goulet2024-10-011-0/+3
|\ \ | | | | | | | | | | | | Suppress some dead code warnings See merge request tpo/core/arti!2463
| * | 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
* | Remove semver.md files from 1.2.8Nick Mathewson2024-09-301-7/+0
| |
* | Bump arti- and tor- crates to 0.23.0Nick Mathewson2024-09-301-2/+2
|/ | | | | | | | | | | | | | Per our policy, every one of these gets a minor bump. Generated with: ``` for crate in $(./maint/list_crates | grep '^\(tor\|arti\)-' ); do cargo set-version --bump minor -p $crate; done ``` (Note the use of `-` at the end end of the grep pattern to prevent matching the `arti` crate.)
* Merge branch 'msrv-1.77-and-rusqlite-update' into 'main'David Goulet2024-09-261-1/+1
|\ | | | | | | | | Upgrade MSRV to 1.77 , and rusqlite to 0.32.1 See merge request tpo/core/arti!2451
| * Upgrade MSRV to 1.77Nick Mathewson2024-09-251-1/+1
| | | | | | | | This will allow us to upgrade to the latest version of rusqlite.
* | Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-252-4/+3
|/ | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* rtcompat: Finalize names for general::SocketAddr.Nick Mathewson2024-09-242-44/+52
|
* rtcompat: Expose FakeStream and friends; fix compilation in tor-rtmockNick Mathewson2024-09-243-10/+8
| | | | | It turns out that these types are generally useful, and that they are in fact needed for tor-rtmock to compile without a PreferredRuntime.
* rtcompat: Fix some rustdoc links.Nick Mathewson2024-09-244-6/+6
|
* rtcompat: remove async_trait from NetStreamListener.Nick Mathewson2024-09-245-5/+1
| | | | (The trait no longer has any async methods.)
* Make Runtime require NetStreamProvider<unix::SocketAddr>Nick Mathewson2024-09-245-8/+28
|
* rtcompat: initial implementation for "Abstract" addresses.Nick Mathewson2024-09-242-0/+147
| | | | | This is feature-complete, but will need tests. I'm holding off at this point so we can discuss naming on these types.
* rtcompat: Require Sync and 'static for NetStreamListener::IncomingNick Mathewson2024-09-243-2/+7
|
* rtcompat: Add NetStreamProvider<Unix> to CompoundRuntimeNick Mathewson2024-09-243-39/+106
|
* rtcompat: NetStreamProvider<unix::SocketAddr> for non-unix platformsNick Mathewson2024-09-244-0/+108
| | | | | | | Since there is no way to construct a unix::SocketAddr on these platforms, it's harmless to provide an implementation for NetStreamProvider. What's more, doing so greatly simplifies our AbstractAddr implementation.
* Implement NetStramProvider<Unix> for async_std.Nick Mathewson2024-09-241-0/+23
|
* async_std: Perpare macro for use with Unix streams.Nick Mathewson2024-09-242-33/+35
|
* async_std: start a macro to implement wrappers for stream typeNick Mathewson2024-09-241-71/+79
| | | | | As before, this commit does nothing interesting: it's a separate commit because it reindents a lot of code.
* rtcompat: Implement NetStreamProvider<Unix> for tokio.Nick Mathewson2024-09-241-4/+60
|
* tokio: Perpare macro for use with Unix streams.Nick Mathewson2024-09-241-24/+31
|
* tokio: start a macro to implement wrappers for stream typeNick Mathewson2024-09-241-67/+74
| | | | | This commit does nothing interesting yet: it's a separate commit because it reindents a lot of code.
* rtcompat: Add ADDR parameter to NetStream{Provider,Listener}Nick Mathewson2024-09-241-11/+11
| | | | | | | | | This change will let us make a NetStreamProvider that works for AF_UNIX addresses, and for "abstract" addresses. I've decided to let this parameter have a default value of `std::net::SocketAddr` for now. We can remove the default later if we decide it's confusing.
* Documentation updates for "NetStreamProvider" renameNick Mathewson2024-09-243-21/+23
| | | | | | Stop referring to TCP streams in its documentation; update other documentation to refer to NetStreamProvider rather than TcpProvider.
* rtcompat: Rename TcpProvider to NetStreamProvider.Nick Mathewson2024-09-247-41/+41
| | | | | | | | | | | | | | (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-245-11/+3
| | | | | | | | | | 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-243-0/+97
|
* rtcompat: reformat Cargo.tomlNick Mathewson2024-09-241-1/+5
|
* rtcompat: Add an extension trait for building modified RuntimesNick Mathewson2024-09-242-1/+68
| | | | | | | 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.
* Bump MSRV from 1.70 to 1.75.Wesley Aptekar-Cassels2024-09-161-1/+1
|
* Bump all the unstable tor- and arti- crates to 0.22.0.Gabriela Moldovan2024-09-031-2/+2
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.22.0 done ```
* Discourage use of `tor_rtmock_test_with_*` macrosIan Jackson2024-08-281-0/+16
| | | | New tests should usually use tor_rtmock::MockRuntime.
* Don't need to tell docs.rs to enable `docsrs` cfgKunal Mehta2024-08-021-1/+0
| | | | | It now does it automatically, see <https://docs.rs/about/builds#detecting-docsrs>.