Skip to main content

NetworkStatusDocumentV3

Struct NetworkStatusDocumentV3 

Source
pub struct NetworkStatusDocumentV3 {
Show 37 fields pub raw_contents: Vec<u8>, pub unrecognized_lines: Vec<String>, pub version: Option<u32>, pub version_flavor: String, pub is_consensus: bool, pub is_vote: bool, pub is_microdescriptor: bool, pub consensus_methods: Vec<u32>, pub published: Option<NaiveDateTime>, pub consensus_method: Option<u32>, pub valid_after: Option<NaiveDateTime>, pub fresh_until: Option<NaiveDateTime>, pub valid_until: Option<NaiveDateTime>, pub vote_delay: Option<u32>, pub dist_delay: Option<u32>, pub client_versions: Vec<Version>, pub server_versions: Vec<Version>, pub packages: Vec<PackageVersion>, pub known_flags: Vec<String>, pub flag_thresholds: IndexMap<String, f64>, pub recommended_client_protocols: Protocols, pub recommended_relay_protocols: Protocols, pub required_client_protocols: Protocols, pub required_relay_protocols: Protocols, pub params: IndexMap<String, i64>, pub shared_randomness_previous_reveal_count: Option<u32>, pub shared_randomness_previous_value: Option<String>, pub shared_randomness_current_reveal_count: Option<u32>, pub shared_randomness_current_value: Option<String>, pub is_shared_randomness_participate: bool, pub shared_randomness_commitments: Vec<SharedRandomnessCommitment>, pub bandwidth_file_headers: IndexMap<String, String>, pub bandwidth_file_digest: IndexMap<String, String>, pub signatures: Vec<DocumentSignature>, pub bandwidth_weights: IndexMap<String, i64>, pub directory_authorities: Vec<DirectoryAuthority>, pub routers: IndexMap<String, RouterEntry>,
}

Fields§

§raw_contents: Vec<u8>§unrecognized_lines: Vec<String>§version: Option<u32>§version_flavor: String§is_consensus: bool§is_vote: bool§is_microdescriptor: bool§consensus_methods: Vec<u32>§published: Option<NaiveDateTime>§consensus_method: Option<u32>§valid_after: Option<NaiveDateTime>§fresh_until: Option<NaiveDateTime>§valid_until: Option<NaiveDateTime>§vote_delay: Option<u32>§dist_delay: Option<u32>§client_versions: Vec<Version>§server_versions: Vec<Version>§packages: Vec<PackageVersion>§known_flags: Vec<String>§flag_thresholds: IndexMap<String, f64>§recommended_client_protocols: Protocols§recommended_relay_protocols: Protocols§required_client_protocols: Protocols§required_relay_protocols: Protocols§params: IndexMap<String, i64>§shared_randomness_previous_reveal_count: Option<u32>§shared_randomness_previous_value: Option<String>§shared_randomness_current_reveal_count: Option<u32>§shared_randomness_current_value: Option<String>§is_shared_randomness_participate: bool§shared_randomness_commitments: Vec<SharedRandomnessCommitment>§bandwidth_file_headers: IndexMap<String, String>§bandwidth_file_digest: IndexMap<String, String>§signatures: Vec<DocumentSignature>§bandwidth_weights: IndexMap<String, i64>§directory_authorities: Vec<DirectoryAuthority>§routers: IndexMap<String, RouterEntry>

Implementations§

Source§

impl NetworkStatusDocumentV3

Source

pub fn parse(content: &[u8], validate: bool) -> Result<Self>

Source

pub fn parse_with_options( content: &[u8], validate: bool, default_params: bool, ) -> Result<Self>

Source

pub fn meets_consensus_method(&self, method: u32) -> bool

Source

pub fn is_valid(&self) -> bool

Source

pub fn is_fresh(&self) -> bool

Source

pub fn digest( &self, hash: DigestHash, encoding: DigestEncoding, ) -> Result<String>

Source

pub fn validate_signatures( &self, key_certificates: &[KeyCertificate], ) -> Result<()>

Source

pub fn parse_routers( content: &[u8], validate: bool, is_microdescriptor: bool, ) -> Result<Vec<RouterEntry>>

Source

pub fn parse_bare(content: &[u8], validate: bool) -> Result<Self>

Source

pub fn content( attributes: &Attributes, exclude: &[&str], authorities: Option<&[DirectoryAuthority]>, routers: &[Vec<u8>], ) -> Vec<u8> ⓘ

Source

pub fn create( attributes: &Attributes, exclude: &[&str], validate: bool, authorities: Option<&[DirectoryAuthority]>, routers: &[Vec<u8>], ) -> Result<Self>

Trait Implementations§

Source§

impl Clone for NetworkStatusDocumentV3

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NetworkStatusDocumentV3

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for NetworkStatusDocumentV3

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for NetworkStatusDocumentV3

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for NetworkStatusDocumentV3

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more