1
1
//! `tor-linkspec`: Descriptions of Tor relays, as used to connect to them.
2
//!
3
//! # Overview
4
//!
5
//! The `tor-linkspec` crate provides traits and data structures that
6
//! describe how to connect to Tor relays.
7
//!
8
//! When describing the location of a Tor relay on the network, the
9
//! Tor protocol uses a set of "link specifiers", each of which
10
//! corresponds to a single aspect of the relay's location or
11
//! identity—such as its IP address and port, its Ed25519 identity
12
//! key, its (legacy) RSA identity fingerprint, or so on.  This
13
//! crate's [`LinkSpec`] type encodes these structures.
14
//!
15
//! When a client is building a circuit through the Tor network, it
16
//! needs to know certain information about the relays in that
17
//! circuit.  This crate's [`ChanTarget`] and [`CircTarget`] traits
18
//! represent objects that describe a relay on the network that a
19
//! client can use as the first hop, or as any hop, in a circuit.
20
//!
21
//! This crate is part of
22
//! [Arti](https://gitlab.torproject.org/tpo/core/arti/), a project to
23
//! implement [Tor](https://www.torproject.org/) in Rust.  Several
24
//! other crates in Arti depend on it.  You will probably not need
25
//! this crate yourself unless you are interacting with the Tor
26
//! protocol at a fairly low level.
27
//!
28
//! `tor-linkspec` is a separate crate so that it can be used by other
29
//! crates that expose link specifiers and by crates that consume
30
//! them.
31
//!
32
//! ## Future work
33
//!
34
//! TODO: Possibly we should rename this crate.  "Linkspec" is a
35
//! pretty esoteric term in the Tor protocols.
36
//!
37
//! TODO: Possibly the link specifiers and the `*Target` traits belong in different crates.
38

            
39
#![deny(missing_docs)]
40
#![warn(noop_method_call)]
41
#![deny(unreachable_pub)]
42
#![warn(clippy::all)]
43
#![deny(clippy::await_holding_lock)]
44
#![deny(clippy::cargo_common_metadata)]
45
#![deny(clippy::cast_lossless)]
46
#![deny(clippy::checked_conversions)]
47
#![warn(clippy::cognitive_complexity)]
48
#![deny(clippy::debug_assert_with_mut_call)]
49
#![deny(clippy::exhaustive_enums)]
50
#![deny(clippy::exhaustive_structs)]
51
#![deny(clippy::expl_impl_clone_on_copy)]
52
#![deny(clippy::fallible_impl_from)]
53
#![deny(clippy::implicit_clone)]
54
#![deny(clippy::large_stack_arrays)]
55
#![warn(clippy::manual_ok_or)]
56
#![deny(clippy::missing_docs_in_private_items)]
57
#![deny(clippy::missing_panics_doc)]
58
#![warn(clippy::needless_borrow)]
59
#![warn(clippy::needless_pass_by_value)]
60
#![warn(clippy::option_option)]
61
#![warn(clippy::rc_buffer)]
62
#![deny(clippy::ref_option_ref)]
63
#![warn(clippy::semicolon_if_nothing_returned)]
64
#![warn(clippy::trait_duplication_in_bounds)]
65
#![deny(clippy::unnecessary_wraps)]
66
#![warn(clippy::unseparated_literal_suffix)]
67
#![deny(clippy::unwrap_used)]
68

            
69
mod ls;
70
mod owned;
71
mod traits;
72

            
73
pub use ls::LinkSpec;
74
pub use owned::{OwnedChanTarget, OwnedCircTarget};
75
pub use traits::{ChanTarget, CircTarget};