pub struct NetworkStatusDocumentBuilder { /* private fields */ }Expand description
Builder for NetworkStatusDocument.
Implementations§
Source§impl NetworkStatusDocumentBuilder
impl NetworkStatusDocumentBuilder
Sourcepub fn version<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
pub fn version<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
Network status version (typically 3).
Sourcepub fn version_flavor<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn version_flavor<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Version flavor (empty string or “microdesc”).
Sourcepub fn is_consensus<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn is_consensus<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Whether this is a consensus document.
Sourcepub fn is_vote<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn is_vote<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Whether this is a vote document.
Sourcepub fn is_microdescriptor<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
pub fn is_microdescriptor<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Whether this uses microdescriptor format.
Sourcepub fn consensus_method<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
pub fn consensus_method<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
Consensus method used (consensus only).
Sourcepub fn consensus_methods<VALUE: Into<Vec<u32>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn consensus_methods<VALUE: Into<Vec<u32>>>( &mut self, value: VALUE, ) -> &mut Self
Supported consensus methods (vote only).
Sourcepub fn published<VALUE: Into<DateTime<Utc>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn published<VALUE: Into<DateTime<Utc>>>( &mut self, value: VALUE, ) -> &mut Self
When this vote was published (vote only).
Sourcepub fn valid_after<VALUE: Into<DateTime<Utc>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn valid_after<VALUE: Into<DateTime<Utc>>>( &mut self, value: VALUE, ) -> &mut Self
When this document becomes valid.
Sourcepub fn fresh_until<VALUE: Into<DateTime<Utc>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn fresh_until<VALUE: Into<DateTime<Utc>>>( &mut self, value: VALUE, ) -> &mut Self
When clients should fetch a new document.
Sourcepub fn valid_until<VALUE: Into<DateTime<Utc>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn valid_until<VALUE: Into<DateTime<Utc>>>( &mut self, value: VALUE, ) -> &mut Self
When this document expires.
Sourcepub fn vote_delay<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
pub fn vote_delay<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
Seconds authorities wait for votes.
Sourcepub fn dist_delay<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
pub fn dist_delay<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
Seconds authorities wait for signatures.
Sourcepub fn client_versions<VALUE: Into<Vec<Version>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn client_versions<VALUE: Into<Vec<Version>>>( &mut self, value: VALUE, ) -> &mut Self
Recommended Tor versions for clients.
Sourcepub fn server_versions<VALUE: Into<Vec<Version>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn server_versions<VALUE: Into<Vec<Version>>>( &mut self, value: VALUE, ) -> &mut Self
Recommended Tor versions for relays.
Sourcepub fn known_flags<VALUE: Into<Vec<String>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn known_flags<VALUE: Into<Vec<String>>>( &mut self, value: VALUE, ) -> &mut Self
Flags that may appear on relay entries.
Sourcepub fn recommended_client_protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn recommended_client_protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self
Recommended protocol versions for clients.
Sourcepub fn recommended_relay_protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn recommended_relay_protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self
Recommended protocol versions for relays.
Sourcepub fn required_client_protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn required_client_protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self
Required protocol versions for clients.
Sourcepub fn required_relay_protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn required_relay_protocols<VALUE: Into<HashMap<String, Vec<u32>>>>( &mut self, value: VALUE, ) -> &mut Self
Required protocol versions for relays.
Sourcepub fn params<VALUE: Into<HashMap<String, i32>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn params<VALUE: Into<HashMap<String, i32>>>( &mut self, value: VALUE, ) -> &mut Self
Consensus parameters (key=value pairs).
Previous shared randomness value.
Current shared randomness value.
Sourcepub fn bandwidth_weights<VALUE: Into<HashMap<String, i32>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn bandwidth_weights<VALUE: Into<HashMap<String, i32>>>( &mut self, value: VALUE, ) -> &mut Self
Bandwidth weights for path selection.
Directory authorities that contributed to this document.
Sourcepub fn signatures<VALUE: Into<Vec<DocumentSignature>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn signatures<VALUE: Into<Vec<DocumentSignature>>>( &mut self, value: VALUE, ) -> &mut Self
Signatures from directory authorities.
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 document.
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<NetworkStatusDocument, NetworkStatusDocumentBuilderError>
pub fn build( &self, ) -> Result<NetworkStatusDocument, NetworkStatusDocumentBuilderError>
Trait Implementations§
Source§impl Clone for NetworkStatusDocumentBuilder
impl Clone for NetworkStatusDocumentBuilder
Source§fn clone(&self) -> NetworkStatusDocumentBuilder
fn clone(&self) -> NetworkStatusDocumentBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more