Enum tor_linkspec::LinkSpec
source · #[non_exhaustive]pub enum LinkSpec {
OrPort(IpAddr, u16),
RsaId(RsaIdentity),
Ed25519Id(Ed25519Identity),
Unrecognized(LinkSpecType, Vec<u8>),
}Expand description
A piece of information about a relay and how to connect to it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
OrPort(IpAddr, u16)
The TCP address of an OR Port for a relay
RsaId(RsaIdentity)
The RSA identity fingerprint of the relay
Ed25519Id(Ed25519Identity)
The Ed25519 identity of the relay
Unrecognized(LinkSpecType, Vec<u8>)
A link specifier that we didn’t recognize
Implementations§
source§impl LinkSpec
impl LinkSpec
sourcepub fn sort_by_type(lst: &mut [Self])
pub fn sort_by_type(lst: &mut [Self])
Sort a slice of LinkSpec based on the order in which they should appear in an EXTEND cell.
sourcepub fn encode(&self) -> EncodeResult<EncodedLinkSpec>
pub fn encode(&self) -> EncodeResult<EncodedLinkSpec>
Return an encoded version of this link specifier.
Trait Implementations§
source§impl From<&SocketAddr> for LinkSpec
impl From<&SocketAddr> for LinkSpec
source§fn from(sa: &SocketAddr) -> Self
fn from(sa: &SocketAddr) -> Self
Converts to this type from the input type.
source§impl From<Ed25519Identity> for LinkSpec
impl From<Ed25519Identity> for LinkSpec
source§fn from(id: Ed25519Identity) -> Self
fn from(id: Ed25519Identity) -> Self
Converts to this type from the input type.
source§impl From<VerifyingKey> for LinkSpec
impl From<VerifyingKey> for LinkSpec
source§impl From<RsaIdentity> for LinkSpec
impl From<RsaIdentity> for LinkSpec
source§fn from(id: RsaIdentity) -> Self
fn from(id: RsaIdentity) -> Self
Converts to this type from the input type.
source§impl From<SocketAddr> for LinkSpec
impl From<SocketAddr> for LinkSpec
source§fn from(sa: SocketAddr) -> Self
fn from(sa: SocketAddr) -> Self
Converts to this type from the input type.
source§impl Writeable for LinkSpec
impl Writeable for LinkSpec
source§fn write_onto<B: Writer + ?Sized>(&self, w: &mut B) -> EncodeResult<()>
fn write_onto<B: Writer + ?Sized>(&self, w: &mut B) -> EncodeResult<()>
Encode this object into the writer
b.impl Eq for LinkSpec
impl StructuralPartialEq for LinkSpec
Auto Trait Implementations§
impl Freeze for LinkSpec
impl RefUnwindSafe for LinkSpec
impl Send for LinkSpec
impl Sync for LinkSpec
impl Unpin for LinkSpec
impl UnwindSafe for LinkSpec
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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
Compare self to
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>
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 moresource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<W> WriteableOnce for Wwhere
W: Writeable,
impl<W> WriteableOnce for Wwhere
W: Writeable,
source§fn write_into<B>(self, b: &mut B) -> Result<(), EncodeError>
fn write_into<B>(self, b: &mut B) -> Result<(), EncodeError>
Encode this object into the writer
b, and consume it.