Struct tor_linkspec::RelayIds
source · pub struct RelayIds { /* private fields */ }Expand description
RelayIds is an owned copy of the set of known identities of a relay.
Note that an object of this type will not necessarily have every type of identity: it’s possible that we don’t know all the identities, or that one of the identity types has become optional.
Implementations§
source§impl RelayIds
impl RelayIds
sourcepub fn empty() -> Self
pub fn empty() -> Self
Return an empty set of identities.
This is not a Default method, since this is not what you should
usually construct.
sourcepub fn from_relay_ids<T: HasRelayIds + ?Sized>(other: &T) -> Self
pub fn from_relay_ids<T: HasRelayIds + ?Sized>(other: &T) -> Self
Construct a new RelayIds object from another object that implements
HasRelayIds.
Note that it is possible to construct an empty RelayIds object if
the input does not contain any recognized identity type.
Trait Implementations§
source§impl<'de> Deserialize<'de> for RelayIds
impl<'de> Deserialize<'de> for RelayIds
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl HasRelayIds for RelayIds
impl HasRelayIds for RelayIds
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: HasRelayIds + ?Sized>(&self, other: &T) -> bool
fn same_relay_ids<T: HasRelayIds + ?Sized>(&self, other: &T) -> bool
Return true if this object has exactly the same relay IDs as
other.source§fn has_all_relay_ids_from<T: HasRelayIds + ?Sized>(&self, other: &T) -> bool
fn has_all_relay_ids_from<T: HasRelayIds + ?Sized>(&self, other: &T) -> bool
Return true if this object has every relay ID that
other does. Read moresource§fn cmp_by_relay_ids<T: HasRelayIds + ?Sized>(&self, other: &T) -> Ordering
fn cmp_by_relay_ids<T: HasRelayIds + ?Sized>(&self, other: &T) -> Ordering
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.source§impl Ord for RelayIds
impl Ord for RelayIds
source§impl PartialEq<RelayIds> for RelayIds
impl PartialEq<RelayIds> for RelayIds
source§impl PartialOrd<RelayIds> for RelayIds
impl PartialOrd<RelayIds> for RelayIds
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Redactable for RelayIds
impl Redactable for RelayIds
source§fn display_redacted(&self, f: &mut Formatter<'_>) -> Result
fn display_redacted(&self, f: &mut Formatter<'_>) -> Result
As
Display::fmt, but produce a redacted representation.source§fn debug_redacted(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug_redacted(&self, f: &mut Formatter<'_>) -> Result<(), Error>
As
Debug::fmt, but produce a redacted representation.source§fn redacted(&self) -> Redacted<&Self>
fn redacted(&self) -> Redacted<&Self>
Return a smart pointer that will display or debug this object as its
redacted form.
source§fn maybe_redacted(&self, redact: bool) -> MaybeRedacted<&Self>
fn maybe_redacted(&self, redact: bool) -> MaybeRedacted<&Self>
Return a smart pointer that redacts this object if
redact is true.impl Eq for RelayIds
impl StructuralEq for RelayIds
impl StructuralPartialEq for RelayIds
Auto Trait Implementations§
impl RefUnwindSafe for RelayIds
impl Send for RelayIds
impl Sync for RelayIds
impl Unpin for RelayIds
impl UnwindSafe for RelayIds
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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.