pub struct MapAsync<F, H> {
pub handler: H,
pub f: F,
}Fields§
§handler: H§f: FTrait Implementations§
impl<F: Copy, H: Copy> Copy for MapAsync<F, H>
impl<F: Eq, H: Eq> Eq for MapAsync<F, H>
Source§impl<F, H, T, E> Handler<T, E> for MapAsync<F, H>
impl<F, H, T, E> Handler<T, E> for MapAsync<F, H>
type Output = <H as Handler<<F as Fn1ResultAsync<T, E>>::Ok, E>>::Output
fn handle<'a>( &'a self, request: T, ) -> impl Future<Output = Result<Self::Output, E>> + Send + Captures<(&'a Self, T)>
Source§fn after<C>(self, current: C) -> Seq<C, Self>where
C: SeqHandler<T, E, Self>,
Self: Sized,
fn after<C>(self, current: C) -> Seq<C, Self>where
C: SeqHandler<T, E, Self>,
Self: Sized,
Run this handler after specified, specified handler must
implement
SeqHandler to create something meaningfulSource§fn or<R, EE>(self, rhs: R) -> Or<Self, R>
fn or<R, EE>(self, rhs: R) -> Or<Self, R>
Logical or for handlers, refer to
Or for documentationSource§fn serve<X, OTx, SRx>(
self,
rx: X,
options: ServeOptions<OTx, SRx>,
) -> impl Future<Output = Result<(), E>> + Send
fn serve<X, OTx, SRx>( self, rx: X, options: ServeOptions<OTx, SRx>, ) -> impl Future<Output = Result<(), E>> + Send
Source§fn into_server<X>(self, rx: X) -> Server<Self, X>
fn into_server<X>(self, rx: X) -> Server<Self, X>
Creates server from that handler, for more, see docs for
Server handlerSource§fn provide<Env, F>(self, env: Env, f: F) -> Provide<Env, F, Self>where
Self: Sized,
fn provide<Env, F>(self, env: Env, f: F) -> Provide<Env, F, Self>where
Self: Sized,
Special case of
Handler::map_async,
refer to Provide documentation for more.Source§fn map_async<K, F>(self, f: F) -> MapAsync<F, Self>where
Self: Sized,
F: Fn1ResultAsync<K, E, Ok = T>,
fn map_async<K, F>(self, f: F) -> MapAsync<F, Self>where
Self: Sized,
F: Fn1ResultAsync<K, E, Ok = T>,
Same as
Handler::map, but provided function is asyncSource§fn map<K, F>(self, f: F) -> Map<F, Self>
fn map<K, F>(self, f: F) -> Map<F, Self>
Changes input of the handler into another type, to do that - it
accepts function that maps that type to input type of the current handler
Source§fn pipe<Dst>(self, dst: Dst) -> Pipe<Self, Dst>
fn pipe<Dst>(self, dst: Dst) -> Pipe<Self, Dst>
Pipes output from one handler to
Dst, refer to docs of Pipe for more.Wraps handler in
ArcSource§impl<F: PartialEq, H: PartialEq> PartialEq for MapAsync<F, H>
impl<F: PartialEq, H: PartialEq> PartialEq for MapAsync<F, H>
impl<F, H> StructuralPartialEq for MapAsync<F, H>
Auto Trait Implementations§
impl<F, H> Freeze for MapAsync<F, H>
impl<F, H> RefUnwindSafe for MapAsync<F, H>where
H: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, H> Send for MapAsync<F, H>
impl<F, H> Sync for MapAsync<F, H>
impl<F, H> Unpin for MapAsync<F, H>
impl<F, H> UnsafeUnpin for MapAsync<F, H>where
H: UnsafeUnpin,
F: UnsafeUnpin,
impl<F, H> UnwindSafe for MapAsync<F, H>where
H: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> Captures<U> for Twhere
U: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more