8 releases (breaking)

0.24.0 Oct 31, 2024
0.23.0 Sep 30, 2024
0.22.0 Sep 3, 2024
0.21.0 Aug 1, 2024
0.17.0 Apr 2, 2024

#2037 in Network programming

Download history 1112/week @ 2024-08-03 921/week @ 2024-08-10 749/week @ 2024-08-17 1132/week @ 2024-08-24 1539/week @ 2024-08-31 1006/week @ 2024-09-07 889/week @ 2024-09-14 1037/week @ 2024-09-21 1243/week @ 2024-09-28 791/week @ 2024-10-05 817/week @ 2024-10-12 1037/week @ 2024-10-19 1150/week @ 2024-10-26 2112/week @ 2024-11-02 1169/week @ 2024-11-09 2130/week @ 2024-11-16

6,708 downloads per month
Used in 32 crates (5 directly)

MIT/Apache and maybe LGPL-3.0-only

1.5MB
21K SLoC

tor-relay-selection

Logic to select Tor relays for specific purposes

Overview

The tor-relay-selection crate provides higher-level functions in order to select Tor relays for specific purposes, or check whether they are suitable for those purposes. It wraps lower-level functionality from tor-netdir.

This crate is part of Arti, a project to implement Tor in Rust.

Design

Our main types are RelayUsage, RelayExclusion, RelayRestriction, and RelaySelector.

A RelayUsage answers the question "what is this relay for?"

A RelayExclusion excludes one or more relays as having already been selected, or as sharing families with already-selected relays.

A RelayRestriction imposes additional restrictions on a relay.

A RelaySelector is a collection of a usage, an exclusion, and any number of restrictions.

In a RelaySelector, usages and restrictions can be strict or flexible. If we fail to pick a relay, and there are any flexible usages/restrictions, then we remove those usages/restrictions to produce a relaxed selector and we try again.

License: MIT OR Apache-2.0

Dependencies

~21–32MB
~488K SLoC