tor_netdoc/doc/netstatus/rs/
each_variety.rs

1//! router status entries - items for all varieties, that vary
2//!
3//! **This file is reincluded multiple times**,
4//! by the macros in [`crate::doc::ns_variety_definition_macros`],
5//! once for votes, and once for each consensus flavour.
6//! It is *not* a module `crate::doc::netstatus::rs::each_variety`.
7//!
8//! Each time this file is included by one of the macros mentioned above,
9//! the `ns_***` macros (such as `ns_const_name!`) may expand to different values.
10//!
11//! See [`crate::doc::ns_variety_definition_macros`].
12
13use super::*;
14
15/// A single relay's status, in a network status document.
16#[derive(Debug, Clone)]
17#[non_exhaustive]
18pub struct RouterStatus {
19    /// The nickname for this relay.
20    ///
21    /// Nicknames can be used for convenience purpose, but no more:
22    /// there is no mechanism to enforce their uniqueness.
23    pub nickname: Nickname,
24    /// Fingerprint of the old-style RSA identity for this relay.
25    pub identity: RsaIdentity,
26    /// A list of address:port values where this relay can be reached.
27    pub addrs: Vec<net::SocketAddr>,
28    /// Digest of the document for this relay.
29    pub doc_digest: DocDigest,
30    /// Flags applied by the authorities to this relay.
31    pub flags: RelayFlags,
32    /// Version of the software that this relay is running.
33    pub version: Option<Version>,
34    /// List of subprotocol versions supported by this relay.
35    pub protos: Arc<Protocols>,
36    /// Information about how to weight this relay when choosing a
37    /// relay at random.
38    pub weight: RelayWeight,
39}