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) -> SelfCreates a new
MapFutureservice.fn layer(f: F) -> MapFutureLayer<F>Returns a new
Layerthat producesMapFutureservices.This is a convenience function that simply calls
MapFutureLayer::new.fn get_ref(&self) -> &SGet a reference to the inner service
fn get_mut(&mut self) -> &mut SGet a mutable reference to the inner service
fn into_inner(self) -> SConsume
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) -> MapFuture<S, F>
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,
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 MapFuture<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 MapFuture<S, F>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for MapFuture<S, F>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for MapFuture<S, F>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for MapFuture<S, F>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for MapFuture<S, F>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for MapFuture<S, F>
impl<T> ToOwned for MapFuture<S, F>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
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>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for MapFuture<S, F>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for MapFuture<S, F>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>