#[non_exhaustive]pub struct Consensus {
pub header: Header,
pub voters: Vec<ConsensusVoterInfo>,
pub relays: Vec<RouterStatus>,
pub footer: Footer,
}
plain-consensus
only.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: Header
dangerous-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<RouterStatus>
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 Consensus
impl Consensus
Sourcepub fn relays(&self) -> &[RouterStatus]
pub fn relays(&self) -> &[RouterStatus]
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.
Sourcepub fn protocol_statuses(&self) -> &Arc<ProtoStatuses>
pub fn protocol_statuses(&self) -> &Arc<ProtoStatuses>
Return a set of all known ProtoStatus
values.
Trait Implementations§
Source§impl ExternallySigned<Consensus> for UnvalidatedConsensus
impl ExternallySigned<Consensus> for UnvalidatedConsensus
Source§type KeyHint = Vec<AuthCertKeyIds>
type KeyHint = Vec<AuthCertKeyIds>
Source§fn key_is_correct(&self, k: &Self::Key) -> Result<(), Self::KeyHint>
fn key_is_correct(&self, k: &Self::Key) -> Result<(), Self::KeyHint>
Source§fn is_well_signed(&self, k: &Self::Key) -> Result<(), Self::Error>
fn is_well_signed(&self, k: &Self::Key) -> Result<(), Self::Error>
Source§fn dangerously_assume_wellsigned(self) -> Consensus
fn dangerously_assume_wellsigned(self) -> Consensus
Auto Trait Implementations§
impl Freeze for Consensus
impl RefUnwindSafe for Consensus
impl Send for Consensus
impl Sync for Consensus
impl Unpin for Consensus
impl UnwindSafe for Consensus
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more