#[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
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.
Implementations§
Source§impl PtTargetAddr
impl PtTargetAddr
Sourcefn as_bridge_ref(&self) -> Option<BridgeAddrInner<&SocketAddr, &str>>
fn as_bridge_ref(&self) -> Option<BridgeAddrInner<&SocketAddr, &str>>
Obtain an Option<BridgeAddrInner>
containing references
This is a useful helper for display-like implementations,
which can then implement for PtTargetAddr
in terms of the impls for BridgeAddrInner
.
(See the code comment for PtTargetAddr
.)
Trait Implementations§
Source§impl Clone for PtTargetAddr
impl Clone for PtTargetAddr
Source§fn clone(&self) -> PtTargetAddr
fn clone(&self) -> PtTargetAddr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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
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>
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]
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
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>
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 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
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
§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
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>
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