pub struct Relay<'a> { /* private fields */ }
Expand description
A view of a relay on the Tor network, suitable for building circuits.
Implementations§
Source§impl<'a> Relay<'a>
impl<'a> Relay<'a>
Sourcepub fn low_level_details(&self) -> RelayDetails<'_>
pub fn low_level_details(&self) -> RelayDetails<'_>
Return a RelayDetails
for this relay.
Callers should generally avoid using this information directly if they can; it’s better to use a higher-level function that exposes semantic information rather than these properties.
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 rs(&self) -> &MdConsensusRouterStatus
Available on crate feature experimental-api
only.
pub fn rs(&self) -> &MdConsensusRouterStatus
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.
Sourcepub fn md(&self) -> &Microdesc
Available on crate feature experimental-api
only.
pub fn md(&self) -> &Microdesc
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§
Source§impl<'a> ChanTarget for Relay<'a>
impl<'a> ChanTarget for Relay<'a>
Source§fn display_chan_target(&self) -> DisplayChanTarget<'_, Self>where
Self: Sized,
fn display_chan_target(&self) -> DisplayChanTarget<'_, Self>where
Self: Sized,
ChanTarget
-specific members. Read moreSource§impl<'a> CircTarget for Relay<'a>
impl<'a> CircTarget for Relay<'a>
Source§fn ntor_onion_key(&self) -> &PublicKey
fn ntor_onion_key(&self) -> &PublicKey
Source§fn linkspecs(&self) -> Result<Vec<EncodedLinkSpec>, EncodeError>
fn linkspecs(&self) -> Result<Vec<EncodedLinkSpec>, EncodeError>
Source§impl<'a> HasAddrs for Relay<'a>
impl<'a> HasAddrs for Relay<'a>
Source§fn addrs(&self) -> &[SocketAddr]
fn addrs(&self) -> &[SocketAddr]
Source§impl<'a> HasCountryCode for Relay<'a>
Available on crate feature geoip
only.
impl<'a> HasCountryCode for Relay<'a>
geoip
only.Source§fn country_code(&self) -> Option<CountryCode>
fn country_code(&self) -> Option<CountryCode>
Source§impl<'a> HasRelayIdsLegacy for Relay<'a>
impl<'a> HasRelayIdsLegacy for Relay<'a>
Source§fn ed_identity(&self) -> &Ed25519Identity
fn ed_identity(&self) -> &Ed25519Identity
Source§fn rsa_identity(&self) -> &RsaIdentity
fn rsa_identity(&self) -> &RsaIdentity
impl<'a> DirectChanMethodsHelper for Relay<'a>
Auto Trait Implementations§
impl<'a> Freeze for Relay<'a>
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<D> HasChanMethod for Dwhere
D: DirectChanMethodsHelper,
impl<D> HasChanMethod for Dwhere
D: DirectChanMethodsHelper,
Source§fn chan_method(&self) -> ChannelMethod
fn chan_method(&self) -> ChannelMethod
Source§impl<T> HasRelayIds for Twhere
T: HasRelayIdsLegacy,
impl<T> HasRelayIds for Twhere
T: HasRelayIdsLegacy,
Source§fn identity(&self, key_type: RelayIdType) -> Option<RelayIdRef<'_>>
fn identity(&self, key_type: RelayIdType) -> Option<RelayIdRef<'_>>
key_type
, or None if
the relay has no such identity. Read moreSource§fn identities(&self) -> RelayIdIter<'_, Self>
fn identities(&self) -> RelayIdIter<'_, Self>
Source§fn ed_identity(&self) -> Option<&Ed25519Identity>
fn ed_identity(&self) -> Option<&Ed25519Identity>
Source§fn rsa_identity(&self) -> Option<&RsaIdentity>
fn rsa_identity(&self) -> Option<&RsaIdentity>
Source§fn has_identity(&self, id: RelayIdRef<'_>) -> bool
fn has_identity(&self, id: RelayIdRef<'_>) -> bool
Source§fn has_any_identity(&self) -> bool
fn has_any_identity(&self) -> bool
Source§fn same_relay_ids<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
fn same_relay_ids<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
other
.Source§fn has_all_relay_ids_from<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
fn has_all_relay_ids_from<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
other
does. Read moreSource§fn has_any_relay_id_from<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
fn has_any_relay_id_from<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
other
has. Read moreSource§fn cmp_by_relay_ids<T>(&self, other: &T) -> Orderingwhere
T: HasRelayIds + ?Sized,
fn cmp_by_relay_ids<T>(&self, other: &T) -> Orderingwhere
T: HasRelayIds + ?Sized,
Source§fn display_relay_ids(&self) -> DisplayRelayIds<'_, Self>
fn display_relay_ids(&self) -> DisplayRelayIds<'_, Self>
HasRelayIds
members.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more