pub struct HttpProxyConnector<S> { /* private fields */ }
Expand description
A connector which can be used to establish a connection over an HTTP Proxy.
This behaviour is optional and only triggered in case there
is a ProxyAddress
found in the Context
.
Implementations§
Source§impl<S> HttpProxyConnector<S>
impl<S> HttpProxyConnector<S>
Sourcepub fn optional(inner: S) -> Self
pub fn optional(inner: S) -> Self
Create a new HttpProxyConnector
which will only connect via an http proxy in case the ProxyAddress
is available
in the Context
.
Sourcepub fn required(inner: S) -> Self
pub fn required(inner: S) -> Self
Create a new HttpProxyConnector
which will always connect via an http proxy, but fail in case the ProxyAddress
is
not available in the Context
.
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes self
, returning the underlying service.
Trait Implementations§
Source§impl<S: Clone> Clone for HttpProxyConnector<S>
impl<S: Clone> Clone for HttpProxyConnector<S>
Source§impl<S: Debug> Debug for HttpProxyConnector<S>
impl<S: Debug> Debug for HttpProxyConnector<S>
Source§impl<S, State, Request> Service<State, Request> for HttpProxyConnector<S>
impl<S, State, Request> Service<State, Request> for HttpProxyConnector<S>
Source§type Response = EstablishedClientConnection<<S as ConnectorService<State, Request>>::Connection, State, Request>
type Response = EstablishedClientConnection<<S as ConnectorService<State, Request>>::Connection, State, Request>
The type of response returned by the service.
Auto Trait Implementations§
impl<S> Freeze for HttpProxyConnector<S>where
S: Freeze,
impl<S> RefUnwindSafe for HttpProxyConnector<S>where
S: RefUnwindSafe,
impl<S> Send for HttpProxyConnector<S>where
S: Send,
impl<S> Sync for HttpProxyConnector<S>where
S: Sync,
impl<S> Unpin for HttpProxyConnector<S>where
S: Unpin,
impl<S> UnwindSafe for HttpProxyConnector<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
Mutably borrows from an owned value. Read more
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
Connection returned by the
ConnectorService
Source§type Error = <S as Service<State, Request>>::Error
type Error = <S as Service<State, Request>>::Error
Error returned in case of connection / setup failure
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
Establish a connection, which often involves some kind of handshake,
or connection revival.
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>
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