Struct tor_netdoc::types::family::RelayFamily
source · [−]pub struct RelayFamily(_);
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
sourceimpl 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
sourceimpl Clone for RelayFamily
impl Clone for RelayFamily
sourcefn clone(&self) -> RelayFamily
fn clone(&self) -> RelayFamily
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RelayFamily
impl Debug for RelayFamily
sourceimpl Default for RelayFamily
impl Default for RelayFamily
sourcefn default() -> RelayFamily
fn default() -> RelayFamily
Returns the “default value” for a type. Read more
sourceimpl FromStr for RelayFamily
impl FromStr for RelayFamily
sourceimpl Hash for RelayFamily
impl Hash for RelayFamily
sourceimpl PartialEq<RelayFamily> for RelayFamily
impl PartialEq<RelayFamily> for RelayFamily
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &RelayFamily) -> bool
fn ne(&self, other: &RelayFamily) -> bool
This method tests for !=
.
impl Eq for RelayFamily
impl StructuralEq for RelayFamily
impl StructuralPartialEq for RelayFamily
Auto Trait Implementations
impl RefUnwindSafe for RelayFamily
impl Send for RelayFamily
impl Sync for RelayFamily
impl Unpin for RelayFamily
impl UnwindSafe for RelayFamily
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more