Enum fast_socks5::util::target_addr::TargetAddr
source · pub enum TargetAddr {
Ip(SocketAddr),
Domain(String, u16),
}
Expand description
A description of a connection target.
Variants§
Ip(SocketAddr)
Connect to an IP address.
Domain(String, 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
pub async fn resolve_dns(self) -> Result<TargetAddr>
pub fn is_ip(&self) -> bool
pub fn is_domain(&self) -> bool
pub fn to_be_bytes(&self) -> Result<Vec<u8>>
Trait Implementations§
source§impl Clone for TargetAddr
impl Clone for TargetAddr
source§fn clone(&self) -> TargetAddr
fn clone(&self) -> TargetAddr
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 TargetAddr
impl Debug for TargetAddr
source§impl Display for TargetAddr
impl Display for TargetAddr
source§impl Hash for TargetAddr
impl Hash for TargetAddr
source§impl PartialEq for TargetAddr
impl PartialEq for TargetAddr
source§fn eq(&self, other: &TargetAddr) -> bool
fn eq(&self, other: &TargetAddr) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ToSocketAddrs for TargetAddr
impl ToSocketAddrs for TargetAddr
§type Iter = IntoIter<SocketAddr>
type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond
to.
source§fn to_socket_addrs(&self) -> Result<IntoIter<SocketAddr>>
fn to_socket_addrs(&self) -> Result<IntoIter<SocketAddr>>
Converts this object to an iterator of resolved
SocketAddr
s. Read moreimpl Eq for TargetAddr
impl StructuralPartialEq for TargetAddr
Auto Trait Implementations§
impl Freeze for TargetAddr
impl RefUnwindSafe for TargetAddr
impl Send for TargetAddr
impl Sync for TargetAddr
impl Unpin for TargetAddr
impl UnwindSafe for TargetAddr
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