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
sourceimpl<'a> Relay<'a>
impl<'a> Relay<'a>
sourcepub fn id(&self) -> &Ed25519Identity
pub fn id(&self) -> &Ed25519Identity
Return the Ed25519 ID for this relay.
sourcepub fn rsa_id(&self) -> &RsaIdentity
pub fn rsa_id(&self) -> &RsaIdentity
Return the RsaIdentity for this relay.
sourcepub fn same_relay<'b>(&self, other: &Relay<'b>) -> bool
pub fn same_relay<'b>(&self, other: &Relay<'b>) -> bool
Return true if this relay and other
seem to be the same relay.
(Two relays are the same if they have the same identity.)
sourcepub fn supports_exit_port_ipv4(&self, port: u16) -> bool
pub fn supports_exit_port_ipv4(&self, port: u16) -> bool
Return true if this relay allows exiting to port
on IPv4.
sourcepub fn supports_exit_port_ipv6(&self, port: u16) -> bool
pub fn supports_exit_port_ipv6(&self, port: u16) -> bool
Return true if this relay allows exiting to port
on IPv6.
sourcepub fn is_dir_cache(&self) -> bool
pub fn is_dir_cache(&self) -> bool
Return true if this relay is suitable for use as a directory cache.
sourcepub fn is_flagged_guard(&self) -> bool
pub fn is_flagged_guard(&self) -> bool
Return true if this relay is marked as usable as a new Guard node.
sourcepub fn in_same_subnet<'b>(
&self,
other: &Relay<'b>,
subnet_config: &SubnetConfig
) -> bool
pub fn in_same_subnet<'b>(
&self,
other: &Relay<'b>,
subnet_config: &SubnetConfig
) -> bool
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.
sourcepub fn in_same_family<'b>(&self, other: &Relay<'b>) -> bool
pub fn in_same_family<'b>(&self, other: &Relay<'b>) -> bool
Return true if both relays are in the same family.
(Every relay is considered to be in the same family as itself.)
sourcepub fn policies_allow_some_port(&self) -> bool
pub fn policies_allow_some_port(&self) -> bool
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.)
sourcepub fn ipv4_policy(&self) -> Arc<PortPolicy>
pub fn ipv4_policy(&self) -> Arc<PortPolicy>
Return the IPv4 exit policy for this relay. If the relay has been marked BadExit, return an empty policy
sourcepub fn ipv6_policy(&self) -> Arc<PortPolicy>
pub fn ipv6_policy(&self) -> Arc<PortPolicy>
Return the IPv6 exit policy for this relay. If the relay has been marked BadExit, return an empty policy
sourcepub fn ipv4_declared_policy(&self) -> &Arc<PortPolicy>
pub fn ipv4_declared_policy(&self) -> &Arc<PortPolicy>
Return the IPv4 exit policy declared by this relay. Contrary to Relay::ipv4_policy
,
this does not verify if the relay is marked BadExit.
sourcepub fn ipv6_declared_policy(&self) -> &Arc<PortPolicy>
pub fn ipv6_declared_policy(&self) -> &Arc<PortPolicy>
Return the IPv6 exit policy declared by this relay. Contrary to Relay::ipv6_policy
,
this does not verify if the relay is marked BadExit.
Trait Implementations
sourceimpl<'a> ChanTarget for Relay<'a>
impl<'a> ChanTarget for Relay<'a>
sourcefn addrs(&self) -> &[SocketAddr]
fn addrs(&self) -> &[SocketAddr]
Return the addresses at which you can connect to this relay
sourcefn ed_identity(&self) -> &Ed25519Identity
fn ed_identity(&self) -> &Ed25519Identity
Return the ed25519 identity for this relay.
sourcefn rsa_identity(&self) -> &RsaIdentity
fn rsa_identity(&self) -> &RsaIdentity
Return the RSA identity for this relay.
sourcefn ed_identity_key(&self) -> Option<PublicKey>
fn ed_identity_key(&self) -> Option<PublicKey>
Return the ed25519 identity key for this relay, if it is valid. Read more
sourceimpl<'a> CircTarget for Relay<'a>
impl<'a> CircTarget for Relay<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Relay<'a>
impl<'a> Send for Relay<'a>
impl<'a> Sync for Relay<'a>
impl<'a> Unpin for Relay<'a>
impl<'a> UnwindSafe for Relay<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more