pub struct ExecuteRequest<C: Connection<B> + PoolableConnection, B, K: Key> { /* 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, K: Key> ExecuteRequest<C, B, K>
impl<C: Connection<B> + PoolableConnection, B, K: Key> ExecuteRequest<C, B, K>
sourcepub fn into_parts(self) -> (Pooled<C, K>, Request<B>)
pub fn into_parts(self) -> (Pooled<C, K>, 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, K: Debug + Key> Debug for ExecuteRequest<C, B, K>
impl<C: Debug + Connection<B> + PoolableConnection, B: Debug, K: Debug + Key> Debug for ExecuteRequest<C, B, K>
source§impl<S, C, B, K> Service<ExecuteRequest<C, B, K>> for Http1ChecksService<S, C, B, K>where
S: Service<ExecuteRequest<C, B, K>, Error = Error>,
C: Connection<B> + PoolableConnection,
K: Key,
impl<S, C, B, K> Service<ExecuteRequest<C, B, K>> for Http1ChecksService<S, C, B, K>where
S: Service<ExecuteRequest<C, B, K>, Error = Error>,
C: Connection<B> + PoolableConnection,
K: Key,
source§type Response = <S as Service<ExecuteRequest<C, B, K>>>::Response
type Response = <S as Service<ExecuteRequest<C, B, K>>>::Response
Responses given by the service.
source§type Future = MaybeErrorFuture<<S as Service<ExecuteRequest<C, B, K>>>::Future, <S as Service<ExecuteRequest<C, B, K>>>::Response, <S as Service<ExecuteRequest<C, B, K>>>::Error>
type Future = MaybeErrorFuture<<S as Service<ExecuteRequest<C, B, K>>>::Future, <S as Service<ExecuteRequest<C, B, K>>>::Response, <S as Service<ExecuteRequest<C, B, K>>>::Error>
The future response value.
source§impl<S, C, B, K> Service<ExecuteRequest<C, B, K>> for Http2ChecksService<S, C, B, K>where
S: Service<ExecuteRequest<C, B, K>, Error = Error>,
C: Connection<B> + PoolableConnection,
K: Key,
impl<S, C, B, K> Service<ExecuteRequest<C, B, K>> for Http2ChecksService<S, C, B, K>where
S: Service<ExecuteRequest<C, B, K>, Error = Error>,
C: Connection<B> + PoolableConnection,
K: Key,
source§type Response = <S as Service<ExecuteRequest<C, B, K>>>::Response
type Response = <S as Service<ExecuteRequest<C, B, K>>>::Response
Responses given by the service.
source§type Future = MaybeErrorFuture<<S as Service<ExecuteRequest<C, B, K>>>::Future, <S as Service<ExecuteRequest<C, B, K>>>::Response, <S as Service<ExecuteRequest<C, B, K>>>::Error>
type Future = MaybeErrorFuture<<S as Service<ExecuteRequest<C, B, K>>>::Future, <S as Service<ExecuteRequest<C, B, K>>>::Response, <S as Service<ExecuteRequest<C, B, K>>>::Error>
The future response value.
source§impl<C, B, K> Service<ExecuteRequest<C, B, K>> for RequestExecutor<C, B, K>
impl<C, B, K> Service<ExecuteRequest<C, B, K>> for RequestExecutor<C, B, K>
source§type Future = Pin<Box<dyn Future<Output = Result<<RequestExecutor<C, B, K> as Service<ExecuteRequest<C, B, K>>>::Response, <RequestExecutor<C, B, K> as Service<ExecuteRequest<C, B, K>>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<RequestExecutor<C, B, K> as Service<ExecuteRequest<C, B, K>>>::Response, <RequestExecutor<C, B, K> as Service<ExecuteRequest<C, B, K>>>::Error>> + Send>>
The future response value.
source§impl<S, B, C, K> Service<ExecuteRequest<C, B, K>> for SetHostHeader<S>
impl<S, B, C, K> Service<ExecuteRequest<C, B, K>> for SetHostHeader<S>
Auto Trait Implementations§
impl<C, B, K> !Freeze for ExecuteRequest<C, B, K>
impl<C, B, K> !RefUnwindSafe for ExecuteRequest<C, B, K>
impl<C, B, K> Send for ExecuteRequest<C, B, K>where
B: Send,
impl<C, B, K> Sync for ExecuteRequest<C, B, K>
impl<C, B, K> Unpin for ExecuteRequest<C, B, K>where
B: Unpin,
impl<C, B, K> !UnwindSafe for ExecuteRequest<C, B, K>
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