Module hyperdriver::service
source · Expand description
A collection of utilities for working with Service types and Servers.
Structs§
- Layer to convert a service which accepts a custom body type to a service which accepts a
Bodybody. - Adapt a service to use custom body types internally, while still accepting and returning
Bodyas the outer body type. - AdaptIncomingLayer
incomingLayer to convert a body to useBodyas the request body fromhyper::body::Incoming. - AdaptIncomingService
incomingAdapt a service to useBodyas the request body. - Adapt a service to externally accept and return a custom body type, but internally use
crate::Body. - Service to accept and return a custom body type, but internally use
crate::Body. - Attempts
clientA policy for retrying requests. - A boxed
ServiceRef. - A middleware for an optional layer.
- A middleware for an optional layer with merged error types.
- Retry
clientConfigure retrying requests of “failed” responses. - RetryLayer
clientRetry requests based on a policy - Declaratively construct
Servicevalues. - A
Servicethat can be cloned, sent, and shared across threads. - Applies a timeout to requests, with a custom error type.
- Layer to apply a timeout to requests, with a custom error type.
Traits§
- Extension trait for
Serviceto adapt inner body types to crate::Body. - An asynchronous function from
RequesttoResponse. - A trait for types that can be used to make HTTP services, by recieving references to connections.
- Extends
ServiceBuilderwith anoptionalmethod. - An asynchronous function from a
Requestto aResponse. - An extension trait for
Services that provides a variety of convenient adapters - A
tower::Servicewhich takes a reference to a conenction type, usually in a “make service” context. Effectively this isService<&IO>, but gets around the limitations of an impl with lifetimes.
Functions§
- Create a
MakeServicefrom a function. - Returns a new
ServiceFnwith the given closure.