pub enum TargetAddr<'a> {
Ip(SocketAddr),
Domain(Cow<'a, str>, u16),
}
Expand description
A SOCKS connection target.
Variants§
Ip(SocketAddr)
Connect to an IP address.
Domain(Cow<'a, str>, u16)
Connect to a fully-qualified domain name.
The domain name will be passed along to the proxy server and DNS lookup will happen there.
Implementations§
Source§impl TargetAddr<'_>
impl TargetAddr<'_>
Sourcepub fn to_owned(&self) -> TargetAddr<'static>
pub fn to_owned(&self) -> TargetAddr<'static>
Creates owned TargetAddr
by cloning. It is usually used to eliminate
the lifetime bound.
Trait Implementations§
Source§impl<'a> Clone for TargetAddr<'a>
impl<'a> Clone for TargetAddr<'a>
Source§fn clone(&self) -> TargetAddr<'a>
fn clone(&self) -> TargetAddr<'a>
Returns a duplicate 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<'a> Debug for TargetAddr<'a>
impl<'a> Debug for TargetAddr<'a>
Source§impl Display for TargetAddr<'_>
impl Display for TargetAddr<'_>
Source§impl<'a> IntoTargetAddr<'a> for TargetAddr<'a>
impl<'a> IntoTargetAddr<'a> for TargetAddr<'a>
Source§fn into_target_addr(self) -> Result<TargetAddr<'a>>
fn into_target_addr(self) -> Result<TargetAddr<'a>>
Converts the value of self to a
TargetAddr
.Source§impl<'a> PartialEq for TargetAddr<'a>
impl<'a> PartialEq for TargetAddr<'a>
Source§impl ToSocketAddrs for TargetAddr<'_>
impl ToSocketAddrs for TargetAddr<'_>
Source§type Iter = Either<IntoIter<SocketAddr>, IntoIter<SocketAddr>>
type Iter = Either<IntoIter<SocketAddr>, IntoIter<SocketAddr>>
Returned iterator over socket addresses which this type may correspond
to.
Source§fn to_socket_addrs(&self) -> IoResult<Self::Iter>
fn to_socket_addrs(&self) -> IoResult<Self::Iter>
Converts this object to an iterator of resolved
SocketAddr
s. Read moreimpl<'a> Eq for TargetAddr<'a>
impl<'a> StructuralPartialEq for TargetAddr<'a>
Auto Trait Implementations§
impl<'a> Freeze for TargetAddr<'a>
impl<'a> RefUnwindSafe for TargetAddr<'a>
impl<'a> Send for TargetAddr<'a>
impl<'a> Sync for TargetAddr<'a>
impl<'a> Unpin for TargetAddr<'a>
impl<'a> UnwindSafe for TargetAddr<'a>
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§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 moreLayout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes
Size for each variant:
Ip
: 34 bytesDomain
: 30 bytes