pub enum Address {
SocketAddress(SocketAddr),
DomainAddress(Box<str>, u16),
}Expand description
SOCKS5 Address Format
+------+----------+----------+
| ATYP | DST.ADDR | DST.PORT |
+------+----------+----------+
| 1 | Variable | 2 |
+------+----------+----------+Variants§
SocketAddress(SocketAddr)
Represents an IPv4 or IPv6 socket address.
DomainAddress(Box<str>, u16)
Represents a domain name and a port.
Implementations§
Source§impl Address
impl Address
Sourcepub fn unspecified() -> Address
pub fn unspecified() -> Address
Returns an unspecified IPv4 address (0.0.0.0:0).
Sourcepub fn get_type(&self) -> AddressType
pub fn get_type(&self) -> AddressType
Returns the type of the address (IPv4, IPv6, or Domain).
Sourcepub const fn max_serialized_len() -> usize
pub const fn max_serialized_len() -> usize
Returns the maximum possible serialized length of a SOCKS5 address.
Trait Implementations§
Source§impl AsyncStreamOperation for Address
impl AsyncStreamOperation for Address
fn retrieve_from_async_stream<'life0, 'async_trait, R>( stream: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Address, Error>> + Send + 'async_trait>>
fn write_to_async_stream<'life0, 'life1, 'async_trait, W>(
&'life0 self,
w: &'life1 mut W,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
W: AsyncWrite + Unpin + Send + 'async_trait + ?Sized,
Self: Sync + 'async_trait,
Source§impl<'de> Deserialize<'de> for Address
impl<'de> Deserialize<'de> for Address
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Address, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Address, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Address
Source§impl From<&SocketAddr> for Address
impl From<&SocketAddr> for Address
Source§fn from(addr: &SocketAddr) -> Address
fn from(addr: &SocketAddr) -> Address
Converts to this type from the input type.
Source§impl From<SocketAddr> for Address
impl From<SocketAddr> for Address
Source§fn from(addr: SocketAddr) -> Address
fn from(addr: SocketAddr) -> Address
Converts to this type from the input type.
Source§impl Ord for Address
impl Ord for Address
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Address
impl PartialOrd for Address
Source§impl Serialize for Address
impl Serialize for Address
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl StreamOperation for Address
impl StreamOperation for Address
impl StructuralPartialEq 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<<Address as ToSocketAddrs>::Iter, Error>
fn to_socket_addrs(&self) -> Result<<Address as ToSocketAddrs>::Iter, Error>
Converts this object to an iterator of resolved
SocketAddrs. Read moreAuto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnsafeUnpin 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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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.