#[non_exhaustive]pub enum RelayIdRef<'a> {
Ed25519(&'a Ed25519Identity),
Rsa(&'a RsaIdentity),
}Expand description
A reference to a single relay identity.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Ed25519(&'a Ed25519Identity)
An Ed25519 identity.
Every relay (currently) has one of these identities. It is the same as the encoding of the relay’s public Ed25519 identity key.
Rsa(&'a RsaIdentity)
An RSA identity.
Every relay (currently) has one of these identities. It is computed as a SHA-1 digest of the DER encoding of the relay’s public RSA 1024-bit identity key. Because of short key length, this type of identity should not be considered secure on its own.
Implementations§
Source§impl<'a> RelayIdRef<'a>
impl<'a> RelayIdRef<'a>
Sourcepub fn id_type(&self) -> RelayIdType
pub fn id_type(&self) -> RelayIdType
Return the type of this relay identity.
Sourcepub fn as_bytes(&self) -> &'a [u8] ⓘ
pub fn as_bytes(&self) -> &'a [u8] ⓘ
Return a byte-slice corresponding to the contents of this identity.
Sourcepub(crate) fn unwrap_ed25519(self) -> &'a Ed25519Identity
pub(crate) fn unwrap_ed25519(self) -> &'a Ed25519Identity
Extract the Ed25519Identity from a RelayIdRef that is known to hold one.
§Panics
Panics if this is not an $vname identity.
Sourcepub(crate) fn unwrap_rsa(self) -> &'a RsaIdentity
pub(crate) fn unwrap_rsa(self) -> &'a RsaIdentity
Extract the RsaIdentity from a RelayIdRef that is known to hold one.
§Panics
Panics if this is not an $vname identity.
Trait Implementations§
Source§impl<'a> Clone for RelayIdRef<'a>
impl<'a> Clone for RelayIdRef<'a>
impl<'a> Copy for RelayIdRef<'a>
Source§impl<'a> Debug for RelayIdRef<'a>
impl<'a> Debug for RelayIdRef<'a>
Source§impl<'a> Display for RelayIdRef<'a>
impl<'a> Display for RelayIdRef<'a>
impl<'a> Eq for RelayIdRef<'a>
Source§impl<'a> From<&'a Ed25519Identity> for RelayIdRef<'a>
impl<'a> From<&'a Ed25519Identity> for RelayIdRef<'a>
Source§fn from(value: &'a Ed25519Identity) -> Self
fn from(value: &'a Ed25519Identity) -> Self
Source§impl<'a> From<&'a RelayId> for RelayIdRef<'a>
impl<'a> From<&'a RelayId> for RelayIdRef<'a>
Source§impl<'a> From<&'a RsaIdentity> for RelayIdRef<'a>
impl<'a> From<&'a RsaIdentity> for RelayIdRef<'a>
Source§fn from(value: &'a RsaIdentity) -> Self
fn from(value: &'a RsaIdentity) -> Self
Source§impl<'a> Hash for RelayIdRef<'a>
impl<'a> Hash for RelayIdRef<'a>
Source§impl<'a> Ord for RelayIdRef<'a>
impl<'a> Ord for RelayIdRef<'a>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<'a> PartialEq for RelayIdRef<'a>
impl<'a> PartialEq for RelayIdRef<'a>
Source§impl<'a> PartialEq<Ed25519Identity> for RelayIdRef<'a>
impl<'a> PartialEq<Ed25519Identity> for RelayIdRef<'a>
Source§impl<'a> PartialEq<RsaIdentity> for RelayIdRef<'a>
impl<'a> PartialEq<RsaIdentity> for RelayIdRef<'a>
Source§impl<'a> PartialOrd for RelayIdRef<'a>
impl<'a> PartialOrd for RelayIdRef<'a>
Source§impl<'a> Redactable for RelayIdRef<'a>
impl<'a> Redactable for RelayIdRef<'a>
Source§fn display_redacted(&self, f: &mut Formatter<'_>) -> Result
fn display_redacted(&self, f: &mut Formatter<'_>) -> Result
Display::fmt, but produce a redacted representation.Source§fn debug_redacted(&self, f: &mut Formatter<'_>) -> Result
fn debug_redacted(&self, f: &mut Formatter<'_>) -> Result
Debug::fmt, but produce a redacted representation.Source§fn redacted(&self) -> Redacted<&Self>
fn redacted(&self) -> Redacted<&Self>
Source§fn maybe_redacted(&self, redact: bool) -> MaybeRedacted<&Self>
fn maybe_redacted(&self, redact: bool) -> MaybeRedacted<&Self>
redact is true.Source§impl<'a> Serialize for RelayIdRef<'a>
impl<'a> Serialize for RelayIdRef<'a>
impl<'a> StructuralPartialEq for RelayIdRef<'a>
Source§impl<'a> TryFrom<RelayIdRef<'a>> for &'a Ed25519Identity
impl<'a> TryFrom<RelayIdRef<'a>> for &'a Ed25519Identity
Source§type Error = TryIntoError<RelayIdRef<'a>>
type Error = TryIntoError<RelayIdRef<'a>>
Source§fn try_from(value: RelayIdRef<'a>) -> Result<Self, TryIntoError<RelayIdRef<'a>>>
fn try_from(value: RelayIdRef<'a>) -> Result<Self, TryIntoError<RelayIdRef<'a>>>
Source§impl<'a> TryFrom<RelayIdRef<'a>> for &'a RsaIdentity
impl<'a> TryFrom<RelayIdRef<'a>> for &'a RsaIdentity
Source§type Error = TryIntoError<RelayIdRef<'a>>
type Error = TryIntoError<RelayIdRef<'a>>
Source§fn try_from(value: RelayIdRef<'a>) -> Result<Self, TryIntoError<RelayIdRef<'a>>>
fn try_from(value: RelayIdRef<'a>) -> Result<Self, TryIntoError<RelayIdRef<'a>>>
Auto Trait Implementations§
impl<'a> Freeze for RelayIdRef<'a>
impl<'a> RefUnwindSafe for RelayIdRef<'a>
impl<'a> Send for RelayIdRef<'a>
impl<'a> Sync for RelayIdRef<'a>
impl<'a> Unpin for RelayIdRef<'a>
impl<'a> UnsafeUnpin for RelayIdRef<'a>
impl<'a> UnwindSafe for RelayIdRef<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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