ServerDescriptorBuilder

Struct ServerDescriptorBuilder 

Source
pub struct ServerDescriptorBuilder { /* private fields */ }
Expand description

Builder for ServerDescriptor.

Implementations§

Source§

impl ServerDescriptorBuilder

Source

pub fn nickname<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

The relay’s nickname (1-19 alphanumeric characters).

Source

pub fn fingerprint<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

The relay’s fingerprint (40 hex characters), derived from identity key.

Source

pub fn address<VALUE: Into<IpAddr>>(&mut self, value: VALUE) -> &mut Self

The relay’s primary IPv4 address.

Source

pub fn or_port<VALUE: Into<u16>>(&mut self, value: VALUE) -> &mut Self

The relay’s onion routing port (always non-zero).

Source

pub fn socks_port<VALUE: Into<u16>>(&mut self, value: VALUE) -> &mut Self

The relay’s SOCKS port (deprecated, usually None).

Source

pub fn dir_port<VALUE: Into<u16>>(&mut self, value: VALUE) -> &mut Self

The relay’s directory port for serving cached descriptors.

Source

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).

Source

pub fn platform<VALUE: Into<Vec<u8>>>(&mut self, value: VALUE) -> &mut Self

Raw platform string (e.g., “Tor 0.4.7.10 on Linux”).

Source

pub fn tor_version<VALUE: Into<Version>>(&mut self, value: VALUE) -> &mut Self

Parsed Tor version from the platform string.

Source

pub fn operating_system<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

Operating system from the platform string.

Source

pub fn published<VALUE: Into<DateTime<Utc>>>( &mut self, value: VALUE, ) -> &mut Self

When this descriptor was published (UTC).

Source

pub fn uptime<VALUE: Into<u64>>(&mut self, value: VALUE) -> &mut Self

Seconds the relay has been running.

Source

pub fn contact<VALUE: Into<Vec<u8>>>(&mut self, value: VALUE) -> &mut Self

Contact information for the relay operator.

Supported link protocol versions (legacy).

Source

pub fn circuit_protocols<VALUE: Into<Vec<String>>>( &mut self, value: VALUE, ) -> &mut Self

Supported circuit protocol versions (legacy).

Source

pub fn bandwidth_avg<VALUE: Into<u64>>(&mut self, value: VALUE) -> &mut Self

Average bandwidth in bytes per second the relay is willing to sustain.

Source

pub fn bandwidth_burst<VALUE: Into<u64>>(&mut self, value: VALUE) -> &mut Self

Maximum bandwidth in bytes per second for short bursts.

Source

pub fn bandwidth_observed<VALUE: Into<u64>>( &mut self, value: VALUE, ) -> &mut Self

Bandwidth in bytes per second the relay has actually observed.

Source

pub fn exit_policy<VALUE: Into<ExitPolicy>>( &mut self, value: VALUE, ) -> &mut Self

The relay’s exit policy (rules for what traffic it will exit).

Source

pub fn exit_policy_v6<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

IPv6 exit policy summary (e.g., “accept 80,443” or “reject 1-65535”).

Source

pub fn bridge_distribution<VALUE: Into<BridgeDistribution>>( &mut self, value: VALUE, ) -> &mut Self

How this bridge wants to be distributed (bridges only).

Source

pub fn family<VALUE: Into<HashSet<String>>>( &mut self, value: VALUE, ) -> &mut Self

Fingerprints of related relays (same operator).

Source

pub fn hibernating<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

Whether the relay is currently hibernating (reduced service).

Source

pub fn allow_single_hop_exits<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self

Whether the relay allows single-hop exits (security risk).

Source

pub fn allow_tunneled_dir_requests<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self

Whether the relay accepts tunneled directory requests.

Source

pub fn extra_info_cache<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

Whether the relay caches extra-info descriptors.

Source

pub fn extra_info_digest<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

SHA-1 digest of the relay’s extra-info descriptor.

Source

pub fn extra_info_sha256_digest<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

SHA-256 digest of the relay’s extra-info descriptor.

Source

pub fn is_hidden_service_dir<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self

Whether the relay serves as a hidden service directory.

Source

pub fn protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self

Supported protocol versions (modern format). Maps protocol name to list of supported versions.

Source

pub fn onion_key<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

RSA onion key for circuit creation (PEM format).

Source

pub fn onion_key_crosscert<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

Cross-certification of onion key by identity key.

Source

pub fn ntor_onion_key<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Curve25519 onion key for ntor handshake (base64).

Source

pub fn ntor_onion_key_crosscert<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

Cross-certification of ntor key.

Source

pub fn ntor_onion_key_crosscert_sign<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

Sign bit for ntor key cross-certification.

Source

pub fn signing_key<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

RSA signing key (PEM format).

Source

pub fn ed25519_certificate<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

Ed25519 identity certificate (PEM format).

Source

pub fn ed25519_master_key<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

Ed25519 master key (base64).

Source

pub fn ed25519_signature<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

Ed25519 signature over the descriptor.

Source

pub fn signature<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

RSA signature over the descriptor (PEM format).

Source

pub fn raw_content<VALUE: Into<Vec<u8>>>(&mut self, value: VALUE) -> &mut Self

Raw bytes of the original descriptor content.

Source

pub fn unrecognized_lines<VALUE: Into<Vec<String>>>( &mut self, value: VALUE, ) -> &mut Self

Lines that were not recognized during parsing.

Source

pub fn build(&self) -> Result<ServerDescriptor, ServerDescriptorBuilderError>

Builds a new ServerDescriptor.

§Errors

If a required field has not been initialized.

Trait Implementations§

Source§

impl Clone for ServerDescriptorBuilder

Source§

fn clone(&self) -> ServerDescriptorBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for ServerDescriptorBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V