pub struct DropContextMakeService<C> { /* 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§
Source§impl<C> DropContextMakeService<C>
impl<C> DropContextMakeService<C>
Trait Implementations§
Source§impl<C: Debug> Debug for DropContextMakeService<C>
impl<C: Debug> Debug for DropContextMakeService<C>
Source§impl<T, C> Service<T> for DropContextMakeService<C>
impl<T, C> Service<T> for DropContextMakeService<C>
Source§type Response = DropContextService<T, C>
type Response = DropContextService<T, C>
Responses given by the service.
Source§type Future = Ready<Result<<DropContextMakeService<C> as Service<T>>::Response, <DropContextMakeService<C> as Service<T>>::Error>>
type Future = Ready<Result<<DropContextMakeService<C> as Service<T>>::Response, <DropContextMakeService<C> as Service<T>>::Error>>
The future response value.
Auto Trait Implementations§
impl<C> Freeze for DropContextMakeService<C>
impl<C> RefUnwindSafe for DropContextMakeService<C>where
C: RefUnwindSafe,
impl<C> Send for DropContextMakeService<C>where
C: Send,
impl<C> Sync for DropContextMakeService<C>where
C: Sync,
impl<C> Unpin for DropContextMakeService<C>where
C: Unpin,
impl<C> UnwindSafe for DropContextMakeService<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more