pub struct DropContextMakeService<T, C> where
    C: Send + 'static, 
{ /* private fields */ }
Expand description

Middleware wrapper service that drops the context from the incoming request and passes the plain hyper::Request to the wrapped service.

This service can be used to to include services that take a plain hyper::Request in a CompositeService wrapped in an AddContextService.

Example Usage

In the following example SwaggerService implements hyper::service::MakeService with Request = (hyper::Request, SomeContext), and PlainService implements it with Request = hyper::Request

let swagger_service_one = SwaggerService::new();
let swagger_service_two = SwaggerService::new();
let plain_service = PlainService::new();

let mut composite_new_service = CompositeMakeService::new();
composite_new_service.push(("/base/path/1", swagger_service_one));
composite_new_service.push(("/base/path/2", swagger_service_two));
composite_new_service.push(("/base/path/3", DropContextMakeService::new(plain_service)));

Implementations

Create a new DropContextMakeService struct wrapping a value

Trait Implementations

Formats the value using the given formatter. Read more

Responses given by the service.

Errors produced by the service.

The future response value.

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more

Process the request and return the response asynchronously. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more