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§
source§impl<T: Clone, C> Clone for DropContextService<T, C>where
C: Send + 'static + Clone,
impl<T: Clone, C> Clone for DropContextService<T, C>where C: Send + 'static + Clone,
source§fn clone(&self) -> DropContextService<T, C>
fn clone(&self) -> DropContextService<T, C>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Inner, Body, Context> Service<(Request<Body>, Context)> for DropContextService<Inner, Context>where
Context: Send + 'static,
Inner: Service<Request<Body>>,
impl<Inner, Body, Context> Service<(Request<Body>, Context)> for DropContextService<Inner, Context>where Context: Send + 'static, Inner: Service<Request<Body>>,
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§
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