pub struct ExecuteRequest<C: Connection<B> + PoolableConnection, B> { /* private fields */ }Available on crate feature
client only.Expand description
Couples the connection with the http request.
This allows downstream services to access both the request and connection
– they are needed in tandem to send the request. This also means that
middleware can implement tower::Service on tower::Service<ExecuteRequest<C, B>>
to modify the request before it is sent in the context of the connection.
See crate::service::SetHostHeader for an example of a middleware that modifies
the request before it is sent in the context of the connection.
Implementations§
Source§impl<C: Connection<B> + PoolableConnection, B> ExecuteRequest<C, B>
impl<C: Connection<B> + PoolableConnection, B> ExecuteRequest<C, B>
Sourcepub fn into_parts(self) -> (Pooled<C>, Request<B>)
pub fn into_parts(self) -> (Pooled<C>, Request<B>)
Split the request into its parts.
Sourcepub fn connection(&self) -> &C
pub fn connection(&self) -> &C
A reference to the connection.
Sourcepub fn request_mut(&mut self) -> &mut Request<B>
pub fn request_mut(&mut self) -> &mut Request<B>
A mutable reference to the request.
Trait Implementations§
Source§impl<C: Debug + Connection<B> + PoolableConnection, B: Debug> Debug for ExecuteRequest<C, B>
impl<C: Debug + Connection<B> + PoolableConnection, B: Debug> Debug for ExecuteRequest<C, B>
Source§impl<S, C, B> Service<ExecuteRequest<C, B>> for Http1ChecksService<S, C, B>
impl<S, C, B> Service<ExecuteRequest<C, B>> for Http1ChecksService<S, C, B>
Source§type Response = <S as Service<ExecuteRequest<C, B>>>::Response
type Response = <S as Service<ExecuteRequest<C, B>>>::Response
Responses given by the service.
Source§type Future = MaybeErrorFuture<<S as Service<ExecuteRequest<C, B>>>::Future, <S as Service<ExecuteRequest<C, B>>>::Response, <S as Service<ExecuteRequest<C, B>>>::Error>
type Future = MaybeErrorFuture<<S as Service<ExecuteRequest<C, B>>>::Future, <S as Service<ExecuteRequest<C, B>>>::Response, <S as Service<ExecuteRequest<C, B>>>::Error>
The future response value.
Source§impl<S, C, B> Service<ExecuteRequest<C, B>> for Http2ChecksService<S, C, B>
impl<S, C, B> Service<ExecuteRequest<C, B>> for Http2ChecksService<S, C, B>
Source§type Response = <S as Service<ExecuteRequest<C, B>>>::Response
type Response = <S as Service<ExecuteRequest<C, B>>>::Response
Responses given by the service.
Source§type Future = MaybeErrorFuture<<S as Service<ExecuteRequest<C, B>>>::Future, <S as Service<ExecuteRequest<C, B>>>::Response, <S as Service<ExecuteRequest<C, B>>>::Error>
type Future = MaybeErrorFuture<<S as Service<ExecuteRequest<C, B>>>::Future, <S as Service<ExecuteRequest<C, B>>>::Response, <S as Service<ExecuteRequest<C, B>>>::Error>
The future response value.
Source§impl<C, B> Service<ExecuteRequest<C, B>> for RequestExecutor<C, B>
impl<C, B> Service<ExecuteRequest<C, B>> for RequestExecutor<C, B>
Source§type Future = Pin<Box<dyn Future<Output = Result<<RequestExecutor<C, B> as Service<ExecuteRequest<C, B>>>::Response, <RequestExecutor<C, B> as Service<ExecuteRequest<C, B>>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<RequestExecutor<C, B> as Service<ExecuteRequest<C, B>>>::Response, <RequestExecutor<C, B> as Service<ExecuteRequest<C, B>>>::Error>> + Send>>
The future response value.
Source§impl<S, B, C> Service<ExecuteRequest<C, B>> for SetHostHeader<S>
impl<S, B, C> Service<ExecuteRequest<C, B>> for SetHostHeader<S>
Auto Trait Implementations§
impl<C, B> !Freeze for ExecuteRequest<C, B>
impl<C, B> !RefUnwindSafe for ExecuteRequest<C, B>
impl<C, B> Send for ExecuteRequest<C, B>where
B: Send,
impl<C, B> Sync for ExecuteRequest<C, B>
impl<C, B> Unpin for ExecuteRequest<C, B>where
B: Unpin,
impl<C, B> !UnwindSafe for ExecuteRequest<C, B>
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