Struct AddContext

Source
pub struct AddContext<T, A> { /* private fields */ }
Expand description

Middleware to extract authentication data from request

Implementations§

Source§

impl<T, A, B, C, D> AddContext<T, A>
where A: Default + Push<XSpanIdString, Result = B>, B: Push<Option<AuthData>, Result = C>, C: Push<Option<Authorization>, Result = D>, T: Service,

Source

pub fn new(inner: T) -> AddContext<T, A>

Trait Implementations§

Source§

impl<T, A, B, C, D> Service for AddContext<T, A>
where A: Default + Push<XSpanIdString, Result = B>, B: Push<Option<AuthData>, Result = C>, C: Push<Option<Authorization>, Result = D>, D: Send + 'static, T: Service<ReqBody = ContextualPayload<Body, D>>, T::Future: Future<Item = Response<T::ResBody>, Error = T::Error> + Send + 'static,

Source§

type ReqBody = Body

The Payload body of the http::Request.
Source§

type ResBody = <T as Service>::ResBody

The Payload body of the http::Response.
Source§

type Error = <T as Service>::Error

The error type that can occur within this Service. Read more
Source§

type Future = Box<dyn Future<Item = Response<<T as Service>::ResBody>, Error = <T as Service>::Error> + Send>

The Future returned by this Service.
Source§

fn call(&mut self, req: Request<Self::ReqBody>) -> Self::Future

Calls this Service with a request, returning a Future of the response.
Source§

fn poll_ready(&mut self) -> Result<Async<()>, Self::Error>

Returns Ready when the service is able to process requests. Read more

Auto Trait Implementations§

§

impl<T, A> Freeze for AddContext<T, A>
where T: Freeze,

§

impl<T, A> RefUnwindSafe for AddContext<T, A>

§

impl<T, A> Send for AddContext<T, A>
where T: Send, A: Send,

§

impl<T, A> Sync for AddContext<T, A>
where T: Sync, A: Sync,

§

impl<T, A> Unpin for AddContext<T, A>
where T: Unpin, A: Unpin,

§

impl<T, A> UnwindSafe for AddContext<T, A>
where T: UnwindSafe, A: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.