pub enum Address {
SocketAddr(SocketAddr),
Domain(String, u16),
}Expand description
Address type in socks5.
Variants§
Implementations§
Source§impl Address
impl Address
Sourcepub fn to_socket_addr(self) -> Result<SocketAddr>
pub fn to_socket_addr(self) -> Result<SocketAddr>
Convert Address to SocketAddr. If Address is a domain, return std::io::ErrorKind::InvalidInput
Sourcepub fn serialized_len(&self) -> Result<usize>
pub fn serialized_len(&self) -> Result<usize>
Length of Address in bytes after serialized.
Trait Implementations§
Source§impl From<SocketAddr> for Address
impl From<SocketAddr> for Address
Source§fn from(addr: SocketAddr) -> Self
fn from(addr: SocketAddr) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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