Struct swagger::drop_context::DropContextService
source · [−]pub struct DropContextService<T, C> where
C: Send + 'static, { /* private fields */ }
Expand description
Swagger Middleware that wraps a hyper::service::Service
and drops any contextual information
on the request. Servers will normally want to use DropContextMakeService
, which will create a
DropContextService
to handle each connection, while clients can simply wrap a hyper::Client
in the middleware.
Client Usage
ⓘ
let client = hyper::Client::new();
let mut client = DropContextService::new(client);
let request = (hyper::Request::get("http://www.google.com").body(hyper::Body::empty()).unwrap());
let context = "Some Context".to_string();
let response = client.call((request, context));
Implementations
Trait Implementations
Returns Poll::Ready(Ok(()))
when the service is able to process requests. Read more
Auto Trait Implementations
impl<T, C> RefUnwindSafe for DropContextService<T, C> where
C: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, C> Send for DropContextService<T, C> where
T: Send,
impl<T, C> Sync for DropContextService<T, C> where
C: Sync,
T: Sync,
impl<T, C> Unpin for DropContextService<T, C> where
C: Unpin,
T: Unpin,
impl<T, C> UnwindSafe for DropContextService<T, C> where
C: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more