Struct tower::util::MapFuture[][src]

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

Service returned by the map_future combinator.


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

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

Creates a new MapFuture service.

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

Returns a new Layer that produces MapFuture services.

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

pub fn get_ref(&self) -> &S[src]

Get a reference to the inner service

pub fn get_mut(&mut self) -> &mut S[src]

Get a mutable reference to the inner service

pub fn into_inner(self) -> S[src]

Consume self, returning the inner service

Trait Implementations

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

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

impl<R, S, F, T, E, Fut> Service<R> for MapFuture<S, F> where
    S: Service<R>,
    F: FnMut(S::Future) -> Fut,
    E: From<S::Error>,
    Fut: Future<Output = Result<T, E>>, 

type Response = T

Responses given by the service.

type Error = E

Errors produced by the service.

type Future = Fut

The future response value.

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

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

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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>,