use crate::Result;
#[derive(Clone, Debug)]
pub struct ServiceController<T>
where
T: super::stub::ServiceController + std::fmt::Debug + Send + Sync,
{
inner: T,
}
impl<T> ServiceController<T>
where
T: super::stub::ServiceController + std::fmt::Debug + Send + Sync,
{
pub fn new(inner: T) -> Self {
Self { inner }
}
}
impl<T> super::stub::ServiceController for ServiceController<T>
where
T: super::stub::ServiceController + std::fmt::Debug + Send + Sync,
{
#[tracing::instrument(ret)]
async fn check(
&self,
req: crate::model::CheckRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::CheckResponse>> {
self.inner.check(req, options).await
}
#[tracing::instrument(ret)]
async fn report(
&self,
req: crate::model::ReportRequest,
options: crate::RequestOptions,
) -> Result<crate::Response<crate::model::ReportResponse>> {
self.inner.report(req, options).await
}
}