Enum tor_socksproto::SocksAddr
source · pub enum SocksAddr {
Hostname(SocksHostname),
Ip(IpAddr),
}
Expand description
An address sent or received as part of a SOCKS handshake
Variants§
Hostname(SocksHostname)
A regular DNS hostname.
Ip(IpAddr)
An IP address. (Tor doesn’t like to receive these during SOCKS handshakes, since they usually indicate that the hostname lookup happened somewhere else.)
Trait Implementations§
source§impl<'a> Arbitrary<'a> for SocksAddr
Available on crate feature arbitrary
only.
impl<'a> Arbitrary<'a> for SocksAddr
Available on crate feature
arbitrary
only.source§fn arbitrary(u: &mut Unstructured<'a>) -> ArbitraryResult<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> ArbitraryResult<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moresource§fn size_hint(_depth: usize) -> (usize, Option<usize>)
fn size_hint(_depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured
this type
needs to construct itself. Read moresource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moresource§impl PartialEq for SocksAddr
impl PartialEq for SocksAddr
source§impl Writeable for SocksAddr
impl Writeable for SocksAddr
source§fn write_onto<W: Writer + ?Sized>(&self, w: &mut W) -> EncodeResult<()>
fn write_onto<W: Writer + ?Sized>(&self, w: &mut W) -> EncodeResult<()>
Encode this object into the writer
b
.impl Eq for SocksAddr
impl StructuralPartialEq for SocksAddr
Auto Trait Implementations§
impl Freeze for SocksAddr
impl RefUnwindSafe for SocksAddr
impl Send for SocksAddr
impl Sync for SocksAddr
impl Unpin for SocksAddr
impl UnwindSafe for SocksAddr
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> 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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<W> WriteableOnce for Wwhere
W: Writeable,
impl<W> WriteableOnce for Wwhere
W: Writeable,
source§fn write_into<B>(self, b: &mut B) -> Result<(), EncodeError>
fn write_into<B>(self, b: &mut B) -> Result<(), EncodeError>
Encode this object into the writer
b
, and consume it.