aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat/src/general.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-rtcompat: replace `_options` with `()`Steven Engler2026-06-081-2/+2
| | | | | This hopefully better shows that there's nothing to use here for general socket types.
* tor-rtcompat+misc: add `NetStreamProvider::ConnectOptions`Steven Engler2026-06-081-3/+16
| | | | | | | | | 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+misc: add `NetStreamProvider::ListenOptions`Steven Engler2026-05-071-5/+16
| | | | | | | | | 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`.
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-0/+2
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+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.
* tor-rtcompat: Add the ability to get a StreamOps handle.Gabriela Moldovan2025-01-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Needed for cases where we wrap an object that implements `StreamOps` in an external type, thereby losing access to the `StreamOps` functionality. For example, during the channel handshake, we `.split()` the stream that implements `StreamOps`, which leaves us with a `SplitSink` and a `SplitStream`, neither of which implement `StreamOps`. Getting a handle to the underlying object that implements `StreamOps` (for example, a file handle) *before* the stream is `.split()` enables us to use `StreamOps` to manipulate the underlying split stream. This commit also introduces a special `UnsupportedStreamOpsHandle`, which is a type that implements `StreamOps`, but always returns an error. This type is meant to simplify error handling and usage, and is meant to be used in cases where `StreamOps` is not supported. TODO: the name of this type is pretty confusing (it's very similar to `UnsupportedStreamOp`, which is an error type), and should probably be renamed to something else (`NoOpStreamOpsHandle`, `BrokenStreamOpsHandle`, `DummyStreamOpsHandle` come to mind...). Note: this changes the `StreamOps` trait to be slightly different from what I originally envisioned in !2660 and #1769
* rtcompat: re-export items from tor_general_addr::generalNick Mathewson2024-12-191-0/+2
|
* tor-rtcompat: Require NetStream{Listener,Provider} streams to impl StreamOps.Gabriela Moldovan2024-12-101-5/+3
| | | | Part of #1769
* tor-rtcompat: Implement StreamOps for all the stream types.Gabriela Moldovan2024-12-101-1/+9
| | | | Part of #1769
* Remove re-export of "general::*" from tor-rtcompat.Nick Mathewson2024-10-291-17/+15
|
* Remove re-export of "unix" from tor_rtcompat.Nick Mathewson2024-10-291-2/+2
|
* Extract general::SocketAddr and its unix friends to their own crate.Nick Mathewson2024-10-291-477/+21
| | | | This is mostly code motion.
* general::SocketAddr: Say "inet" rather than "tcp"Nick Mathewson2024-10-171-35/+35
| | | | | | | | | | "inet" makes more sense, since in principle these can also be used for udp, etc. Also making a corresponding change in rpc-connect-sketch.md, which uses this format. Closes #1701.
* rtcompat: Fix android compilation in `general`Nick Mathewson2024-10-171-1/+3
| | | | | | | | Previously I had assumed that `std::os::linux` also existed on android, based on the documentation of `std::os::linux::net::SocketAddrExt`. That is not, however, true. This should fix the `check-targets` CI job.
* rtcompat: Add a fuzzer for round-trip general::SocketAddr parsing.Nick Mathewson2024-10-161-0/+48
| | | | (This turned up another place where we need documentation.)
* general::SocketAddr: Format the unnamed address as "unix:"Nick Mathewson2024-10-161-5/+12
| | | | | This matches our parsing, and our general rule that our parser defers to SocketAddr::from_pathname.
* Add reverse-enginered description of Rust socketaddr formats.Nick Mathewson2024-10-161-0/+32
|
* general::SocketAddr: Add unit testsNick Mathewson2024-10-161-38/+69
|
* 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.
* rtcompat: Finalize names for general::SocketAddr.Nick Mathewson2024-09-241-0/+153