#[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: Option<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>,
/* private fields */
}
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: Nickname
Human-readable nickname for this relay.
This is not secure, and not guaranteed to be unique.
ipv4addr: Option<Ipv4Addr>
IPv4 address for this relay.
orport: u16
IPv4 ORPort for this relay.
ipv6addr: Option<(Ipv6Addr, u16)>
IPv6 address and port for this relay.
dirport: u16
Directory port for contacting this relay for direct HTTP directory downloads.
uptime: Option<u64>
Declared uptime for this relay, in seconds.
published: SystemTime
Time when this router descriptor was published.
identity_cert: Ed25519Cert
Ed25519 identity certificate (identity key authenticating a signing key)
rsa_identity_key: PublicKey
RSA identity key for this relay. (Deprecated; never use this without the ed25519 identity as well).
rsa_identity: RsaIdentity
RSA identity key for this relay. (Deprecated; never use this without the ed25519 identity as well).
ntor_onion_key: PublicKey
Key for extending a circuit to this relay using the ntor protocol.
tap_onion_key: Option<PublicKey>
Key for extending a circuit to this relay using the (deprecated) TAP protocol.
proto: Arc<Protocols>
List of subprotocol versions supported by this relay.
is_dircache: bool
True if this relay says it’s a directory cache.
is_extrainfo_cache: bool
True if this relay says that it caches extrainfo documents.
family: Arc<RelayFamily>
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>
Software and version that this relay says it’s running.
ipv4_policy: AddrPolicy
A complete address-level policy for which IPv4 addresses this relay says it supports.
ipv6_policy: Arc<PortPolicy>
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 family(&self) -> Arc<RelayFamily>
pub fn family(&self) -> Arc<RelayFamily>
Return the declared family of this descriptor.
Sourcepub fn family_ids(&self) -> &[RelayFamilyId]
pub fn family_ids(&self) -> &[RelayFamilyId]
Return the authenticated family IDs of this descriptor.
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 moreAuto Trait Implementations§
impl Freeze for RouterDesc
impl RefUnwindSafe for RouterDesc
impl Send for RouterDesc
impl Sync for RouterDesc
impl Unpin for RouterDesc
impl UnwindSafe for RouterDesc
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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
.Source§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
.Source§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.Source§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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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