Struct tor_netdoc::types::family::RelayFamily
source · pub struct RelayFamily(/* private fields */);
Expand description
Information about a relay family.
Tor relays may declare that they belong to the same family, to indicate that they are controlled by the same party or parties, and as such should not be used in the same circuit. Two relays belong to the same family if and only if each one lists the other as belonging to its family.
NOTE: when parsing, this type always discards incorrectly-formatted entries, including entries that are only nicknames.
TODO: This type probably belongs in a different crate.
Implementations§
source§impl RelayFamily
impl RelayFamily
sourcepub fn push(&mut self, rsa_id: RsaIdentity)
pub fn push(&mut self, rsa_id: RsaIdentity)
Add rsa_id
to this family.
sourcepub fn intern(self) -> Arc<Self>
pub fn intern(self) -> Arc<Self>
Consume this family, and return a new canonical interned representation of the family.
sourcepub fn contains(&self, rsa_id: &RsaIdentity) -> bool
pub fn contains(&self, rsa_id: &RsaIdentity) -> bool
Does this family include the given relay?
sourcepub fn members(&self) -> impl Iterator<Item = &RsaIdentity>
pub fn members(&self) -> impl Iterator<Item = &RsaIdentity>
Return an iterator over the RSA identity keys listed in this family.
Trait Implementations§
source§impl Clone for RelayFamily
impl Clone for RelayFamily
source§fn clone(&self) -> RelayFamily
fn clone(&self) -> RelayFamily
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RelayFamily
impl Debug for RelayFamily
source§impl Default for RelayFamily
impl Default for RelayFamily
source§fn default() -> RelayFamily
fn default() -> RelayFamily
Returns the “default value” for a type. Read more
source§impl FromStr for RelayFamily
impl FromStr for RelayFamily
source§impl Hash for RelayFamily
impl Hash for RelayFamily
source§impl PartialEq for RelayFamily
impl PartialEq for RelayFamily
source§fn eq(&self, other: &RelayFamily) -> bool
fn eq(&self, other: &RelayFamily) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for RelayFamily
impl StructuralPartialEq for RelayFamily
Auto Trait Implementations§
impl Freeze for RelayFamily
impl RefUnwindSafe for RelayFamily
impl Send for RelayFamily
impl Sync for RelayFamily
impl Unpin for RelayFamily
impl UnwindSafe for RelayFamily
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 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>
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