Struct tor_netdoc::doc::routerdesc::RouterDesc
source · [−]#[non_exhaustive]pub struct RouterDesc {Show 18 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: PublicKey,
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>,
}
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: PublicKey
RSA identity 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: 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
sourceimpl RouterDesc
impl RouterDesc
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.
Auto Trait Implementations
impl RefUnwindSafe for RouterDesc
impl Send for RouterDesc
impl Sync for RouterDesc
impl Unpin for RouterDesc
impl UnwindSafe for RouterDesc
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