NetworkStatusDocumentBuilder

Struct NetworkStatusDocumentBuilder 

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

Implementations§

Source§

impl NetworkStatusDocumentBuilder

Source

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

Network status version (typically 3).

Source

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

Version flavor (empty string or “microdesc”).

Source

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

Whether this is a consensus document.

Source

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

Whether this is a vote document.

Source

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

Whether this uses microdescriptor format.

Source

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

Consensus method used (consensus only).

Source

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

Supported consensus methods (vote only).

Source

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

When this vote was published (vote only).

Source

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

When this document becomes valid.

Source

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

When clients should fetch a new document.

Source

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

When this document expires.

Source

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

Seconds authorities wait for votes.

Source

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

Seconds authorities wait for signatures.

Source

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

Recommended Tor versions for clients.

Source

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

Recommended Tor versions for relays.

Source

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

Flags that may appear on relay entries.

Source

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

Recommended protocol versions for clients.

Source

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

Recommended protocol versions for relays.

Source

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

Required protocol versions for clients.

Source

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

Required protocol versions for relays.

Source

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

Consensus parameters (key=value pairs).

Source

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

Previous shared randomness value.

Source

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

Current shared randomness value.

Source

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

Bandwidth weights for path selection.

Source

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

Directory authorities that contributed to this document.

Source

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

Signatures from directory authorities.

Source

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

Raw bytes of the original document.

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<NetworkStatusDocument, NetworkStatusDocumentBuilderError>

Builds a new NetworkStatusDocument.

§Errors

If a required field has not been initialized.

Trait Implementations§

Source§

impl Clone for NetworkStatusDocumentBuilder

Source§

fn clone(&self) -> NetworkStatusDocumentBuilder

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 NetworkStatusDocumentBuilder

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