use std::{future::Future, ops::Deref};
pub trait Service {
type Request;
type Future: Future<Output = Result<crate::Response, crate::Exception>> + Send;
fn call(&self, req: Self::Request) -> Self::Future;
}
impl<D> Service for D
where
D: Deref + ?Sized,
D::Target: Service,
{
type Request = <D::Target as Service>::Request;
type Future = <D::Target as Service>::Future;
fn call(&self, req: Self::Request) -> Self::Future {
self.deref().call(req)
}
}