1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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 QueryError = Infallible;
type Iter = BoxDataResponseIter<Self::QueryError>;
async fn query_data(&self, _request: QueryDataRequest) -> Self::Iter {
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!()
}
}