Enum tor_linkspec::PtTargetAddr
source · #[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 PtTargetAddrwhere
Self: FromStr,
<Self as FromStr>::Err: Display,
impl<'de> Deserialize<'de> for PtTargetAddrwhere
Self: FromStr,
<Self as FromStr>::Err: Display,
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<PtTargetAddr> for PtTargetAddr
impl PartialEq<PtTargetAddr> for PtTargetAddr
source§fn eq(&self, other: &PtTargetAddr) -> bool
fn eq(&self, other: &PtTargetAddr) -> bool
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. Read more
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.