pub struct MicrodescriptorBuilder { /* private fields */ }Expand description
Builder for Microdescriptor.
Implementations§
Source§impl MicrodescriptorBuilder
impl MicrodescriptorBuilder
Sourcepub fn onion_key<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn onion_key<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
RSA onion key for TAP circuit handshake (PEM format).
This is the legacy key used for the original Tor handshake. Modern clients prefer the ntor handshake using ntor_onion_key.
Sourcepub fn ntor_onion_key<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn ntor_onion_key<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Curve25519 onion key for ntor circuit handshake (base64).
This is the modern key used for the ntor handshake, which provides better security properties than the TAP handshake.
Sourcepub fn or_addresses<VALUE: Into<Vec<(IpAddr, u16, bool)>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn or_addresses<VALUE: Into<Vec<(IpAddr, u16, bool)>>>( &mut self, value: VALUE, ) -> &mut Self
Additional addresses (IPv4 or IPv6) the relay listens on.
Each tuple is (address, port, is_ipv6). The a lines in the microdescriptor provide these additional addresses.
Sourcepub fn family<VALUE: Into<Vec<String>>>(&mut self, value: VALUE) -> &mut Self
pub fn family<VALUE: Into<Vec<String>>>(&mut self, value: VALUE) -> &mut Self
Fingerprints of related relays (same operator).
These are typically prefixed with $ and contain the full 40-character hex fingerprint.
Sourcepub fn exit_policy<VALUE: Into<MicroExitPolicy>>( &mut self, value: VALUE, ) -> &mut Self
pub fn exit_policy<VALUE: Into<MicroExitPolicy>>( &mut self, value: VALUE, ) -> &mut Self
Compact IPv4 exit policy.
Unlike full exit policies, microdescriptor policies only specify which ports are accepted or rejected, not addresses.
Sourcepub fn exit_policy_v6<VALUE: Into<MicroExitPolicy>>( &mut self, value: VALUE, ) -> &mut Self
pub fn exit_policy_v6<VALUE: Into<MicroExitPolicy>>( &mut self, value: VALUE, ) -> &mut Self
Compact IPv6 exit policy.
Separate policy for IPv6 traffic, if different from IPv4.
Sourcepub fn identifiers<VALUE: Into<HashMap<String, String>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn identifiers<VALUE: Into<HashMap<String, String>>>( &mut self, value: VALUE, ) -> &mut Self
Identity key digests by type.
Maps key type (e.g., “rsa1024”, “ed25519”) to the base64-encoded digest of that key.
Sourcepub fn protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self
Supported protocol versions.
Maps protocol name to list of supported versions. Common protocols include “Link”, “Relay”, “HSDir”, etc.
Sourcepub fn raw_content<VALUE: Into<Vec<u8>>>(&mut self, value: VALUE) -> &mut Self
pub fn raw_content<VALUE: Into<Vec<u8>>>(&mut self, value: VALUE) -> &mut Self
Raw bytes of the original descriptor content.
Sourcepub fn annotations<VALUE: Into<Vec<(String, Option<String>)>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn annotations<VALUE: Into<Vec<(String, Option<String>)>>>( &mut self, value: VALUE, ) -> &mut Self
Annotations from CollecTor archives.
Each annotation is a (key, optional_value) pair from lines starting with @.
Sourcepub fn unrecognized_lines<VALUE: Into<Vec<String>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn unrecognized_lines<VALUE: Into<Vec<String>>>( &mut self, value: VALUE, ) -> &mut Self
Lines that were not recognized during parsing.
Sourcepub fn build(&self) -> Result<Microdescriptor, MicrodescriptorBuilderError>
pub fn build(&self) -> Result<Microdescriptor, MicrodescriptorBuilderError>
Trait Implementations§
Source§impl Clone for MicrodescriptorBuilder
impl Clone for MicrodescriptorBuilder
Source§fn clone(&self) -> MicrodescriptorBuilder
fn clone(&self) -> MicrodescriptorBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more