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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.header: ConsensusHeaderdangerous-expose-struct-fields only.Part of the header shared by all consensus types.
voters: Vec<ConsensusVoterInfo>dangerous-expose-struct-fields only.List of voters whose votes contributed to this consensus.
relays: Vec<RS>dangerous-expose-struct-fields only.A list of routerstatus entries for the relays on the network, with one entry per relay.
These are currently ordered by the router’s RSA identity, but this is not to be relied on, since we may want to even abolish RSA at some point!
dangerous-expose-struct-fields only.Footer for the consensus object.
Implementations§
source§impl<RS> Consensus<RS>
impl<RS> Consensus<RS>
sourcepub fn relays(&self) -> &[RS]
pub fn relays(&self) -> &[RS]
Return a slice of all the routerstatus entries in this consensus.
sourcepub fn bandwidth_weights(&self) -> &NetParams<i32>
pub fn bandwidth_weights(&self) -> &NetParams<i32>
Return a mapping from keywords to integers representing how to weight different kinds of relays in different path positions.
sourcepub fn params(&self) -> &NetParams<i32>
pub fn params(&self) -> &NetParams<i32>
Return the map of network parameters that this consensus advertises.
Return the latest shared random value, if the consensus contains one.
Return the previous shared random value, if the consensus contains one.
sourcepub fn relay_protocol_status(&self) -> &ProtoStatus
pub fn relay_protocol_status(&self) -> &ProtoStatus
Return a ProtoStatus that lists the network’s current requirements and
recommendations for the list of protocols that every relay must implement.
sourcepub fn client_protocol_status(&self) -> &ProtoStatus
pub fn client_protocol_status(&self) -> &ProtoStatus
Return a ProtoStatus that lists the network’s current requirements and
recommendations for the list of protocols that every client must implement.
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.