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§
Trait Implementations§
Source§impl<T: Debug, C> Debug for DropContextMakeService<T, C>
impl<T: Debug, C> Debug for DropContextMakeService<T, C>
Source§impl<Inner, Context, Target> Service<Target> for DropContextMakeService<Inner, Context>
impl<Inner, Context, Target> Service<Target> for DropContextMakeService<Inner, Context>
Source§type Response = DropContextService<<Inner as Service<Target>>::Response, Context>
type Response = DropContextService<<Inner as Service<Target>>::Response, Context>
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<<DropContextMakeService<Inner, Context> as Service<Target>>::Response, <DropContextMakeService<Inner, Context> as Service<Target>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<DropContextMakeService<Inner, Context> as Service<Target>>::Response, <DropContextMakeService<Inner, Context> as Service<Target>>::Error>> + Send>>
The future response value.
Auto Trait Implementations§
impl<T, C> Freeze for DropContextMakeService<T, C>where
T: Freeze,
impl<T, C> RefUnwindSafe for DropContextMakeService<T, C>where
T: RefUnwindSafe,
C: RefUnwindSafe,
impl<T, C> Send for DropContextMakeService<T, C>where
T: Send,
impl<T, C> Sync for DropContextMakeService<T, C>
impl<T, C> Unpin for DropContextMakeService<T, C>
impl<T, C> UnwindSafe for DropContextMakeService<T, C>where
T: UnwindSafe,
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
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more