eventstore/event_store/generated/
monitoring.rs1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct StatsReq {
4 #[prost(bool, tag = "1")]
5 pub use_metadata: bool,
6 #[prost(uint64, tag = "4")]
7 pub refresh_time_period_in_ms: u64,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct StatsResp {
11 #[prost(map = "string, string", tag = "1")]
12 pub stats:
13 ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
14}
15pub mod monitoring_client {
17 #![allow(
18 unused_variables,
19 dead_code,
20 missing_docs,
21 clippy::wildcard_imports,
22 clippy::let_unit_value
23 )]
24 use tonic::codegen::http::Uri;
25 use tonic::codegen::*;
26 #[derive(Debug, Clone)]
27 pub struct MonitoringClient<T> {
28 inner: tonic::client::Grpc<T>,
29 }
30 impl MonitoringClient<tonic::transport::Channel> {
31 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
33 where
34 D: TryInto<tonic::transport::Endpoint>,
35 D::Error: Into<StdError>,
36 {
37 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
38 Ok(Self::new(conn))
39 }
40 }
41 impl<T> MonitoringClient<T>
42 where
43 T: tonic::client::GrpcService<tonic::body::BoxBody>,
44 T::Error: Into<StdError>,
45 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
46 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
47 {
48 pub fn new(inner: T) -> Self {
49 let inner = tonic::client::Grpc::new(inner);
50 Self { inner }
51 }
52 pub fn with_origin(inner: T, origin: Uri) -> Self {
53 let inner = tonic::client::Grpc::with_origin(inner, origin);
54 Self { inner }
55 }
56 pub fn with_interceptor<F>(
57 inner: T,
58 interceptor: F,
59 ) -> MonitoringClient<InterceptedService<T, F>>
60 where
61 F: tonic::service::Interceptor,
62 T::ResponseBody: Default,
63 T: tonic::codegen::Service<
64 http::Request<tonic::body::BoxBody>,
65 Response = http::Response<
66 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
67 >,
68 >,
69 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
70 Into<StdError> + std::marker::Send + std::marker::Sync,
71 {
72 MonitoringClient::new(InterceptedService::new(inner, interceptor))
73 }
74 #[must_use]
79 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
80 self.inner = self.inner.send_compressed(encoding);
81 self
82 }
83 #[must_use]
85 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
86 self.inner = self.inner.accept_compressed(encoding);
87 self
88 }
89 #[must_use]
93 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
94 self.inner = self.inner.max_decoding_message_size(limit);
95 self
96 }
97 #[must_use]
101 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
102 self.inner = self.inner.max_encoding_message_size(limit);
103 self
104 }
105 pub async fn stats(
106 &mut self,
107 request: impl tonic::IntoRequest<super::StatsReq>,
108 ) -> std::result::Result<
109 tonic::Response<tonic::codec::Streaming<super::StatsResp>>,
110 tonic::Status,
111 > {
112 self.inner.ready().await.map_err(|e| {
113 tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
114 })?;
115 let codec = tonic::codec::ProstCodec::default();
116 let path = http::uri::PathAndQuery::from_static(
117 "/event_store.client.monitoring.Monitoring/Stats",
118 );
119 let mut req = request.into_request();
120 req.extensions_mut().insert(GrpcMethod::new(
121 "event_store.client.monitoring.Monitoring",
122 "Stats",
123 ));
124 self.inner.server_streaming(req, path, codec).await
125 }
126 }
127}