Struct tower::util::AndThen[][src]

pub struct AndThen<S, F> { /* fields omitted */ }
This is supported on crate feature util only.

Service returned by the and_then combinator.

Implementations

impl<S, F> AndThen<S, F>[src]

pub fn new(inner: S, f: F) -> Self[src]

Creates a new AndThen service.

pub fn layer(f: F) -> AndThenLayer<F>[src]

Returns a new Layer that produces AndThen services.

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

Trait Implementations

impl<S: Clone, F: Clone> Clone for AndThen<S, F>[src]

impl<S, F> Debug for AndThen<S, F> where
    S: Debug
[src]

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
[src]

type Response = Fut::Ok

Responses given by the service.

type Error = Fut::Error

Errors produced by the service.

type Future = AndThenFuture<S::Future, Fut, F>

The future response value.

Auto Trait Implementations

impl<S, F> RefUnwindSafe for AndThen<S, F> where
    F: RefUnwindSafe,
    S: RefUnwindSafe
[src]

impl<S, F> Send for AndThen<S, F> where
    F: Send,
    S: Send
[src]

impl<S, F> Sync for AndThen<S, F> where
    F: Sync,
    S: Sync
[src]

impl<S, F> Unpin for AndThen<S, F> where
    F: Unpin,
    S: Unpin
[src]

impl<S, F> UnwindSafe for AndThen<S, F> where
    F: UnwindSafe,
    S: UnwindSafe
[src]

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> Instrument for T[src]

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

impl<T, Request> ServiceExt<Request> for T where
    T: Service<Request> + ?Sized
[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>,