Struct tor_netdoc::doc::routerdesc::RouterDesc
source · #[non_exhaustive]pub struct RouterDesc {Show 19 fields
pub nickname: Nickname,
pub ipv4addr: Option<Ipv4Addr>,
pub orport: u16,
pub ipv6addr: Option<(Ipv6Addr, u16)>,
pub dirport: u16,
pub uptime: Option<u64>,
pub published: SystemTime,
pub identity_cert: Ed25519Cert,
pub rsa_identity_key: PublicKey,
pub rsa_identity: RsaIdentity,
pub ntor_onion_key: PublicKey,
pub tap_onion_key: PublicKey,
pub proto: Arc<Protocols>,
pub is_dircache: bool,
pub is_extrainfo_cache: bool,
pub family: Arc<RelayFamily>,
pub platform: Option<RelayPlatform>,
pub ipv4_policy: AddrPolicy,
pub ipv6_policy: Arc<PortPolicy>,
}routerdesc only.Expand description
Information about a relay, parsed from a router descriptor.
This type does not hold all the information in the router descriptor
Limitations
See module documentation.
Additionally, some fields that from router descriptors are not yet parsed: see the comments in ROUTER_BODY_RULES for information about those.
Before using this type to connect to a relay, you MUST check that it is valid, using is_expired_at().
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.nickname: Nicknamedangerous-expose-struct-fields only.Human-readable nickname for this relay.
This is not secure, and not guaranteed to be unique.
ipv4addr: Option<Ipv4Addr>dangerous-expose-struct-fields only.IPv4 address for this relay.
orport: u16dangerous-expose-struct-fields only.IPv4 ORPort for this relay.
ipv6addr: Option<(Ipv6Addr, u16)>dangerous-expose-struct-fields only.IPv6 address and port for this relay.
dirport: u16dangerous-expose-struct-fields only.Directory port for contacting this relay for direct HTTP directory downloads.
uptime: Option<u64>dangerous-expose-struct-fields only.Declared uptime for this relay, in seconds.
published: SystemTimedangerous-expose-struct-fields only.Time when this router descriptor was published.
identity_cert: Ed25519Certdangerous-expose-struct-fields only.Ed25519 identity certificate (identity key authenticating a signing key)
rsa_identity_key: PublicKeydangerous-expose-struct-fields only.RSA identity key for this relay. (Deprecated; never use this without the ed25519 identity as well).
rsa_identity: RsaIdentitydangerous-expose-struct-fields only.RSA identity key for this relay. (Deprecated; never use this without the ed25519 identity as well).
ntor_onion_key: PublicKeydangerous-expose-struct-fields only.Key for extending a circuit to this relay using the ntor protocol.
tap_onion_key: PublicKeydangerous-expose-struct-fields only.Key for extending a circuit to this relay using the (deprecated) TAP protocol.
proto: Arc<Protocols>dangerous-expose-struct-fields only.List of subprotocol versions supported by this relay.
is_dircache: booldangerous-expose-struct-fields only.True if this relay says it’s a directory cache.
is_extrainfo_cache: booldangerous-expose-struct-fields only.True if this relay says that it caches extrainfo documents.
family: Arc<RelayFamily>dangerous-expose-struct-fields only.Declared family members for this relay. If two relays are in the same family, they shouldn’t be used in the same circuit.
platform: Option<RelayPlatform>dangerous-expose-struct-fields only.Software and version that this relay says it’s running.
ipv4_policy: AddrPolicydangerous-expose-struct-fields only.A complete address-level policy for which IPv4 addresses this relay says it supports.
ipv6_policy: Arc<PortPolicy>dangerous-expose-struct-fields only.A summary of which ports this relay is willing to connect to on IPv6.
Implementations§
source§impl RouterDesc
impl RouterDesc
sourcepub fn rsa_identity(&self) -> &RsaIdentity
pub fn rsa_identity(&self) -> &RsaIdentity
Return a reference to this relay’s RSA identity.
sourcepub fn ed_identity(&self) -> &Ed25519Identity
pub fn ed_identity(&self) -> &Ed25519Identity
Return a reference to this relay’s Ed25519 identity.
sourcepub fn protocols(&self) -> &Protocols
pub fn protocols(&self) -> &Protocols
Return a reference to the list of subprotocol versions supported by this relay.
sourcepub fn ntor_onion_key(&self) -> &PublicKey
pub fn ntor_onion_key(&self) -> &PublicKey
Return a reference to this relay’s Ntor onion key.
sourcepub fn published(&self) -> SystemTime
pub fn published(&self) -> SystemTime
Return the publication
sourcepub fn or_ports(&self) -> impl Iterator<Item = SocketAddr> + '_
pub fn or_ports(&self) -> impl Iterator<Item = SocketAddr> + '_
Return an iterator of every SocketAddr at which this descriptor says
its relay can be reached.
sourcepub fn parse(s: &str) -> Result<UncheckedRouterDesc>
pub fn parse(s: &str) -> Result<UncheckedRouterDesc>
Try to parse s as a router descriptor.
Does not actually check liveness or signatures; you need to do that yourself before you can do the output.
Trait Implementations§
source§impl Clone for RouterDesc
impl Clone for RouterDesc
source§fn clone(&self) -> RouterDesc
fn clone(&self) -> RouterDesc
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more