Struct tor_socksproto::SocksClientHandshake
source · pub struct SocksClientHandshake { /* private fields */ }Available on crate feature
client-handshake only.Expand description
The client (initiator) side of a SOCKS handshake.
Implementations§
source§impl SocksClientHandshake
impl SocksClientHandshake
sourcepub fn new(request: SocksRequest) -> Self
pub fn new(request: SocksRequest) -> Self
Construct a new SocksClientHandshake that will attempt to negotiate
with a peer using request.
sourcepub fn into_reply(self) -> Option<SocksReply>
pub fn into_reply(self) -> Option<SocksReply>
Consume this handshake’s state; if it finished successfully,
return the SocksReply that we got from the proxy..
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 proxy 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 proxy, and how much of its input to consume.
Trait Implementations§
source§impl Clone for SocksClientHandshake
impl Clone for SocksClientHandshake
source§fn clone(&self) -> SocksClientHandshake
fn clone(&self) -> SocksClientHandshake
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 moreAuto Trait Implementations§
impl Freeze for SocksClientHandshake
impl RefUnwindSafe for SocksClientHandshake
impl Send for SocksClientHandshake
impl Sync for SocksClientHandshake
impl Unpin for SocksClientHandshake
impl UnwindSafe for SocksClientHandshake
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