Expand description
A collection of utilities for working with Service types and Servers.
Structs§
- Adapt
Incoming Layer incomingLayer to convert a body to useBodyas the request body fromhyper::body::Incoming. - Adapt
Incoming Service incomingAdapt a service to useBodyas the request body. - A boxed
ServiceRef. - Execute
Request clientCouples the connection with the http request. - Http1
Checks Layer clientA layer that checks if the request is HTTP/1.1 compatible. - Http1
Checks Service clientA service that checks if the request is HTTP/1.1 compatible. - Http2
Checks Layer clientALayerthat applies HTTP/2 checks to requests. - Http2
Checks Service clientA service that checks if the request is HTTP/2 compatible. - Incoming
Request Layer incomingLayer to convert a body to useBodyas the request body fromhyper::body::Incoming. - Incoming
Request Service incomingAdapt a service to useBodyas the request body. - Incoming
Response Layer incomingLayer to convert a service to useBodyas the response body fromhyper::body::Incoming. - Incoming
Response Service incomingWraps a service which returns ahttp::Response<hyper::body::Incoming>and converts it to ahttp::Response<BOut>. - Future for when a service either errors before yielding, or continues. This is us
- A middleware for an optional layer.
- A middleware for an optional layer with merged error types.
- A layer that wraps a service with a preprocessor function.
- A middleware that calls some (non-async) function before calling the inner service, and skips the inner service if the function returns an error.
- Request
Executor clientA service to execute a request on a hyper connection. - Declaratively construct
Servicevalues. - SetHost
Header clientMiddleware which sets the Host header on requests. - SetHost
Header Layer clientLayer for setting the Host header on requests. - 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§
- 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.