pub trait HasRelayIds {
    fn identity(&self, key_type: RelayIdType) -> Option<RelayIdRef<'_>>;

    fn identities(&self) -> RelayIdIter<'_, Self> { ... }
    fn ed_identity(&self) -> Option<&Ed25519Identity> { ... }
    fn rsa_identity(&self) -> Option<&RsaIdentity> { ... }
    fn has_identity(&self, id: RelayIdRef<'_>) -> bool { ... }
    fn same_relay_ids<T: HasRelayIds + ?Sized>(&self, other: &T) -> bool { ... }
    fn has_all_relay_ids_from<T: HasRelayIds + ?Sized>(&self, other: &T) -> bool { ... }
}
Expand description

An object containing information about a relay’s identity keys.

This trait has a fairly large number of methods, most of which you’re not actually expected to implement. The only one that you need to provide is identity.

Required Methods

Return the identity of this relay whose type is key_type, or None if the relay has no such identity.

(Currently all relays have all recognized identity types, but we might implement or deprecate an identity type in the future.)

Provided Methods

Return an iterator over all of the identities held by this object.

Return the ed25519 identity for this relay if it has one.

Return the RSA identity for this relay if it has one.

Check whether the provided Id is a known identity of this relay.

Remember that a given set of identity keys may be incomplete: some objects that represent a relay have only a subset of the relay’s identities. Therefore, a “true” answer means that the relay has this identity, but a “false” answer could mean that the relay has a different identity of this type, or that it has no known identity of this type.

Return true if this object has exactly the same relay IDs as other.

Return true if this object has every relay ID that other does.

(It still returns true if there are some IDs in this object that are not present in other.)

Implementors