[][src]Struct swagger::drop_context::DropContextService

pub struct DropContextService<T, C> where
    C: Send + 'static, 
{ /* fields omitted */ }

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

This code runs with edition 2018

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

impl<T, C> DropContextService<T, C> where
    C: Send + 'static, 
[src]

pub fn new(inner: T) -> Self[src]

Create a new DropContextService struct wrapping a value

Trait Implementations

impl<T: Clone, C: Clone> Clone for DropContextService<T, C> where
    C: Send + 'static, 
[src]

impl<T: Debug, C: Debug> Debug for DropContextService<T, C> where
    C: Send + 'static, 
[src]

impl<Inner, Body, Context> Service<(Request<Body>, Context)> for DropContextService<Inner, Context> where
    Context: Send + 'static,
    Inner: Service<Request<Body>>, 
[src]

type Response = Inner::Response

Responses given by the service.

type Error = Inner::Error

Errors produced by the service.

type Future = Inner::Future

The future response value.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<ReqB, ResB, Context, T> SwaggerService<ReqB, ResB, Context> for T where
    Context: Has<Option<AuthData>> + Has<Option<Authorization>> + Has<XSpanIdString> + Clone + 'static + Send,
    T: Clone + Service<(Request<ReqB>, Context), Response = Response<ResB>, Error = Error, Future = Pin<Box<dyn Future<Output = Result<Response<ResB>, Error>> + 'static>>>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,