Struct swagger::drop_context::DropContext[][src]

pub struct DropContext<T, C> { /* fields omitted */ }

Middleware wrapper service that trops 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 AddContext service.

Example Usage

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

This example is not tested
let swagger_service_one = SwaggerService::new();
let swagger_service_two = SwaggerService::new();
let plain_service = PlainService::new();

let mut composite_new_service = CompositeNewService::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", DropContext::new(plain_service)));

Methods

impl<T, C> DropContext<T, C>
[src]

Create a new DropContext struct wrapping a value

Trait Implementations

impl<T: Debug, C: Debug> Debug for DropContext<T, C>
[src]

Formats the value using the given formatter. Read more

impl<T, C> NewService for DropContext<T, C> where
    T: NewService<Request = Request, Response = Response, Error = Error>, 
[src]

Requests handled by the service

Responses given by the service

Errors produced by the service

The Service value created by this factory

Create and return a new service value.

impl<T, C> Service for DropContext<T, C> where
    T: Service<Request = Request, Response = Response, Error = Error>, 
[src]

Requests handled by the service.

Responses given by the service.

Errors produced by the service.

The future response value.

Process the request and return the response asynchronously.

Auto Trait Implementations

impl<T, C> Send for DropContext<T, C> where
    C: Send,
    T: Send

impl<T, C> Sync for DropContext<T, C> where
    C: Sync,
    T: Sync