[−][src]Struct swagger::drop_context::DropContextMakeService
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)));
Methods
impl<T, C> DropContextMakeService<T, C> where
C: Send + 'static,
[src]
C: Send + 'static,
Trait Implementations
impl<T: Debug, C: Debug> Debug for DropContextMakeService<T, C> where
C: Send + 'static,
[src]
C: Send + 'static,
impl<'a, SC, RC, T, S, F> MakeService<&'a SC> for DropContextMakeService<T, RC> where
RC: Send + 'static,
T: MakeService<&'a SC, ReqBody = Body, ResBody = Body, Error = Error, MakeError = Error, Service = S, Future = F>,
T::Future: 'static,
S: Service<ReqBody = Body, ResBody = Body, Error = Error> + 'static,
F: Future<Item = S, Error = Error>,
[src]
RC: Send + 'static,
T: MakeService<&'a SC, ReqBody = Body, ResBody = Body, Error = Error, MakeError = Error, Service = S, Future = F>,
T::Future: 'static,
S: Service<ReqBody = Body, ResBody = Body, Error = Error> + 'static,
F: Future<Item = S, Error = Error>,
type ReqBody = ContextualPayload<Body, RC>
The Payload
body of the http::Request
.
type ResBody = Body
The Payload
body of the http::Response
.
type Error = Error
The error type that can be returned by Service
s.
type MakeError = Error
The error type that can be returned when creating a new Service
.
type Future = Box<dyn Future<Item = Self::Service, Error = Error>>
The future returned from new_service
of a Service
.
type Service = DropContextService<S, RC>
The resolved Service
from new_service()
.
fn make_service(&mut self, service_ctx: &'a SC) -> Self::Future
[src]
fn poll_ready(&mut self) -> Result<Async<()>, Self::MakeError>
[src]
Auto Trait Implementations
impl<T, C> RefUnwindSafe for DropContextMakeService<T, C> where
C: RefUnwindSafe,
T: RefUnwindSafe,
C: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, C> Send for DropContextMakeService<T, C> where
T: Send,
T: Send,
impl<T, C> Sync for DropContextMakeService<T, C> where
C: Sync,
T: Sync,
C: Sync,
T: Sync,
impl<T, C> Unpin for DropContextMakeService<T, C> where
C: Unpin,
T: Unpin,
C: Unpin,
T: Unpin,
impl<T, C> UnwindSafe for DropContextMakeService<T, C> where
C: UnwindSafe,
T: UnwindSafe,
C: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<N, Ctx> MakeService<Ctx> for N where
N: NewService,
[src]
N: NewService,
type ReqBody = <N as NewService>::ReqBody
The Payload
body of the http::Request
.
type ResBody = <N as NewService>::ResBody
The Payload
body of the http::Response
.
type Error = <N as NewService>::Error
The error type that can be returned by Service
s.
type Service = <N as NewService>::Service
The resolved Service
from new_service()
.
type Future = <N as NewService>::Future
The future returned from new_service
of a Service
.
type MakeError = <N as NewService>::InitError
The error type that can be returned when creating a new Service
.
fn poll_ready(
&mut self
) -> Result<Async<()>, <N as MakeService<Ctx>>::MakeError>
[src]
&mut self
) -> Result<Async<()>, <N as MakeService<Ctx>>::MakeError>
fn make_service(&mut self, Ctx) -> <N as MakeService<Ctx>>::Future
[src]
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,