pub struct FnSvc<F> { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl<F, Req, Fut, Res> Svc<Req> for FnSvc<F>
impl<F, Req, Fut, Res> Svc<Req> for FnSvc<F>
Source§fn exec(self: Pin<&mut Self>, req: Req) -> Self::Fut
fn exec(self: Pin<&mut Self>, req: Req) -> Self::Fut
Processes request, producing a future that outputs the response type.
Source§fn poll_ready(self: Pin<&mut Self>, cx: Context<'_>) -> Poll<()>
fn poll_ready(self: Pin<&mut Self>, cx: Context<'_>) -> Poll<()>
To be called before
exec
to signal wether the service is ready to process requests.
As such, the check should be inexpensive. Returning Poll::Pending
acts as back-pressure.
The default implementation unconditionally indicates the service is ready.Auto Trait Implementations§
impl<F> Freeze for FnSvc<F>where
F: Freeze,
impl<F> RefUnwindSafe for FnSvc<F>where
F: RefUnwindSafe,
impl<F> Send for FnSvc<F>where
F: Send,
impl<F> Sync for FnSvc<F>where
F: Sync,
impl<F> Unpin for FnSvc<F>where
F: Unpin,
impl<F> UnwindSafe for FnSvc<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