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§
Source§impl HttpProxyAddressLayer
impl HttpProxyAddressLayer
Sourcepub fn new(address: ProxyAddress) -> Self
pub fn new(address: ProxyAddress) -> Self
Create a new HttpProxyAddressLayer
that will create
a service to set the given ProxyAddress
.
Sourcepub fn maybe(address: Option<ProxyAddress>) -> Self
pub fn maybe(address: Option<ProxyAddress>) -> Self
Create a new HttpProxyAddressLayer
which will create
a service that will set the given ProxyAddress
if it is not
None
.
Sourcepub fn try_from_env_default() -> Result<Self, OpaqueError>
pub fn try_from_env_default() -> Result<Self, OpaqueError>
Try to create a new HttpProxyAddressLayer
which will establish
a proxy connection over the environment variable HTTP_PROXY
.
Sourcepub fn try_from_env(key: impl AsRef<str>) -> Result<Self, OpaqueError>
pub fn try_from_env(key: impl AsRef<str>) -> Result<Self, OpaqueError>
Try to create a new HttpProxyAddressLayer
which will establish
a proxy connection over the given environment variable.
Sourcepub fn preserve(self, preserve: bool) -> Self
pub fn preserve(self, preserve: bool) -> Self
Preserve the existing ProxyAddress
in the context if it already exists.
Sourcepub fn set_preserve(&mut self, preserve: bool) -> &mut Self
pub fn set_preserve(&mut self, preserve: bool) -> &mut Self
Preserve the existing ProxyAddress
in the context if it already exists.
Trait Implementations§
Source§impl Clone for HttpProxyAddressLayer
impl Clone for HttpProxyAddressLayer
Source§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 moreSource§impl Debug for HttpProxyAddressLayer
impl Debug for HttpProxyAddressLayer
Source§impl Default for HttpProxyAddressLayer
impl Default for HttpProxyAddressLayer
Source§fn default() -> HttpProxyAddressLayer
fn default() -> HttpProxyAddressLayer
Auto 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§
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,
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>
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