Struct tor_netdoc::doc::microdesc::Microdesc
source · #[non_exhaustive]pub struct Microdesc {
pub sha256: MdDigest,
pub ntor_onion_key: PublicKey,
pub family: Arc<RelayFamily>,
pub ipv4_policy: Arc<PortPolicy>,
pub ipv6_policy: Arc<PortPolicy>,
pub ed25519_id: Ed25519Identity,
}
Expand description
A single microdescriptor.
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.sha256: MdDigest
dangerous-expose-struct-fields
only.The SHA256 digest of the text of this microdescriptor. This value is used to identify the microdescriptor when downloading it, and when listing it in a consensus document.
ntor_onion_key: PublicKey
dangerous-expose-struct-fields
only.Public key used for the ntor circuit extension protocol.
family: Arc<RelayFamily>
dangerous-expose-struct-fields
only.Declared family for this relay.
ipv4_policy: Arc<PortPolicy>
dangerous-expose-struct-fields
only.List of IPv4 ports to which this relay will exit
ipv6_policy: Arc<PortPolicy>
dangerous-expose-struct-fields
only.List of IPv6 ports to which this relay will exit
ed25519_id: Ed25519Identity
dangerous-expose-struct-fields
only.Ed25519 identity for this relay
Implementations§
source§impl Microdesc
impl Microdesc
sourcepub fn builder() -> MicrodescBuilder
Available on crate feature build_docs
only.
pub fn builder() -> MicrodescBuilder
build_docs
only.Create a new MicrodescBuilder that can be used to construct microdescriptors.
This function is only available when the crate is built with the
build_docs
feature.
§Limitations
The generated microdescriptors cannot yet be encoded, and do not yet have correct sha256 digests. As such they are only useful for testing.
sourcepub fn ipv4_policy(&self) -> &Arc<PortPolicy>
pub fn ipv4_policy(&self) -> &Arc<PortPolicy>
Return the ipv4 exit policy for this microdesc
sourcepub fn ipv6_policy(&self) -> &Arc<PortPolicy>
pub fn ipv6_policy(&self) -> &Arc<PortPolicy>
Return the ipv6 exit policy for this microdesc
sourcepub fn family(&self) -> &RelayFamily
pub fn family(&self) -> &RelayFamily
Return the relay family for this microdesc
sourcepub fn ed25519_id(&self) -> &Ed25519Identity
pub fn ed25519_id(&self) -> &Ed25519Identity
Return the ed25519 identity for this microdesc, if its Ed25519 identity is well-formed.