pub enum Address {
SocketAddress(SocketAddr),
DomainNameAddress(String, u16),
}Expand description
SOCKS5 address type
Variants§
SocketAddress(SocketAddr)
Socket address (IP Address)
DomainNameAddress(String, u16)
Domain name address
Implementations§
Source§impl Address
impl Address
Sourcepub fn read_cursor<T: AsRef<[u8]>>(cur: &mut Cursor<T>) -> Result<Self, Error>
pub fn read_cursor<T: AsRef<[u8]>>(cur: &mut Cursor<T>) -> Result<Self, Error>
read from a cursor
Sourcepub async fn write_to<W>(&self, writer: &mut W) -> Result<()>where
W: AsyncWrite + Unpin,
pub async fn write_to<W>(&self, writer: &mut W) -> Result<()>where
W: AsyncWrite + Unpin,
Writes to writer
Sourcepub fn write_to_buf<B: BufMut>(&self, buf: &mut B)
pub fn write_to_buf<B: BufMut>(&self, buf: &mut B)
Writes to buffer
Sourcepub fn serialized_len(&self) -> usize
pub fn serialized_len(&self) -> usize
Get required buffer size for serializing
Sourcepub fn max_serialized_len() -> usize
pub fn max_serialized_len() -> usize
Get maximum required buffer size for serializing
Trait Implementations§
Source§impl From<&Address> for ServerAddr
impl From<&Address> for ServerAddr
Source§impl From<&ServerAddr> for Address
impl From<&ServerAddr> for Address
Source§fn from(addr: &ServerAddr) -> Self
fn from(addr: &ServerAddr) -> Self
Converts to this type from the input type.
Source§impl From<Address> for ServerAddr
impl From<Address> for ServerAddr
Source§impl From<ServerAddr> for Address
impl From<ServerAddr> for Address
Source§fn from(addr: ServerAddr) -> Self
fn from(addr: ServerAddr) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for Address
impl From<SocketAddr> for Address
Source§fn from(s: SocketAddr) -> Self
fn from(s: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl Ord for Address
impl Ord for Address
Source§impl PartialOrd for Address
impl PartialOrd for Address
Source§impl ToSocketAddrs for Address
impl ToSocketAddrs for Address
Source§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
SocketAddrs. Read moreimpl Eq for Address
impl StructuralPartialEq for Address
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.