Struct tor_socksproto::SocksHandshake
source · [−]pub struct SocksHandshake { /* private fields */ }
Expand description
An ongoing SOCKS handshake.
To perform a handshake, call the SocksHandshake::handshake
method repeatedly with new inputs, until the resulting Action
has finished
set to true.
Implementations
sourceimpl SocksHandshake
impl SocksHandshake
sourcepub fn handshake(&mut self, input: &[u8]) -> TResult<Action>
pub fn handshake(&mut self, input: &[u8]) -> TResult<Action>
Try to advance a SocksHandshake, given some client input in
input
.
If there isn’t enough input, gives a Truncated
. Other
errors 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
sourceimpl Clone for SocksHandshake
impl Clone for SocksHandshake
sourcefn clone(&self) -> SocksHandshake
fn clone(&self) -> SocksHandshake
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SocksHandshake
impl Debug for SocksHandshake
Auto Trait Implementations
impl RefUnwindSafe for SocksHandshake
impl Send for SocksHandshake
impl Sync for SocksHandshake
impl Unpin for SocksHandshake
impl UnwindSafe for SocksHandshake
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more