Type Alias BoxSvc

Source
pub type BoxSvc<Req, Res> = Pin<Box<dyn Svc<Req, Res = Res, Fut = BoxFut<Res>>>>;

Aliased Type§

pub struct BoxSvc<Req, Res> { /* private fields */ }

Trait Implementations§

Source§

impl<Req, Res> Svc<Req> for BoxSvc<Req, Res>

Source§

type Res = Res

Output type.
Source§

type Fut = Pin<Box<dyn Future<Output = Res>>>

Response future.
Source§

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.
Source§

fn exec(self: Pin<&mut Self>, req: Req) -> Self::Fut

Processes request, producing a future that outputs the response type.