Struct tor_netdir::UncheckedRelay
source · pub struct UncheckedRelay<'a> { /* private fields */ }
Expand description
A relay that we haven’t checked for validity or usability in routing.
Implementations§
source§impl<'a> UncheckedRelay<'a>
impl<'a> UncheckedRelay<'a>
sourcepub fn is_usable(&self) -> bool
pub fn is_usable(&self) -> bool
Return true if this relay is valid and usable.
This function should return true
for every Relay we expose
to the user.
sourcepub fn into_relay(self) -> Option<Relay<'a>>
pub fn into_relay(self) -> Option<Relay<'a>>
If this is usable, return a corresponding Relay object.
sourcepub fn is_flagged_guard(&self) -> bool
pub fn is_flagged_guard(&self) -> bool
Return true if this relay has the Guard flag.
Note that this function only checks for the presence of the Guard
flag. If you want to check for all the properties that indicate
suitability, use UncheckedRelay::is_suitable_as_guard
instead.
sourcepub fn is_suitable_as_guard(&self) -> bool
pub fn is_suitable_as_guard(&self) -> bool
Return true if this relay is suitable for use as a newly sampled guard, or for continuing to use as a guard.
sourcepub fn is_dir_cache(&self) -> bool
pub fn is_dir_cache(&self) -> bool
Return true if this relay is a potential directory cache.
Trait Implementations§
source§impl<'a> Debug for UncheckedRelay<'a>
impl<'a> Debug for UncheckedRelay<'a>
source§impl<'a> HasCountryCode for UncheckedRelay<'a>
Available on crate feature geoip
only.
impl<'a> HasCountryCode for UncheckedRelay<'a>
Available on crate feature
geoip
only.source§fn country_code(&self) -> Option<CountryCode>
fn country_code(&self) -> Option<CountryCode>
Return the country code in which this server is most likely located. Read more
source§impl<'a> HasRelayIds for UncheckedRelay<'a>
impl<'a> HasRelayIds for UncheckedRelay<'a>
source§fn identity(&self, key_type: RelayIdType) -> Option<RelayIdRef<'_>>
fn identity(&self, key_type: RelayIdType) -> Option<RelayIdRef<'_>>
Return the identity of this relay whose type is
key_type
, or None if
the relay has no such identity. Read moresource§fn identities(&self) -> RelayIdIter<'_, Self>
fn identities(&self) -> RelayIdIter<'_, Self>
Return an iterator over all of the identities held by this object.
source§fn ed_identity(&self) -> Option<&Ed25519Identity>
fn ed_identity(&self) -> Option<&Ed25519Identity>
Return the ed25519 identity for this relay if it has one.
source§fn rsa_identity(&self) -> Option<&RsaIdentity>
fn rsa_identity(&self) -> Option<&RsaIdentity>
Return the RSA identity for this relay if it has one.
source§fn has_identity(&self, id: RelayIdRef<'_>) -> bool
fn has_identity(&self, id: RelayIdRef<'_>) -> bool
Check whether the provided Id is a known identity of this relay. Read more
source§fn has_any_identity(&self) -> bool
fn has_any_identity(&self) -> bool
Return true if this object has any known identity.
source§fn same_relay_ids<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
fn same_relay_ids<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
Return true if this object has exactly the same relay IDs as
other
.source§fn has_all_relay_ids_from<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
fn has_all_relay_ids_from<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
Return true if this object has every relay ID that
other
does. Read moresource§fn has_any_relay_id_from<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
fn has_any_relay_id_from<T>(&self, other: &T) -> boolwhere
T: HasRelayIds + ?Sized,
Return true if this object has any relay ID that
other
has. Read moresource§fn cmp_by_relay_ids<T>(&self, other: &T) -> Orderingwhere
T: HasRelayIds + ?Sized,
fn cmp_by_relay_ids<T>(&self, other: &T) -> Orderingwhere
T: HasRelayIds + ?Sized,
Compare this object to another HasRelayIds. Read more
source§fn display_relay_ids(&self) -> DisplayRelayIds<'_, Self>
fn display_relay_ids(&self) -> DisplayRelayIds<'_, Self>
Return a reference to this object suitable for formatting its
HasRelayIds
members.Auto Trait Implementations§
impl<'a> Freeze for UncheckedRelay<'a>
impl<'a> RefUnwindSafe for UncheckedRelay<'a>
impl<'a> Send for UncheckedRelay<'a>
impl<'a> Sync for UncheckedRelay<'a>
impl<'a> Unpin for UncheckedRelay<'a>
impl<'a> UnwindSafe for UncheckedRelay<'a>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more