Struct tor_socksproto::SocksProxyHandshake
source · pub struct SocksProxyHandshake { /* private fields */ }
Available on crate feature
proxy-handshake
only.Expand description
The Proxy (responder) side of an ongoing SOCKS handshake.
To perform a handshake, call the SocksProxyHandshake::handshake
method repeatedly with new inputs, until the resulting Action
has finished
set to true.
Implementations§
source§impl SocksProxyHandshake
impl SocksProxyHandshake
sourcepub fn handshake(&mut self, input: &[u8]) -> TResult<Action>
pub fn handshake(&mut self, input: &[u8]) -> TResult<Action>
Try to advance a SocksProxyHandshake, given some client input in
input
.
If there isn’t enough input, gives a Truncated
.
In this case, the caller must retain the input, and pass it to a later
invocation of handshake
. Input should only be regarded as consumed when
the Action::drain
field is nonzero.
Other errors (besides Truncated
) indicate a failure.
On success, return an Action describing what to tell the client, and how much of its input to consume.
sourcepub fn into_request(self) -> Option<SocksRequest>
pub fn into_request(self) -> Option<SocksRequest>
Consume this handshake’s state; if it finished successfully, return a SocksRequest.
Trait Implementations§
source§impl Clone for SocksProxyHandshake
impl Clone for SocksProxyHandshake
source§fn clone(&self) -> SocksProxyHandshake
fn clone(&self) -> SocksProxyHandshake
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SocksProxyHandshake
impl Debug for SocksProxyHandshake
Auto Trait Implementations§
impl Freeze for SocksProxyHandshake
impl RefUnwindSafe for SocksProxyHandshake
impl Send for SocksProxyHandshake
impl Sync for SocksProxyHandshake
impl Unpin for SocksProxyHandshake
impl UnwindSafe for SocksProxyHandshake
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 more