#[non_exhaustive]pub enum PtTargetAddr {
IpPort(SocketAddr),
HostPort(String, u16),
None,
}
Expand description
An address that an be passed to a pluggable transport to tell it where to connect (typically, to a bridge).
Not every transport accepts all kinds of addresses.
This is semantically very similar to Option<BridgeAddr>
,
but it has some of its own conversion methods and bespoke FromStr
and Display
.
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.
IpPort(SocketAddr)
An IP address and port for a Tor relay.
This is the only address type supported by the BuiltIn transport.
HostPort(String, u16)
A hostname-and-port target address. Some transports may support this.
None
A completely absent target address. Some transports support this.
Trait Implementations§
Source§impl Clone for PtTargetAddr
impl Clone for PtTargetAddr
Source§fn clone(&self) -> PtTargetAddr
fn clone(&self) -> PtTargetAddr
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PtTargetAddr
impl Debug for PtTargetAddr
Source§impl<'de> Deserialize<'de> for PtTargetAddr
impl<'de> Deserialize<'de> for PtTargetAddr
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 Display for PtTargetAddr
impl Display for PtTargetAddr
Source§impl From<Option<BridgeAddr>> for PtTargetAddr
impl From<Option<BridgeAddr>> for PtTargetAddr
Source§fn from(pt: Option<BridgeAddr>) -> PtTargetAddr
fn from(pt: Option<BridgeAddr>) -> PtTargetAddr
Converts to this type from the input type.
Source§impl From<PtTargetAddr> for Option<BridgeAddr>
impl From<PtTargetAddr> for Option<BridgeAddr>
Source§fn from(pt: PtTargetAddr) -> Option<BridgeAddr>
fn from(pt: PtTargetAddr) -> Option<BridgeAddr>
Converts to this type from the input type.
Source§impl FromStr for PtTargetAddr
impl FromStr for PtTargetAddr
Source§impl HasAddrs for PtTargetAddr
impl HasAddrs for PtTargetAddr
Source§fn addrs(&self) -> &[SocketAddr]
fn addrs(&self) -> &[SocketAddr]
Return the addresses listed for this server. Read more
Source§impl Hash for PtTargetAddr
impl Hash for PtTargetAddr
Source§impl PartialEq for PtTargetAddr
impl PartialEq for PtTargetAddr
Source§impl Redactable for PtTargetAddr
impl Redactable for PtTargetAddr
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.Source§impl Serialize for PtTargetAddrwhere
Self: Display,
impl Serialize for PtTargetAddrwhere
Self: Display,
impl Eq for PtTargetAddr
impl StructuralPartialEq for PtTargetAddr
Auto Trait Implementations§
impl Freeze for PtTargetAddr
impl RefUnwindSafe for PtTargetAddr
impl Send for PtTargetAddr
impl Sync for PtTargetAddr
impl Unpin for PtTargetAddr
impl UnwindSafe for PtTargetAddr
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> 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