#[non_exhaustive]pub struct RouterStatus {
pub r: RouterStatusIntroItem,
pub m: MdDigest,
pub a: Vec<SocketAddr>,
pub flags: RelayFlags,
pub version: Option<Version>,
pub protos: Arc<Protocols>,
pub weight: RelayWeight,
}Expand description
A single relay’s status, in a network status document.
https://spec.torproject.org/dir-spec/consensus-formats.html#section:router-status
https://spec.torproject.org/dir-spec/computing-consensus.html#flavor:microdesc under “Changes to router status entries”.
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.r: RouterStatusIntroItemr — Introduce a routerstatus entry
https://spec.torproject.org/dir-spec/consensus-formats.html#item:r (and, the the md version, which is different).
m: MdDigestm — Microdescriptor or document digest
In an md consensus, the hash of the document for this relay. In a vote, microdescriptor hashes for the various consensus methods.
https://spec.torproject.org/dir-spec/computing-consensus.html#flavor:microdesc
r item.
a: Vec<SocketAddr>a — Further router address(es) (IPv6)
https://spec.torproject.org/dir-spec/consensus-formats.html#item:a (and, the the md version, which is different).
flags: RelayFlagss — Router status flags
https://spec.torproject.org/dir-spec/consensus-formats.html#item:s
version: Option<Version>v — Relay’s Tor software version
https://spec.torproject.org/dir-spec/consensus-formats.html#item:v
protos: Arc<Protocols>pr — Subprotocol capabilities supported
https://spec.torproject.org/dir-spec/consensus-formats.html#item:v
weight: RelayWeightw — Bandwidth estimates
https://spec.torproject.org/dir-spec/consensus-formats.html#item:w
Implementations§
Source§impl RouterStatus
impl RouterStatus
Sourcepub fn doc_digest(&self) -> &DocDigest
pub fn doc_digest(&self) -> &DocDigest
Return the digest of the document identified by this routerstatus.
The doc_digest method is provided on all varieties of routerstatus entry
to help paper over the protocol anomaly, that the digest is in a different place
in md routerstatus entries.
Source§impl RouterStatus
impl RouterStatus
Sourcepub fn addrs(&self) -> impl Iterator<Item = SocketAddr>
pub fn addrs(&self) -> impl Iterator<Item = SocketAddr>
Return an iterator of ORPort addresses for this routerstatus
Sourcepub fn weight(&self) -> &RelayWeight
pub fn weight(&self) -> &RelayWeight
Return the declared weight of this routerstatus in the directory.
Sourcepub fn protovers(&self) -> &Protocols
pub fn protovers(&self) -> &Protocols
Return the protovers that this routerstatus says it implements.
Sourcepub fn flags(&self) -> &RelayFlags
pub fn flags(&self) -> &RelayFlags
Return the relay flags of this routerstatus.
Sourcepub fn ed25519_id_is_usable(&self) -> bool
pub fn ed25519_id_is_usable(&self) -> bool
Return true if the ed25519 identity on this relay reflects a true consensus among the authorities.
Sourcepub fn is_flagged_bad_exit(&self) -> bool
pub fn is_flagged_bad_exit(&self) -> bool
Return true if this routerstatus is listed with the BadExit flag.
Sourcepub fn is_flagged_v2dir(&self) -> bool
pub fn is_flagged_v2dir(&self) -> bool
Return true if this routerstatus is listed with the v2dir flag.
Sourcepub fn is_flagged_exit(&self) -> bool
pub fn is_flagged_exit(&self) -> bool
Return true if this routerstatus is listed with the Exit flag.
Sourcepub fn is_flagged_guard(&self) -> bool
pub fn is_flagged_guard(&self) -> bool
Return true if this routerstatus is listed with the Guard flag.
Sourcepub fn is_flagged_hsdir(&self) -> bool
pub fn is_flagged_hsdir(&self) -> bool
Return true if this routerstatus is listed with the HSDir flag.
Sourcepub fn is_flagged_stable(&self) -> bool
pub fn is_flagged_stable(&self) -> bool
Return true if this routerstatus is listed with the Stable flag.
Sourcepub fn is_flagged_fast(&self) -> bool
pub fn is_flagged_fast(&self) -> bool
Return true if this routerstatus is listed with the Fast flag.
Sourcepub fn is_flagged_middle_only(&self) -> bool
pub fn is_flagged_middle_only(&self) -> bool
Return true if this routerstatus is listed with the MiddleOnly flag.
Source§impl RouterStatus
impl RouterStatus
Sourcepub fn rsa_identity(&self) -> &RsaIdentity
pub fn rsa_identity(&self) -> &RsaIdentity
Return RSA identity for the relay described by this RouterStatus
Trait Implementations§
Source§impl Clone for RouterStatus
impl Clone for RouterStatus
Source§fn clone(&self) -> RouterStatus
fn clone(&self) -> RouterStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RouterStatus
impl Debug for RouterStatus
Source§impl NetdocParseable for RouterStatus
impl NetdocParseable for RouterStatus
Source§fn doctype_for_error() -> &'static str
fn doctype_for_error() -> &'static str
parse2 only.Source§fn is_intro_item_keyword(kw: KeywordRef<'_>) -> bool
fn is_intro_item_keyword(kw: KeywordRef<'_>) -> bool
parse2 only.Keyword an intro Item Keyword for this kind of document? Read moreSource§fn from_items<'s>(
input: &mut ItemStream<'s>,
outer_stop: StopAt<impl StopPredicate>,
) -> Result<RouterStatus, ErrorProblem>
fn from_items<'s>( input: &mut ItemStream<'s>, outer_stop: StopAt<impl StopPredicate>, ) -> Result<RouterStatus, ErrorProblem>
parse2 only.Auto Trait Implementations§
impl Freeze for RouterStatus
impl RefUnwindSafe for RouterStatus
impl Send for RouterStatus
impl Sync for RouterStatus
impl Unpin for RouterStatus
impl UnwindSafe for RouterStatus
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