pub enum SocksAddress {
Ip(SocketAddr),
Domain {
host: String,
port: u16,
},
Custom {
network: String,
address: String,
},
}Expand description
An RFC 1928 SOCKS address or LazyCat custom-network address.
Variants§
Ip(SocketAddr)
Numeric IPv4 or IPv6 socket address.
Domain
Domain name and port resolved by the SOCKS server.
Fields
Custom
LazyCat custom network encoded into the SOCKS domain field.
Implementations§
Source§impl SocksAddress
impl SocksAddress
Sourcepub fn domain(host: impl Into<String>, port: u16) -> Result<Self, Error>
pub fn domain(host: impl Into<String>, port: u16) -> Result<Self, Error>
Construct a domain address without resolving it locally.
§Errors
Returns an error for an empty host or a host longer than 255 bytes.
Sourcepub fn custom(
network: impl Into<String>,
address: impl Into<String>,
) -> Result<Self, Error>
pub fn custom( network: impl Into<String>, address: impl Into<String>, ) -> Result<Self, Error>
Construct a LazyCat custom-network address.
§Errors
Returns an error for an empty network or when the encoded custom domain is longer than 255 bytes.
Sourcepub fn encode(&self) -> Result<Vec<u8>, Error>
pub fn encode(&self) -> Result<Vec<u8>, Error>
Encode this address using the RFC 1928 wire representation.
§Errors
Returns an error if a string address cannot fit in the one-byte length field.
Trait Implementations§
Source§impl Clone for SocksAddress
impl Clone for SocksAddress
Source§impl Debug for SocksAddress
impl Debug for SocksAddress
Source§impl Display for SocksAddress
impl Display for SocksAddress
impl Eq for SocksAddress
Source§impl From<SocketAddr> for SocksAddress
impl From<SocketAddr> for SocksAddress
Source§fn from(address: SocketAddr) -> Self
fn from(address: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl FromStr for SocksAddress
impl FromStr for SocksAddress
Source§impl Hash for SocksAddress
impl Hash for SocksAddress
Source§impl PartialEq for SocksAddress
impl PartialEq for SocksAddress
impl StructuralPartialEq for SocksAddress
Auto Trait Implementations§
impl Freeze for SocksAddress
impl RefUnwindSafe for SocksAddress
impl Send for SocksAddress
impl Sync for SocksAddress
impl Unpin for SocksAddress
impl UnsafeUnpin for SocksAddress
impl UnwindSafe for SocksAddress
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request