pub struct AddContextMakeService<T, C>where
    C: Default + Push<XSpanIdString> + 'static + Send,
    C::Result: Send + 'static,{ /* private fields */ }
Expand description

Middleware wrapper service, that should be used as the outermost layer in a stack of hyper services. Adds a context to a plain hyper::Request that can be used by subsequent layers in the stack.

Implementations§

source§

impl<T, C> AddContextMakeService<T, C>where C: Default + Push<XSpanIdString> + 'static + Send, C::Result: Send + 'static,

source

pub fn new(inner: T) -> Self

Create a new AddContextMakeService struct wrapping a value

Trait Implementations§

source§

impl<T: Debug, C> Debug for AddContextMakeService<T, C>where C: Default + Push<XSpanIdString> + 'static + Send + Debug, C::Result: Send + 'static,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Inner, Context, Target> Service<Target> for AddContextMakeService<Inner, Context>where Context: Default + Push<XSpanIdString> + 'static + Send, Context::Result: Send + 'static, Inner: Service<Target>, Inner::Future: Send + 'static,

§

type Error = <Inner as Service<Target>>::Error

Errors produced by the service.
§

type Response = AddContextService<<Inner as Service<Target>>::Response, Context>

Responses given by the service.
§

type Future = Pin<Box<dyn Future<Output = Result<<AddContextMakeService<Inner, Context> as Service<Target>>::Response, <AddContextMakeService<Inner, Context> as Service<Target>>::Error>> + Send, Global>>

The future response value.
source§

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call(&mut self, target: Target) -> Self::Future

Process the request and return the response asynchronously. Read more

Auto Trait Implementations§

§

impl<T, C> RefUnwindSafe for AddContextMakeService<T, C>where C: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, C> Send for AddContextMakeService<T, C>where T: Send,

§

impl<T, C> Sync for AddContextMakeService<T, C>where C: Sync, T: Sync,

§

impl<T, C> Unpin for AddContextMakeService<T, C>where C: Unpin, T: Unpin,

§

impl<T, C> UnwindSafe for AddContextMakeService<T, C>where C: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, S, F, Target, ReqBody, ResBody, Error, MakeError> CompositedMakeService<Target, ReqBody, ResBody, Error, MakeError> for Twhere Target: Send, T: Service<Target, Response = S, Future = F, Error = MakeError> + Send, F: Future<Output = Result<S, MakeError>> + Send + 'static, S: CompositedService<ReqBody, ResBody, Error> + Send + 'static,

source§

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), MakeError>>

Available on crate feature server and (crate features http1 or http2) only.
See tower_service::Service::poll_ready
source§

fn call( &mut self, target: Target ) -> Pin<Box<dyn Future<Output = Result<Box<dyn CompositedService<ReqBody, ResBody, Error> + Send, Global>, MakeError>> + Send, Global>>

Available on crate feature server and (crate features http1 or http2) only.
See tower_service::Service::call
source§

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices

§

type Remainder = Choices

source§

fn subset( self ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U, I> LiftInto<U, I> for Twhere U: LiftFrom<T, I>,

source§

fn lift_into(self) -> U

Performs the indexed conversion.
source§

impl<Source> Sculptor<HNil, HNil> for Source

§

type Remainder = Source

source§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Typeable for Twhere T: Any,

§

fn get_type(&self) -> TypeId

Get the TypeId of this object.
§

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

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more