[−][src]Struct swagger::drop_context::DropContextService
Swagger Middleware that wraps a hyper::service::Service
or a swagger::client::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 client = DropContextService::new(client); let body = ContextualPayload { inner: hyper::Body::empty(), context: "Some Context".to_string() }; let request = hyper::Request::get("http://www.google.com").body(body).unwrap(); let response = client.request(request);
Methods
impl<T, C> DropContextService<T, C> where
C: Send + 'static,
[src]
C: Send + 'static,
Trait Implementations
impl<T: Clone, C: Clone> Clone for DropContextService<T, C> where
C: Send + 'static,
[src]
C: Send + 'static,
fn clone(&self) -> DropContextService<T, C>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug, C: Debug> Debug for DropContextService<T, C> where
C: Send + 'static,
[src]
C: Send + 'static,
impl<T, C> Service for DropContextService<T, C> where
C: Send + 'static,
T: Service<ReqBody = Body>,
[src]
C: Send + 'static,
T: Service<ReqBody = Body>,
type ReqBody = ContextualPayload<Body, C>
Request body taken by client. Likely either hyper::Body
, hyper::Chunk
or swagger::ContextualPayload
. Read more
type Future = T::Future
Future response from client service. Likely: Future<Item=hyper::Response<hyper::Body>, Error=hyper::Error>
Read more
fn request(&self, request: Request<Self::ReqBody>) -> Self::Future
[src]
impl<T, C> Service for DropContextService<T, C> where
C: Send + 'static,
T: Service<ReqBody = Body, ResBody = Body, Error = Error>,
[src]
C: Send + 'static,
T: Service<ReqBody = Body, ResBody = Body, Error = Error>,
type ReqBody = ContextualPayload<Body, C>
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 occur within this Service
. Read more
type Future = T::Future
The Future
returned by this Service
.
fn call(&mut self, req: Request<Self::ReqBody>) -> Self::Future
[src]
fn poll_ready(&mut self) -> Result<Async<()>, Self::Error>
[src]
Auto Trait Implementations
impl<T, C> RefUnwindSafe for DropContextService<T, C> where
C: RefUnwindSafe,
T: RefUnwindSafe,
C: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, C> Send for DropContextService<T, C> where
T: Send,
T: Send,
impl<T, C> Sync for DropContextService<T, C> where
C: Sync,
T: Sync,
C: Sync,
T: Sync,
impl<T, C> Unpin for DropContextService<T, C> where
C: Unpin,
T: Unpin,
C: Unpin,
T: Unpin,
impl<T, C> UnwindSafe for DropContextService<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<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T, C> SwaggerService<C> for T where
C: Has<Option<AuthData>> + Has<Option<Authorization>> + Has<XSpanIdString> + Clone + 'static + Send,
T: Clone + Service<ReqBody = ContextualPayload<Body, C>, ResBody = Body, Error = Error, Future = Box<dyn Future<Error = Error, Item = Response<Body>> + 'static + Send>>,
[src]
C: Has<Option<AuthData>> + Has<Option<Authorization>> + Has<XSpanIdString> + Clone + 'static + Send,
T: Clone + Service<ReqBody = ContextualPayload<Body, C>, ResBody = Body, Error = Error, Future = Box<dyn Future<Error = Error, Item = Response<Body>> + 'static + Send>>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,