pub trait Service {
type Req: DeserializeOwned;
type Resp: Serialize + 'static;
type Error: Serialize + 'static;
type Ctx: Clone;
fn serve(
&self,
ctx: Self::Ctx,
req: Self::Req
) -> BoxStream<'static, Result<Self::Resp, Self::Error>>;
fn boxed(self) -> BoxedService<Self::Ctx>
where
Self: Send + Sized + Sync + 'static,
{ ... }
}