summaryrefslogtreecommitdiff
path: root/crates/tor-linkspec/src/traits.rs
Commit message (Collapse)AuthorAgeFilesLines
* linkspec: Rename all_addrs_allowed_for_extend()David Goulet2026-04-091-2/+2
| | | | | | Also set a better error message when validating channel target. Signed-off-by: David Goulet <[email protected]>
* linkspec: Rename has_all_public_addresses()David Goulet2026-03-301-2/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* linkspec: Rename has_all_reachable_addresses()David Goulet2026-03-301-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* linkspec: Rename has_all_valid_port() to has_all_nonzero_port()David Goulet2026-03-301-2/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* linkspec: Move has_all_valid_port() and has_all_reachable_addresses() into ↵David Goulet2026-03-301-1/+37
| | | | | | ChanTarget Signed-off-by: David Goulet <[email protected]>
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-061-5/+6
| | | | | | | | This will let us model the actual structure of routerstatus entries in netdocs more closely. They don't have the addresses in a single list. When this code was written this would have been much more awkward, but now we have RPITIT.
* tor-linkspec: impl `HasAddrs` for `&T`Steven Engler2024-09-231-0/+7
| | | | | This makes the `HasAddrs` trait nicer to use when most things that have addresses are passed by reference anyways.
* tor-linkspec: Suppress clippy false positive (link ticket)Ian Jackson2024-04-031-1/+1
|
* tor-linkspec: Suppress clippy false positiveIan Jackson2024-04-031-0/+1
|
* tor-netdir: Abolish Relay::has_same_relay_idsIan Jackson2024-04-031-1/+0
| | | | This was an open-coded specialisation. Remove the one call site.
* tor-linkspec: Use derive-deftly rather than strum for same_relay_idsIan Jackson2024-04-031-1/+38
|
* tor-linkspec: Use RelayIdType::all_types rather than ::iterIan Jackson2024-04-031-2/+2
| | | | | This will make it slightly easier to find these call sites if we want to change them in the future.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* tor-linkspec: Provide HasRelayIds::has_any_relay_id_from (fmt)Ian Jackson2023-08-291-3/+3
| | | | Worsify formatting as demanded by rustfmt.
* tor-linkspec: Provide HasRelayIds::has_any_relay_id_fromIan Jackson2023-08-291-0/+67
| | | | | This seems logically necessary, and I want to use it in intro point selection.
* 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
|
* linkspec: cleanup usage; change std::fmt to fmt.Nick Mathewson2023-06-121-6/+6
|
* linkspec: Implement HasRelayIds::display_relay_ids().Nick Mathewson2023-06-091-6/+49
|
* Change CircTarget::linkspecs() to return an encoded list.Nick Mathewson2023-05-101-4/+10
| | | | | | | | If we didn't do this, we would need to transfrom `EncodedLinkSpec`s into a `LinkSpec::Unrecognized`, which is not semantically right. What's more, every user of this API wants to consume encoded link specifiers, so encoding them early saves a little effort.
* test_linkspecs: tidy order of linkspecsNick Mathewson2023-05-101-11/+11
| | | | This is pure code movement.
* Move responsibility for linkspec sorting to CircTarget.Nick Mathewson2023-05-101-2/+13
| | | | | | This change is necessary so that we can build Extend2 messages that have their LinkSpecs appear in a verbatim order as provided in an INTRODUCE2 message or in a HS descriptor.
* 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.
* Merge branch 'ya-lint' into 'main'eta2023-01-061-1/+4
|\ | | | | | | | | tor-linkspec: Fix an unused lint See merge request tpo/core/arti!935
| * tor-linkspec: Fix an unused lintIan Jackson2022-12-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise: cargo +stable clippy -p tor-proto --all-features --all-targets Produces: warning: unused import: `PtTargetAddr` --> crates/tor-linkspec/src/traits.rs:9:28 | 9 | use crate::{ChannelMethod, PtTargetAddr, RelayIdRef, RelayIdType, RelayIdTypeIter}; | ^^^^^^^^^^^^
* | 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.
* Separate BridgeAddr and PtTargetAddrIan Jackson2022-11-301-2/+2
| | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/issues/668#note_2858220 This commit is difficult to split up. The innards of BridgeAddr and PtTargetAddr are still a bit entangled.
* Merge branch 'more-linkspec-tests' into 'main'Nick Mathewson2022-11-291-0/+7
|\ | | | | | | | | Add tests for a bunch of code in tor-linkspec See merge request tpo/core/arti!867
| * linkspec: Add tests for has_any_identity.Nick Mathewson2022-11-281-0/+7
| |
* | Remove deprecated aliases in tor-linkspec.Nick Mathewson2022-11-291-2/+2
| |
* | linkspec: Give a Redacted form for chantarget.Nick Mathewson2022-11-281-6/+28
|/
* TransportId: Fix test case for no pt-targetIan Jackson2022-11-221-16/+19
| | | | | | | | | | | Fixes cargo +stable clippy --manifest-path=/home/ian/Rustup/Arti/arti/Cargo.toml --locked --target-dir=target --offline -p tor-linkspec --no-default-features --all-targets giving 446 | .method(ChannelMethod::Pluggable(PtTarget::new( | ^^^^^^^^^ variant or associated item not found in `transport::ChannelMethod`
* Fix a missing import in tests.Nick Mathewson2022-11-181-1/+1
| | | | I'm not sure why the CI didn't reject this the first time around.
* Merge branch 'refactor_into_ownedchantarget' into 'main'Nick Mathewson2022-11-181-7/+1
|\ | | | | | | | | CircMgr: Refactor DirSpecificTarget constructor See merge request tpo/core/arti!866
| * CircMgr: Refactor DirSpecificTarget constructorNick Mathewson2022-11-181-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | This commit replaces the `impl From<&T> for OwnedChanTarget where T:ChanTarget` with a new `IntoOwnedChanTarget` trait. This lets us be explicit that we're constructing an owned object, and not just converting something. No semver change needed, since these APIs haven't been released. ----------- (new description)
* | ChanTarget: Add a display function, with better output.Nick Mathewson2022-11-171-2/+79
|/ | | | | | | | | | This change lets us display a ChanTarget's members without first cloning them into an OwnedChanTarget. It also resolves a reliability issue by outputting better info when talking about connections via pluggable transports. Closes #647
* linkspec: Rename "maybe rename this?" TODOs in favor of #623Nick Mathewson2022-11-071-3/+0
|
* Downgrade TODO on chan_methodNick Mathewson2022-11-071-1/+1
| | | | | This is not something we need to solve for 1.1.0 (and it might not need to be solved ever).
* linkspec: add HasRelayIds::has_any_identity.Nick Mathewson2022-10-251-1/+6
|
* linkspec: specify sort order for HasRelayIds.Nick Mathewson2022-10-241-2/+13
|
* linkspec: Add compare-by-relay-ids function to HasRelayIdsNick Mathewson2022-10-211-1/+68
|
* Merge branch 'bridge-internal-apis' into 'main'Ian Jackson2022-10-201-1/+7
|\ | | | | | | | | Use BridgeConfig to identify bridges in two places See merge request tpo/core/arti!781
| * tor-linkspec: impl From<&ChanTarget> for OwnedChanTargetIan Jackson2022-10-201-1/+7
| | | | | | | | | | | | This lets us write functions which can either take an existing owned OwnedChanTarget, or copy out of some other kind of ChanTarget passed by reference.
* | HasAddrs: Make it clear that the set of addresses can be emptyIan Jackson2022-10-201-1/+4
|/ | | | Eg, a PT bridge may not have an address.
* Fix some rustdoc errors.Nick Mathewson2022-10-131-1/+1
| | | | | | In addition to the usual "You named that method wrong!" errors, we have a new rustdoc error that complains about bogus "HTML tags" that are actually unquoted usage of types like `Result<Foo>`.
* Fix a warning that I reintroduced.Nick Mathewson2022-10-111-0/+1
| | | | | It looks like this got fixed, but my branch for !759 reintroduced it by refactoring.
* Change multiplicity of ChannelMethod and addressesNick Mathewson2022-10-111-17/+11
| | | | | | | Now each `ChanTarget` has at most one `ChannelMethod`, and only `Direct` `ChannelMethods` can have multiple addresses. Closes #600.
* Allow two useless pattern matches that are going to be not uselessIan Jackson2022-10-111-0/+1
|