pub struct HttpProxyAddressService<S> { /* private fields */ }
Expand description
A Service
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
).
Implementations§
Source§impl<S> HttpProxyAddressService<S>
impl<S> HttpProxyAddressService<S>
Sourcepub const fn new(inner: S, address: ProxyAddress) -> Self
pub const fn new(inner: S, address: ProxyAddress) -> Self
Create a new HttpProxyAddressService
that will create
a service to set the given ProxyAddress
.
Sourcepub const fn maybe(inner: S, address: Option<ProxyAddress>) -> Self
pub const fn maybe(inner: S, address: Option<ProxyAddress>) -> Self
Create a new HttpProxyAddressService
which will create
a service that will set the given ProxyAddress
if it is not
None
.
Sourcepub fn try_from_env_default(inner: S) -> Result<Self, OpaqueError>
pub fn try_from_env_default(inner: S) -> Result<Self, OpaqueError>
Try to create a new HttpProxyAddressService
which will establish
a proxy connection over the environment variable HTTP_PROXY
.
Sourcepub fn try_from_env(inner: S, key: impl AsRef<str>) -> Result<Self, OpaqueError>
pub fn try_from_env(inner: S, key: impl AsRef<str>) -> Result<Self, OpaqueError>
Try to create a new HttpProxyAddressService
which will establish
a proxy connection over the given environment variable.
Sourcepub const fn preserve(self, preserve: bool) -> Self
pub const 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<S: Clone> Clone for HttpProxyAddressService<S>
impl<S: Clone> Clone for HttpProxyAddressService<S>
Source§impl<S: Debug> Debug for HttpProxyAddressService<S>
impl<S: Debug> Debug for HttpProxyAddressService<S>
Source§impl<S, State, Request> Service<State, Request> for HttpProxyAddressService<S>
impl<S, State, Request> Service<State, Request> for HttpProxyAddressService<S>
Source§type Response = <S as Service<State, Request>>::Response
type Response = <S as Service<State, Request>>::Response
Auto Trait Implementations§
impl<S> Freeze for HttpProxyAddressService<S>where
S: Freeze,
impl<S> RefUnwindSafe for HttpProxyAddressService<S>where
S: RefUnwindSafe,
impl<S> Send for HttpProxyAddressService<S>where
S: Send,
impl<S> Sync for HttpProxyAddressService<S>where
S: Sync,
impl<S> Unpin for HttpProxyAddressService<S>where
S: Unpin,
impl<S> UnwindSafe for HttpProxyAddressService<S>where
S: UnwindSafe,
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<S, State, Request, Connection> ConnectorService<State, Request> for S
impl<S, State, Request, Connection> ConnectorService<State, Request> for S
Source§type Connection = Connection
type Connection = Connection
ConnectorService
Source§type Error = <S as Service<State, Request>>::Error
type Error = <S as Service<State, Request>>::Error
Source§fn connect(
&self,
ctx: Context<State>,
req: Request,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<State, Request>>::Connection, State, Request>, <S as ConnectorService<State, Request>>::Error>> + Send
fn connect( &self, ctx: Context<State>, req: Request, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<State, Request>>::Connection, State, Request>, <S as ConnectorService<State, Request>>::Error>> + Send
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