pub struct FromFn<F, S, St, In = ()> { /* private fields */ }Expand description
Middleware created by from_fn.
Trait Implementations§
Source§impl<F, S, St, In> Middleware<S, St> for FromFn<F, S, St, In>where
St: State,
S: Service<St, WebRequest<In>, Res = WebResponse>,
S::Error: WebResponseError<St, St::Error>,
F: AsyncFn(WebRequest<In>, Next<'_, S, St>) -> Result<WebResponse, WebError<St, St::Error>> + Clone,
impl<F, S, St, In> Middleware<S, St> for FromFn<F, S, St, In>where
St: State,
S: Service<St, WebRequest<In>, Res = WebResponse>,
S::Error: WebResponseError<St, St::Error>,
F: AsyncFn(WebRequest<In>, Next<'_, S, St>) -> Result<WebResponse, WebError<St, St::Error>> + Clone,
Source§type Service = FromFnService<F, S>
type Service = FromFnService<F, S>
Wrapper returned by
Self::create. Read moreSource§fn create(&self, _: &St, svc: S) -> Self::Service
fn create(&self, _: &St, svc: S) -> Self::Service
Wraps
service using the supplied construction state. Read moreSource§fn apply_to<Sf, Req>(
self,
factory: Sf,
) -> ServiceChainFactory<ApplyMiddleware<Self, Sf>, St, Req>
fn apply_to<Sf, Req>( self, factory: Sf, ) -> ServiceChainFactory<ApplyMiddleware<Self, Sf>, St, Req>
Creates a service factory that instantiates a service and applies
the current middleware to it. Read more
Auto Trait Implementations§
impl<F, S, St, In> Freeze for FromFn<F, S, St, In>where
F: Freeze,
impl<F, S, St, In> RefUnwindSafe for FromFn<F, S, St, In>where
F: RefUnwindSafe,
impl<F, S, St, In> Send for FromFn<F, S, St, In>where
F: Send,
impl<F, S, St, In> Sync for FromFn<F, S, St, In>where
F: Sync,
impl<F, S, St, In> Unpin for FromFn<F, S, St, In>where
F: Unpin,
impl<F, S, St, In> UnsafeUnpin for FromFn<F, S, St, In>where
F: UnsafeUnpin,
impl<F, S, St, In> UnwindSafe for FromFn<F, S, St, In>where
F: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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