Struct Binder
pub struct Binder<S> { /* private fields */ }Available on (crate features
proxy or haproxy or socks5) and crate feature socks5 only.Expand description
Binder is used to await for the socks5 server
as it has to come back with a reply on whether or not
the server has established a connection with the socks5 server.
Binder is provided by using the Client::handshake_bind method,
and contains the bind_address to be given to the server so it knows
where to connect to.
Implementations§
§impl<S> Binder<S>
impl<S> Binder<S>
pub fn requested_bind_address(&self) -> Option<SocketAddress>
pub fn requested_bind_address(&self) -> Option<SocketAddress>
Address of the address requested by the socks5 (bind) client, if requested at all.
pub fn selected_bind_address(&self) -> SocketAddress
pub fn selected_bind_address(&self) -> SocketAddress
Address of the socket that the socks5 server has opened for the target server to connect to.
pub async fn connect(self) -> Result<BindOutput<S>, BindError<S>>
pub async fn connect(self) -> Result<BindOutput<S>, BindError<S>>
Wait for the server to connect to the socks5 server using the selected bind address.
pub fn into_stream(self) -> S
pub fn into_stream(self) -> S
Drop the Binder and return back ownership of the stream.
Note that most likely this is not what you want to do as it is in most cases not in a state useful to you.
Auto Trait Implementations§
impl<S> Freeze for Binder<S>where
S: Freeze,
impl<S> RefUnwindSafe for Binder<S>where
S: RefUnwindSafe,
impl<S> Send for Binder<S>where
S: Send,
impl<S> Sync for Binder<S>where
S: Sync,
impl<S> Unpin for Binder<S>where
S: Unpin,
impl<S> UnwindSafe for Binder<S>where
S: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more