Struct tor_netdoc::doc::netstatus::Consensus
source · #[non_exhaustive]pub struct Consensus<RS> {
pub header: ConsensusHeader,
pub voters: Vec<ConsensusVoterInfo>,
pub relays: Vec<RS>,
pub footer: Footer,
}
Expand description
A single microdescriptor consensus netstatus
TODO: This should possibly turn into a parameterized type, to represent votes and ns consensuses.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.header: ConsensusHeader
Available on crate feature
dangerous-expose-struct-fields
only.Part of the header shared by all consensus types.
voters: Vec<ConsensusVoterInfo>
Available on crate feature
dangerous-expose-struct-fields
only.List of voters whose votes contributed to this consensus.
relays: Vec<RS>
Available on crate feature
dangerous-expose-struct-fields
only.A list of routerstatus entries for the relays on the network, with one entry per relay.
Available on crate feature
dangerous-expose-struct-fields
only.Footer for the consensus object.
Implementations§
source§impl<RS> Consensus<RS>
impl<RS> Consensus<RS>
source§impl<RS: RouterStatus + ParseRouterStatus> Consensus<RS>
impl<RS: RouterStatus + ParseRouterStatus> Consensus<RS>
sourcepub fn builder() -> ConsensusBuilder<RS>
Available on crate feature build_docs
only.
pub fn builder() -> ConsensusBuilder<RS>
build_docs
only.Return a new ConsensusBuilder for building test consensus objects.
This function is only available when the build_docs
feature has
been enabled.
Trait Implementations§
source§impl<RS> ExternallySigned<Consensus<RS>> for UnvalidatedConsensus<RS>
impl<RS> ExternallySigned<Consensus<RS>> for UnvalidatedConsensus<RS>
§type KeyHint = Vec<AuthCertKeyIds, Global>
type KeyHint = Vec<AuthCertKeyIds, Global>
A type that describes what keys are missing for this object.
source§fn key_is_correct(&self, k: &Self::Key) -> Result<(), Self::KeyHint>
fn key_is_correct(&self, k: &Self::Key) -> Result<(), Self::KeyHint>
Check whether k is the right key for this object. If not, return
an error describing what key would be right. Read more
source§fn is_well_signed(&self, k: &Self::Key) -> Result<(), Self::Error>
fn is_well_signed(&self, k: &Self::Key) -> Result<(), Self::Error>
Check the signature on this object
source§fn dangerously_assume_wellsigned(self) -> Consensus<RS>
fn dangerously_assume_wellsigned(self) -> Consensus<RS>
Unwrap this object without checking any signatures on it.