Struct tower::util::Then[][src]

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

Service returned by the then combinator.

Implementations

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

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

Creates a new Then service.

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

Returns a new Layer that produces Then services.

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

Trait Implementations

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

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

impl<S, F, Request, Response, Error, Fut> Service<Request> for Then<S, F> where
    S: Service<Request>,
    S::Error: Into<Error>,
    F: FnOnce(Result<S::Response, S::Error>) -> Fut + Clone,
    Fut: Future<Output = Result<Response, Error>>, 
[src]

type Response = Response

Responses given by the service.

type Error = Error

Errors produced by the service.

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

The future response value.

Auto Trait Implementations

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

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

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

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

impl<S, F> UnwindSafe for Then<S, F> where
    F: UnwindSafe,
    S: 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> 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>,