Struct swagger::drop_context::DropContextMakeService[][src]

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

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

impl<T, C> DropContextMakeService<T, C> where
    C: Send + 'static, 
[src]

pub fn new(inner: T) -> Self[src]

Create a new DropContextMakeService struct wrapping a value

Trait Implementations

impl<T: Debug, C: Debug> Debug for DropContextMakeService<T, C> where
    C: Send + 'static, 
[src]

impl<Inner, Context, Target> Service<Target> for DropContextMakeService<Inner, Context> where
    Context: Send + 'static,
    Inner: Service<Target>,
    Inner::Future: Send + 'static, 
[src]

type Response = DropContextService<Inner::Response, Context>

Responses given by the service.

type Error = Inner::Error

Errors produced by the service.

type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>

The future response value.

Auto Trait Implementations

impl<T, C> RefUnwindSafe for DropContextMakeService<T, C> where
    C: RefUnwindSafe,
    T: RefUnwindSafe

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

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

impl<T, C> Unpin for DropContextMakeService<T, C> where
    C: Unpin,
    T: Unpin

impl<T, C> UnwindSafe for DropContextMakeService<T, C> where
    C: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.