Struct AndThen

pub struct AndThen<S, F> { /* private fields */ }

Service returned by the and_then combinator.

Implementations

impl<S, F> AndThen<S, F>

const fn new(inner: S, f: F) -> Self

Creates a new AndThen service.

fn layer(f: F) -> AndThenLayer<F>

Returns a new Layer that produces AndThen services.

This is a convenience function that simply calls AndThenLayer::new.

Trait Implementations

impl<S, F> Debug for AndThen<S, F> where S: Debug,

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

impl<S, F, Request, Fut> Service<Request> for AndThen<S, F> where S: Service<Request>, S::Error: Into<Fut::Error>, F: FnOnce(S::Response) -> Fut + Clone, Fut: TryFuture,

type Response = <Fut as TryFuture>::Ok;
type Error = <Fut as TryFuture>::Error;
type Future = AndThenFuture<<S as Service<Request>>::Future, Fut, F>;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn call(&mut self, request: Request) -> Self::Future

impl<S: Clone, F: Clone> Clone for AndThen<S, F>

fn clone(&self) -> AndThen<S, F>

Auto Trait Implementations

impl<S, F> Freeze for AndThen<S, F> where S: Freeze, F: Freeze,

impl<S, F> RefUnwindSafe for AndThen<S, F> where S: RefUnwindSafe, F: RefUnwindSafe,

impl<S, F> Send for AndThen<S, F> where S: Send, F: Send,

impl<S, F> Sync for AndThen<S, F> where S: Sync, F: Sync,

impl<S, F> Unpin for AndThen<S, F> where S: Unpin, F: Unpin,

impl<S, F> UnsafeUnpin for AndThen<S, F> where S: UnsafeUnpin, F: UnsafeUnpin,

impl<S, F> UnwindSafe for AndThen<S, F> where S: UnwindSafe, F: UnwindSafe,

Blanket Implementations

impl<C, Target> MakeConnection<Target> for AndThen<S, F> where C: Service<Target>, <C as Service<Target>>::Response: AsyncRead + AsyncWrite,

type Connection = <C as Service<Target>>::Response;
type Error = <C as Service<Target>>::Error;
type Future = <C as Service<Target>>::Future;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), <C as MakeConnection<Target>>::Error>>
fn make_connection(&mut self, target: Target) -> <C as MakeConnection<Target>>::Future

impl<M, S, Target, Request> MakeService<Target, Request> for AndThen<S, F> where M: Service<Target, Response = S>, S: Service<Request>,

type Response = <S as Service<Request>>::Response;
type Error = <S as Service<Request>>::Error;
type Service = S;
type MakeError = <M as Service<Target>>::Error;
type Future = <M as Service<Target>>::Future;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>
fn make_service(&mut self, target: Target) -> <M as MakeService<Target, Request>>::Future

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for AndThen<S, F> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for AndThen<S, F> where T: ?Sized,

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

impl<T> CloneToUninit for AndThen<S, F> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for AndThen<S, F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for AndThen<S, F>

impl<T> ToOwned for AndThen<S, F> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> WithSubscriber for AndThen<S, F>

impl<T, Request> ServiceExt<Request> for AndThen<S, F> where T: Service<Request> + ?Sized,

impl<T, U> Into<U> for AndThen<S, F> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for AndThen<S, F> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for AndThen<S, F> where U: TryFrom<T>,

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