Struct MapFuture

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

Service returned by the map_future combinator.

Implementations

impl<S, F> MapFuture<S, F>

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

Creates a new MapFuture service.

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

Returns a new Layer that produces MapFuture services.

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

fn get_ref(&self) -> &S

Get a reference to the inner service

fn get_mut(&mut self) -> &mut S

Get a mutable reference to the inner service

fn into_inner(self) -> S

Consume self, returning the inner service

Trait Implementations

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;
type Error = E;
type Future = Fut;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn call(&mut self, req: R) -> Self::Future

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

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

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

fn clone(&self) -> Self

Auto Trait Implementations

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

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

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

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

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

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

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

Blanket Implementations

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

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

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

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

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

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

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

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

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

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

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

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

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

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