pub struct HttpConnector<S, I1 = (), I2 = ()> { /* private fields */ }
Expand description
A Service
which establishes an HTTP Connection.
Implementations§
Source§impl<S> HttpConnector<S>
impl<S> HttpConnector<S>
Sourcepub const fn new(inner: S) -> Self
pub const fn new(inner: S) -> Self
Create a new HttpConnector
.
Source§impl<S, I1, I2> HttpConnector<S, I1, I2>
impl<S, I1, I2> HttpConnector<S, I1, I2>
pub fn with_jit_req_inspector<T>( self, http_req_inspector: T, ) -> HttpConnector<S, T, I2>
pub fn with_svc_req_inspector<T>( self, http_req_inspector: T, ) -> HttpConnector<S, I1, T>
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes self
, returning the underlying service.
Trait Implementations§
Source§impl<S, I1, I2> Clone for HttpConnector<S, I1, I2>
impl<S, I1, I2> Clone for HttpConnector<S, I1, I2>
Source§impl<S, I1, I2, State, BodyIn, BodyOut> Service<State, Request<BodyIn>> for HttpConnector<S, I1, I2>where
I1: RequestInspector<State, Request<BodyIn>, Error: Into<BoxError>, StateOut = State, RequestOut = Request<BodyIn>>,
I2: RequestInspector<State, Request<BodyIn>, Error: Into<BoxError>, RequestOut = Request<BodyOut>> + Clone,
S: ConnectorService<State, Request<BodyIn>, Connection: Stream + Unpin, Error: Into<BoxError>>,
State: Clone + Send + Sync + 'static,
BodyIn: Body<Data: Send + 'static, Error: Into<BoxError>> + Unpin + Send + 'static,
BodyOut: Body<Data: Send + 'static, Error: Into<BoxError>> + Unpin + Send + 'static,
impl<S, I1, I2, State, BodyIn, BodyOut> Service<State, Request<BodyIn>> for HttpConnector<S, I1, I2>where
I1: RequestInspector<State, Request<BodyIn>, Error: Into<BoxError>, StateOut = State, RequestOut = Request<BodyIn>>,
I2: RequestInspector<State, Request<BodyIn>, Error: Into<BoxError>, RequestOut = Request<BodyOut>> + Clone,
S: ConnectorService<State, Request<BodyIn>, Connection: Stream + Unpin, Error: Into<BoxError>>,
State: Clone + Send + Sync + 'static,
BodyIn: Body<Data: Send + 'static, Error: Into<BoxError>> + Unpin + Send + 'static,
BodyOut: Body<Data: Send + 'static, Error: Into<BoxError>> + Unpin + Send + 'static,
Source§type Response = EstablishedClientConnection<HttpClientService<BodyOut, I2>, <I1 as RequestInspector<State, Request<BodyIn>>>::StateOut, <I1 as RequestInspector<State, Request<BodyIn>>>::RequestOut>
type Response = EstablishedClientConnection<HttpClientService<BodyOut, I2>, <I1 as RequestInspector<State, Request<BodyIn>>>::StateOut, <I1 as RequestInspector<State, Request<BodyIn>>>::RequestOut>
The type of response returned by the service.
Auto Trait Implementations§
impl<S, I1, I2> Freeze for HttpConnector<S, I1, I2>
impl<S, I1, I2> RefUnwindSafe for HttpConnector<S, I1, I2>
impl<S, I1, I2> Send for HttpConnector<S, I1, I2>
impl<S, I1, I2> Sync for HttpConnector<S, I1, I2>
impl<S, I1, I2> Unpin for HttpConnector<S, I1, I2>
impl<S, I1, I2> UnwindSafe for HttpConnector<S, I1, I2>
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