Struct Socks5ProxyConnectorLayer
pub struct Socks5ProxyConnectorLayer { /* private fields */ }Expand description
A Layer which wraps the given service with a Socks5ProxyConnector.
See Socks5ProxyConnector for more information.
Implementations§
§impl Socks5ProxyConnectorLayer
impl Socks5ProxyConnectorLayer
pub fn optional() -> Socks5ProxyConnectorLayer
pub fn optional() -> Socks5ProxyConnectorLayer
Create a new Socks5ProxyConnectorLayer which creates a Socks5ProxyConnector
which will only connect via a socks5 proxy in case the ProxyAddress is available
in the Context.
pub fn required() -> Socks5ProxyConnectorLayer
pub fn required() -> Socks5ProxyConnectorLayer
Create a new Socks5ProxyConnectorLayer which creates a Socks5ProxyConnector
which will always connect via an http proxy, but fail in case the ProxyAddress is
not available in the Context.
§impl Socks5ProxyConnectorLayer
impl Socks5ProxyConnectorLayer
pub fn with_default_dns_resolver(self) -> Socks5ProxyConnectorLayer
pub fn with_default_dns_resolver(self) -> Socks5ProxyConnectorLayer
Attach the Default DnsResolver to this Socks5ProxyConnectorLayer.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn set_default_dns_resolver(&mut self) -> &mut Socks5ProxyConnectorLayer
pub fn set_default_dns_resolver(&mut self) -> &mut Socks5ProxyConnectorLayer
Attach the Default DnsResolver to this Socks5ProxyConnectorLayer.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn with_dns_resolver(
self,
resolver: impl DnsResolver,
) -> Socks5ProxyConnectorLayer
pub fn with_dns_resolver( self, resolver: impl DnsResolver, ) -> Socks5ProxyConnectorLayer
Attach a DnsResolver to this Socks5ProxyConnectorLayer.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn set_dns_resolver(
&mut self,
resolver: impl DnsResolver,
) -> &mut Socks5ProxyConnectorLayer
pub fn set_dns_resolver( &mut self, resolver: impl DnsResolver, ) -> &mut Socks5ProxyConnectorLayer
Attach a DnsResolver to this Socks5ProxyConnectorLayer.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
Trait Implementations§
§impl Clone for Socks5ProxyConnectorLayer
impl Clone for Socks5ProxyConnectorLayer
§fn clone(&self) -> Socks5ProxyConnectorLayer
fn clone(&self) -> Socks5ProxyConnectorLayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for Socks5ProxyConnectorLayer
impl Debug for Socks5ProxyConnectorLayer
§impl Default for Socks5ProxyConnectorLayer
impl Default for Socks5ProxyConnectorLayer
§fn default() -> Socks5ProxyConnectorLayer
fn default() -> Socks5ProxyConnectorLayer
§impl<S> Layer<S> for Socks5ProxyConnectorLayer
impl<S> Layer<S> for Socks5ProxyConnectorLayer
§type Service = Socks5ProxyConnector<S>
type Service = Socks5ProxyConnector<S>
§fn layer(&self, inner: S) -> <Socks5ProxyConnectorLayer as Layer<S>>::Service
fn layer(&self, inner: S) -> <Socks5ProxyConnectorLayer as Layer<S>>::Service
§fn into_layer(
self,
inner: S,
) -> <Socks5ProxyConnectorLayer as Layer<S>>::Service
fn into_layer( self, inner: S, ) -> <Socks5ProxyConnectorLayer as Layer<S>>::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl Freeze for Socks5ProxyConnectorLayer
impl !RefUnwindSafe for Socks5ProxyConnectorLayer
impl Send for Socks5ProxyConnectorLayer
impl Sync for Socks5ProxyConnectorLayer
impl Unpin for Socks5ProxyConnectorLayer
impl !UnwindSafe for Socks5ProxyConnectorLayer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> ⓘ
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> ⓘ
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>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more