pub trait Endpoint<Req: DeserializeOwned + Send + 'static, Resp: Serialize>: Send + Sync {
fn respond<'life0, 'async_trait>(
&'life0 self,
req: Request<Req>
) -> Pin<Box<dyn Future<Output = Result<Resp>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
An Endpoint asynchronously responds to Requests.
Required Methods
Handle a request. This should not block. Implementations should do things like move the Request to background tasks/threads to avoid this.