#[non_exhaustive]pub struct RouterStatus {
pub nickname: Nickname,
pub identity: RsaIdentity,
pub addrs: Vec<SocketAddr>,
pub doc_digest: RdDigest,
pub flags: RelayFlags,
pub version: Option<Version>,
pub protos: Arc<Protocols>,
pub weight: RelayWeight,
}
plain-consensus
only.Expand description
A single relay’s status, in a network status document.
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.nickname: Nickname
dangerous-expose-struct-fields
only.The nickname for this relay.
Nicknames can be used for convenience purpose, but no more: there is no mechanism to enforce their uniqueness.
identity: RsaIdentity
dangerous-expose-struct-fields
only.Fingerprint of the old-style RSA identity for this relay.
addrs: Vec<SocketAddr>
dangerous-expose-struct-fields
only.A list of address:port values where this relay can be reached.
doc_digest: RdDigest
dangerous-expose-struct-fields
only.Digest of the document for this relay.
flags: RelayFlags
dangerous-expose-struct-fields
only.Flags applied by the authorities to this relay.
version: Option<Version>
dangerous-expose-struct-fields
only.Version of the software that this relay is running.
protos: Arc<Protocols>
dangerous-expose-struct-fields
only.List of subprotocol versions supported by this relay.
weight: RelayWeight
dangerous-expose-struct-fields
only.Information about how to weight this relay when choosing a relay at random.
Implementations§
Source§impl RouterStatus
impl RouterStatus
Sourcepub fn orport_addrs(&self) -> impl Iterator<Item = &SocketAddr>
pub fn orport_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 addrs(&self) -> &[SocketAddr]
pub fn addrs(&self) -> &[SocketAddr]
Return the ORPort addresses of this routerstatus
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
Sourcepub fn doc_digest(&self) -> &DocDigest
pub fn doc_digest(&self) -> &DocDigest
Return the digest of the document identified 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 moreAuto 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