Struct HttpProxyAddressLayer
pub struct HttpProxyAddressLayer { /* private fields */ }Expand description
A Layer which allows you to add a ProxyAddress
to the Context in order to have your client connector
make a connection via this proxy (e.g. by using HttpProxyConnectorLayer).
See HttpProxyAddressService for more information.
Implementations§
§impl HttpProxyAddressLayer
impl HttpProxyAddressLayer
pub fn new(address: ProxyAddress) -> HttpProxyAddressLayer
pub fn new(address: ProxyAddress) -> HttpProxyAddressLayer
Create a new HttpProxyAddressLayer that will create
a service to set the given ProxyAddress.
pub fn maybe(address: Option<ProxyAddress>) -> HttpProxyAddressLayer
pub fn maybe(address: Option<ProxyAddress>) -> HttpProxyAddressLayer
Create a new HttpProxyAddressLayer which will create
a service that will set the given ProxyAddress if it is not
None.
pub fn try_from_env_default() -> Result<HttpProxyAddressLayer, OpaqueError>
pub fn try_from_env_default() -> Result<HttpProxyAddressLayer, OpaqueError>
Try to create a new HttpProxyAddressLayer which will establish
a proxy connection over the environment variable HTTP_PROXY.
pub fn try_from_env(
key: impl AsRef<str>,
) -> Result<HttpProxyAddressLayer, OpaqueError>
pub fn try_from_env( key: impl AsRef<str>, ) -> Result<HttpProxyAddressLayer, OpaqueError>
Try to create a new HttpProxyAddressLayer which will establish
a proxy connection over the given environment variable.
pub fn preserve(self, preserve: bool) -> HttpProxyAddressLayer
pub fn preserve(self, preserve: bool) -> HttpProxyAddressLayer
Preserve the existing ProxyAddress in the context if it already exists.
pub fn set_preserve(&mut self, preserve: bool) -> &mut HttpProxyAddressLayer
pub fn set_preserve(&mut self, preserve: bool) -> &mut HttpProxyAddressLayer
Preserve the existing ProxyAddress in the context if it already exists.
Trait Implementations§
§impl Clone for HttpProxyAddressLayer
impl Clone for HttpProxyAddressLayer
§fn clone(&self) -> HttpProxyAddressLayer
fn clone(&self) -> HttpProxyAddressLayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for HttpProxyAddressLayer
impl Debug for HttpProxyAddressLayer
§impl Default for HttpProxyAddressLayer
impl Default for HttpProxyAddressLayer
§fn default() -> HttpProxyAddressLayer
fn default() -> HttpProxyAddressLayer
§impl<S> Layer<S> for HttpProxyAddressLayer
impl<S> Layer<S> for HttpProxyAddressLayer
§type Service = HttpProxyAddressService<S>
type Service = HttpProxyAddressService<S>
§fn layer(&self, inner: S) -> <HttpProxyAddressLayer as Layer<S>>::Service
fn layer(&self, inner: S) -> <HttpProxyAddressLayer as Layer<S>>::Service
§fn into_layer(self, inner: S) -> <HttpProxyAddressLayer as Layer<S>>::Service
fn into_layer(self, inner: S) -> <HttpProxyAddressLayer as Layer<S>>::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl Freeze for HttpProxyAddressLayer
impl RefUnwindSafe for HttpProxyAddressLayer
impl Send for HttpProxyAddressLayer
impl Sync for HttpProxyAddressLayer
impl Unpin for HttpProxyAddressLayer
impl UnwindSafe for HttpProxyAddressLayer
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