use std::convert::Infallible;
use super::*;
#[derive(Debug)]
pub struct NoopService {
_priv: (),
}
impl DataQueryError for Infallible {
fn ref_id(self) -> String {
unreachable!()
}
}
#[tonic::async_trait]
impl DataService for NoopService {
type Query = ();
type QueryError = Infallible;
type Stream = BoxDataResponseStream<Self::QueryError>;
async fn query_data(&self, _request: QueryDataRequest<Self::Query>) -> Self::Stream {
unreachable!()
}
}
#[tonic::async_trait]
impl DiagnosticsService for NoopService {
type CheckHealthError = Infallible;
async fn check_health(
&self,
_request: CheckHealthRequest,
) -> Result<CheckHealthResponse, Self::CheckHealthError> {
unreachable!()
}
type CollectMetricsError = Infallible;
async fn collect_metrics(
&self,
_request: CollectMetricsRequest,
) -> Result<CollectMetricsResponse, Self::CollectMetricsError> {
unreachable!()
}
}
#[tonic::async_trait]
impl ResourceService for NoopService {
type Error = Infallible;
type InitialResponse = Vec<u8>;
type Stream = BoxResourceStream<Self::Error>;
async fn call_resource(
&self,
_request: CallResourceRequest,
) -> Result<(Self::InitialResponse, Self::Stream), Self::Error> {
unreachable!()
}
}
#[tonic::async_trait]
impl StreamService for NoopService {
async fn subscribe_stream(
&self,
_request: SubscribeStreamRequest,
) -> Result<SubscribeStreamResponse, Self::Error> {
unreachable!()
}
type JsonValue = ();
type Error = Infallible;
type Stream = BoxRunStream<Self::Error>;
async fn run_stream(&self, _request: RunStreamRequest) -> Result<Self::Stream, Self::Error> {
unreachable!()
}
async fn publish_stream(
&self,
_request: PublishStreamRequest,
) -> Result<PublishStreamResponse, Self::Error> {
unreachable!()
}
}