Struct tor_netdir::Relay

source ·
pub struct Relay<'a> { /* private fields */ }
Expand description

A view of a relay on the Tor network, suitable for building circuits.

Implementations§

Return the Ed25519 ID for this relay.

Return the RsaIdentity for this relay.

Return true if this relay and other seem to be the same relay.

(Two relays are the same if they have the same identity.)

Return true if this relay allows exiting to port on IPv4.

Return true if this relay allows exiting to port on IPv6.

Return true if this relay is suitable for use as a directory cache.

Return true if this relay is marked as usable as a new Guard node.

Return true if both relays are in the same subnet, as configured by subnet_config.

Two relays are considered to be in the same subnet if they have IPv4 addresses with the same subnets_family_v4-bit prefix, or if they have IPv6 addresses with the same subnets_family_v6-bit prefix.

Return true if both relays are in the same family.

(Every relay is considered to be in the same family as itself.)

Return true if there are any ports for which this Relay can be used for exit traffic.

(Returns false if this relay doesn’t allow exit traffic, or if it has been flagged as a bad exit.)

Return the IPv4 exit policy for this relay. If the relay has been marked BadExit, return an empty policy

Return the IPv6 exit policy for this relay. If the relay has been marked BadExit, return an empty policy

Return the IPv4 exit policy declared by this relay. Contrary to Relay::ipv4_policy, this does not verify if the relay is marked BadExit.

Return the IPv6 exit policy declared by this relay. Contrary to Relay::ipv6_policy, this does not verify if the relay is marked BadExit.

Available on crate feature experimental-api only.

Return a reference to this relay’s “router status” entry in the consensus.

The router status entry contains information about the relay that the authorities voted on directly. For most use cases, you shouldn’t need them.

This function is only available if the crate was built with its experimental-api feature.

Available on crate feature experimental-api only.

Return a reference to this relay’s “microdescriptor” entry in the consensus.

A “microdescriptor” is a synopsis of the information about a relay, used to determine its capabilities and route traffic through it. For most use cases, you shouldn’t need it.

This function is only available if the crate was built with its experimental-api feature.

Trait Implementations§

Return a reference to this object suitable for formatting its ChanTarget-specific members. Read more
Return the ntor onion key for this relay
Return the subprotocols implemented by this relay.
Return a new vector of link specifiers for this relay.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Return the addresses listed for this server. Read more
Return the ed25519 identity for this relay.
Return the RSA identity for this relay.

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.

Return the known ways to contact this
Return the identity of this relay whose type is key_type, or None if the relay has no such identity. Read more
Return an iterator over all of the identities held by this object.
Return the ed25519 identity for this relay if it has one.
Return the RSA identity for this relay if it has one.
Check whether the provided Id is a known identity of this relay. Read more
Return true if this object has any known identity.
Return true if this object has exactly the same relay IDs as other.
Return true if this object has every relay ID that other does. Read more
Compare this object to another HasRelayIds. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more