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
sourceimpl RelayIds
impl RelayIds
sourcepub fn new(ed_identity: Ed25519Identity, rsa_identity: RsaIdentity) -> Self
pub fn new(ed_identity: Ed25519Identity, rsa_identity: RsaIdentity) -> Self
Construct a new RelayIds object with a given pair of identity keys.
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
sourceimpl<'de> Deserialize<'de> for RelayIds
impl<'de> Deserialize<'de> for RelayIds
sourcefn 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
sourceimpl HasRelayIds for RelayIds
impl HasRelayIds for RelayIds
sourcefn 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 moresourcefn identities(&self) -> RelayIdIter<'_, Self>
fn identities(&self) -> RelayIdIter<'_, Self>
Return an iterator over all of the identities held by this object.
sourcefn ed_identity(&self) -> Option<&Ed25519Identity>
fn ed_identity(&self) -> Option<&Ed25519Identity>
Return the ed25519 identity for this relay if it has one.
sourcefn rsa_identity(&self) -> Option<&RsaIdentity>
fn rsa_identity(&self) -> Option<&RsaIdentity>
Return the RSA identity for this relay if it has one.
sourcefn 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
sourcefn 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.sourcefn 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 moresourceimpl Ord for RelayIds
impl Ord for RelayIds
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<RelayIds> for RelayIds
impl PartialOrd<RelayIds> for RelayIds
sourcefn partial_cmp(&self, other: &RelayIds) -> Option<Ordering>
fn partial_cmp(&self, other: &RelayIds) -> Option<Ordering>
1.0.0 · sourcefn 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 moreimpl 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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