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 const fn empty() -> Self
pub const 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 has_any_relay_id_from<T: HasRelayIds + ?Sized>(&self, other: &T) -> bool
fn has_any_relay_id_from<T: HasRelayIds + ?Sized>(&self, other: &T) -> bool
Return true if this object has any relay ID that
other
has. 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 PartialOrd for RelayIds
impl PartialOrd for RelayIds
Source§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 StructuralPartialEq for RelayIds
Auto Trait Implementations§
impl Freeze for RelayIds
impl RefUnwindSafe for RelayIds
impl Send for RelayIds
impl Sync for RelayIds
impl Unpin for RelayIds
impl UnwindSafe for RelayIds
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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