pub struct AsyncFn<F>(pub F);Expand description
transform given async function to middleware that can be implied to certain service through ServiceExt::enclosed API.
Tuple Fields§
§0: FTrait Implementations§
Auto Trait Implementations§
impl<F> Freeze for AsyncFn<F>where
F: Freeze,
impl<F> RefUnwindSafe for AsyncFn<F>where
F: RefUnwindSafe,
impl<F> Send for AsyncFn<F>where
F: Send,
impl<F> Sync for AsyncFn<F>where
F: Sync,
impl<F> Unpin for AsyncFn<F>where
F: Unpin,
impl<F> UnwindSafe for AsyncFn<F>where
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, Arg> ServiceExt<Arg> for Swhere
S: Service<Arg>,
impl<S, Arg> ServiceExt<Arg> for Swhere
S: Service<Arg>,
Source§fn enclosed<T>(self, build: T) -> EnclosedBuilder<Self, T>
fn enclosed<T>(self, build: T) -> EnclosedBuilder<Self, T>
Enclose Self with given
T as Service<<Self as Service<_>>::Response>>. In other word T
would take Self’s Service::Response type as it’s generic argument of Service<_> impl.Source§fn enclosed_fn<T, Req, O>(self, func: T) -> EnclosedFnBuilder<Self, T>
fn enclosed_fn<T, Req, O>(self, func: T) -> EnclosedFnBuilder<Self, T>
Function version of Self::enclosed method.
Source§fn map<F, Res, ResMap>(self, mapper: F) -> MapBuilder<Self, F>
fn map<F, Res, ResMap>(self, mapper: F) -> MapBuilder<Self, F>
Mutate
<<Self::Response as Service<Req>>::Future as Future>::Output type with given
closure.Source§fn map_err<F, Err, ErrMap>(self, err: F) -> MapErrorBuilder<Self, F>
fn map_err<F, Err, ErrMap>(self, err: F) -> MapErrorBuilder<Self, F>
Mutate
<Self::Response as Service<Req>>::Error type with given closure.