Struct tor_netdoc::doc::netstatus::NsConsensusRouterStatus

source ·
#[non_exhaustive]
pub struct NsConsensusRouterStatus { pub rs: GenericRouterStatus<RdDigest>, }
Available on crate feature ns_consensus only.
Expand description

A single relay’s status, as represented in a “ns” consensus.

Only available if tor-netdoc is built with the ns_consensus feature.

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.
§rs: GenericRouterStatus<RdDigest>
Available on crate feature dangerous-expose-struct-fields only.

Underlying generic routerstatus object.

This is private because we don’t want to leak that these two types have the same implementation “under the hood”.

Implementations§

source§

impl NsConsensusRouterStatus

source

pub fn orport_addrs(&self) -> impl Iterator<Item = &SocketAddr>

Return an iterator of ORPort addresses for this routerstatus

source

pub fn weight(&self) -> &RelayWeight

Return the declared weight of this routerstatus in the directory.

source

pub fn addrs(&self) -> &[SocketAddr]

Return the ORPort addresses of this routerstatus

source

pub fn protovers(&self) -> &Protocols

Return the protovers that this routerstatus says it implements.

source

pub fn nickname(&self) -> &str

Return the nickname of this routerstatus.

source

pub fn flags(&self) -> &RelayFlags

Return the relay flags of this routerstatus.

source

pub fn version(&self) -> Option<&Version>

Return the version of this routerstatus.

source

pub fn ed25519_id_is_usable(&self) -> bool

Return true if the ed25519 identity on this relay reflects a true consensus among the authorities.

source

pub fn is_flagged_bad_exit(&self) -> bool

Return true if this routerstatus is listed with the BadExit flag.

source

pub fn is_flagged_v2dir(&self) -> bool

Return true if this routerstatus is listed with the v2dir flag.

source

pub fn is_flagged_exit(&self) -> bool

Return true if this routerstatus is listed with the Exit flag.

source

pub fn is_flagged_guard(&self) -> bool

Return true if this routerstatus is listed with the Guard flag.

source

pub fn is_flagged_hsdir(&self) -> bool

Return true if this routerstatus is listed with the HSDir flag.

source

pub fn is_flagged_stable(&self) -> bool

Return true if this routerstatus is listed with the Stable flag.

source

pub fn is_flagged_fast(&self) -> bool

Return true if this routerstatus is listed with the Fast flag.

source

pub fn is_flagged_middle_only(&self) -> bool

Return true if this routerstatus is listed with the MiddleOnly flag.

Note that this flag is only used by authorities as part of the voting process; clients do not and should not act based on whether it is set.

source§

impl NsConsensusRouterStatus

source

pub fn rd_digest(&self) -> &RdDigest

Return the expected router descriptor digest for this routerstatus

Trait Implementations§

source§

impl Clone for NsConsensusRouterStatus

source§

fn clone(&self) -> NsConsensusRouterStatus

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for NsConsensusRouterStatus

source§

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

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

impl ParseRouterStatus for NsConsensusRouterStatus

source§

fn flavor() -> ConsensusFlavor

Return the networkstatus consensus flavor in which this routerstatus appears.
source§

fn from_section( sec: &Section<'_, NetstatusKwd> ) -> Result<NsConsensusRouterStatus>

Parse this object from a Section object containing its elements.
source§

impl RouterStatus for NsConsensusRouterStatus

source§

fn rsa_identity(&self) -> &RsaIdentity

Return the expected microdescriptor digest for this routerstatus

§

type DocumentDigest = [u8; 20]

A digest of the document that’s identified by this RouterStatus.
source§

fn doc_digest(&self) -> &RdDigest

Return the digest of the document identified by this routerstatus.

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
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.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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