#[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>,
}
Available on crate feature 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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§nickname: Nickname
Available on crate feature dangerous-expose-struct-fields only.

Human-readable nickname for this relay.

This is not secure, and not guaranteed to be unique.

§ipv4addr: Option<Ipv4Addr>
Available on crate feature dangerous-expose-struct-fields only.

IPv4 address for this relay.

§orport: u16
Available on crate feature dangerous-expose-struct-fields only.

IPv4 ORPort for this relay.

§ipv6addr: Option<(Ipv6Addr, u16)>
Available on crate feature dangerous-expose-struct-fields only.

IPv6 address and port for this relay.

§dirport: u16
Available on crate feature dangerous-expose-struct-fields only.

Directory port for contacting this relay for direct HTTP directory downloads.

§uptime: Option<u64>
Available on crate feature dangerous-expose-struct-fields only.

Declared uptime for this relay, in seconds.

§published: SystemTime
Available on crate feature dangerous-expose-struct-fields only.

Time when this router descriptor was published.

§identity_cert: Ed25519Cert
Available on crate feature dangerous-expose-struct-fields only.

Ed25519 identity certificate (identity key authenticating a signing key)

§rsa_identity_key: PublicKey
Available on crate feature dangerous-expose-struct-fields only.

RSA identity key for this relay. (Deprecated; never use this without the ed25519 identity as well).

§rsa_identity: RsaIdentity
Available on crate feature dangerous-expose-struct-fields only.

RSA identity key for this relay. (Deprecated; never use this without the ed25519 identity as well).

§ntor_onion_key: PublicKey
Available on crate feature dangerous-expose-struct-fields only.

Key for extending a circuit to this relay using the ntor protocol.

§tap_onion_key: PublicKey
Available on crate feature dangerous-expose-struct-fields only.

Key for extending a circuit to this relay using the (deprecated) TAP protocol.

§proto: Arc<Protocols>
Available on crate feature dangerous-expose-struct-fields only.

List of subprotocol versions supported by this relay.

§is_dircache: bool
Available on crate feature dangerous-expose-struct-fields only.

True if this relay says it’s a directory cache.

§is_extrainfo_cache: bool
Available on crate feature dangerous-expose-struct-fields only.

True if this relay says that it caches extrainfo documents.

§family: Arc<RelayFamily>
Available on crate feature 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>
Available on crate feature dangerous-expose-struct-fields only.

Software and version that this relay says it’s running.

§ipv4_policy: AddrPolicy
Available on crate feature dangerous-expose-struct-fields only.

A complete address-level policy for which IPv4 addresses this relay says it supports.

§ipv6_policy: Arc<PortPolicy>
Available on crate feature dangerous-expose-struct-fields only.

A summary of which ports this relay is willing to connect to on IPv6.

Implementations§

Return a reference to this relay’s RSA identity.

Return a reference to this relay’s Ed25519 identity.

Return a reference to the list of subprotocol versions supported by this relay.

Return a reference to this relay’s Ntor onion key.

Return the publication

Return an iterator of every SocketAddr at which this descriptor says its relay can be reached.

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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.