Skip to main content

chalk_client/gen/
chalk.engine.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct PingRequest {
4    #[prost(int32, tag = "1")]
5    pub num: i32,
6}
7#[derive(Clone, Copy, PartialEq, ::prost::Message)]
8pub struct PingResponse {
9    #[prost(int32, tag = "1")]
10    pub num: i32,
11}
12/// Generated client implementations.
13pub mod query_service_client {
14    #![allow(
15        unused_variables,
16        dead_code,
17        missing_docs,
18        clippy::wildcard_imports,
19        clippy::let_unit_value,
20    )]
21    use tonic::codegen::*;
22    use tonic::codegen::http::Uri;
23    #[derive(Debug, Clone)]
24    pub struct QueryServiceClient<T> {
25        inner: tonic::client::Grpc<T>,
26    }
27    impl QueryServiceClient<tonic::transport::Channel> {
28        /// Attempt to create a new client by connecting to a given endpoint.
29        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
30        where
31            D: TryInto<tonic::transport::Endpoint>,
32            D::Error: Into<StdError>,
33        {
34            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
35            Ok(Self::new(conn))
36        }
37    }
38    impl<T> QueryServiceClient<T>
39    where
40        T: tonic::client::GrpcService<tonic::body::BoxBody>,
41        T::Error: Into<StdError>,
42        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
43        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
44    {
45        pub fn new(inner: T) -> Self {
46            let inner = tonic::client::Grpc::new(inner);
47            Self { inner }
48        }
49        pub fn with_origin(inner: T, origin: Uri) -> Self {
50            let inner = tonic::client::Grpc::with_origin(inner, origin);
51            Self { inner }
52        }
53        pub fn with_interceptor<F>(
54            inner: T,
55            interceptor: F,
56        ) -> QueryServiceClient<InterceptedService<T, F>>
57        where
58            F: tonic::service::Interceptor,
59            T::ResponseBody: Default,
60            T: tonic::codegen::Service<
61                http::Request<tonic::body::BoxBody>,
62                Response = http::Response<
63                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
64                >,
65            >,
66            <T as tonic::codegen::Service<
67                http::Request<tonic::body::BoxBody>,
68            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
69        {
70            QueryServiceClient::new(InterceptedService::new(inner, interceptor))
71        }
72        /// Compress requests with the given encoding.
73        ///
74        /// This requires the server to support it otherwise it might respond with an
75        /// error.
76        #[must_use]
77        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
78            self.inner = self.inner.send_compressed(encoding);
79            self
80        }
81        /// Enable decompressing responses.
82        #[must_use]
83        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
84            self.inner = self.inner.accept_compressed(encoding);
85            self
86        }
87        /// Limits the maximum size of a decoded message.
88        ///
89        /// Default: `4MB`
90        #[must_use]
91        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
92            self.inner = self.inner.max_decoding_message_size(limit);
93            self
94        }
95        /// Limits the maximum size of an encoded message.
96        ///
97        /// Default: `usize::MAX`
98        #[must_use]
99        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
100            self.inner = self.inner.max_encoding_message_size(limit);
101            self
102        }
103        pub async fn ping(
104            &mut self,
105            request: impl tonic::IntoRequest<super::PingRequest>,
106        ) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status> {
107            self.inner
108                .ready()
109                .await
110                .map_err(|e| {
111                    tonic::Status::unknown(
112                        format!("Service was not ready: {}", e.into()),
113                    )
114                })?;
115            let codec = tonic::codec::ProstCodec::default();
116            let path = http::uri::PathAndQuery::from_static(
117                "/chalk.engine.v1.QueryService/Ping",
118            );
119            let mut req = request.into_request();
120            req.extensions_mut()
121                .insert(GrpcMethod::new("chalk.engine.v1.QueryService", "Ping"));
122            self.inner.unary(req, path, codec).await
123        }
124        pub async fn online_query(
125            &mut self,
126            request: impl tonic::IntoRequest<
127                super::super::super::common::v1::OnlineQueryRequest,
128            >,
129        ) -> std::result::Result<
130            tonic::Response<super::super::super::common::v1::OnlineQueryResponse>,
131            tonic::Status,
132        > {
133            self.inner
134                .ready()
135                .await
136                .map_err(|e| {
137                    tonic::Status::unknown(
138                        format!("Service was not ready: {}", e.into()),
139                    )
140                })?;
141            let codec = tonic::codec::ProstCodec::default();
142            let path = http::uri::PathAndQuery::from_static(
143                "/chalk.engine.v1.QueryService/OnlineQuery",
144            );
145            let mut req = request.into_request();
146            req.extensions_mut()
147                .insert(GrpcMethod::new("chalk.engine.v1.QueryService", "OnlineQuery"));
148            self.inner.unary(req, path, codec).await
149        }
150        pub async fn online_query_bulk(
151            &mut self,
152            request: impl tonic::IntoRequest<
153                super::super::super::common::v1::OnlineQueryBulkRequest,
154            >,
155        ) -> std::result::Result<
156            tonic::Response<super::super::super::common::v1::OnlineQueryBulkResponse>,
157            tonic::Status,
158        > {
159            self.inner
160                .ready()
161                .await
162                .map_err(|e| {
163                    tonic::Status::unknown(
164                        format!("Service was not ready: {}", e.into()),
165                    )
166                })?;
167            let codec = tonic::codec::ProstCodec::default();
168            let path = http::uri::PathAndQuery::from_static(
169                "/chalk.engine.v1.QueryService/OnlineQueryBulk",
170            );
171            let mut req = request.into_request();
172            req.extensions_mut()
173                .insert(
174                    GrpcMethod::new("chalk.engine.v1.QueryService", "OnlineQueryBulk"),
175                );
176            self.inner.unary(req, path, codec).await
177        }
178        pub async fn online_query_multi(
179            &mut self,
180            request: impl tonic::IntoRequest<
181                super::super::super::common::v1::OnlineQueryMultiRequest,
182            >,
183        ) -> std::result::Result<
184            tonic::Response<super::super::super::common::v1::OnlineQueryMultiResponse>,
185            tonic::Status,
186        > {
187            self.inner
188                .ready()
189                .await
190                .map_err(|e| {
191                    tonic::Status::unknown(
192                        format!("Service was not ready: {}", e.into()),
193                    )
194                })?;
195            let codec = tonic::codec::ProstCodec::default();
196            let path = http::uri::PathAndQuery::from_static(
197                "/chalk.engine.v1.QueryService/OnlineQueryMulti",
198            );
199            let mut req = request.into_request();
200            req.extensions_mut()
201                .insert(
202                    GrpcMethod::new("chalk.engine.v1.QueryService", "OnlineQueryMulti"),
203                );
204            self.inner.unary(req, path, codec).await
205        }
206        pub async fn upload_features_bulk(
207            &mut self,
208            request: impl tonic::IntoRequest<
209                super::super::super::common::v1::UploadFeaturesBulkRequest,
210            >,
211        ) -> std::result::Result<
212            tonic::Response<super::super::super::common::v1::UploadFeaturesBulkResponse>,
213            tonic::Status,
214        > {
215            self.inner
216                .ready()
217                .await
218                .map_err(|e| {
219                    tonic::Status::unknown(
220                        format!("Service was not ready: {}", e.into()),
221                    )
222                })?;
223            let codec = tonic::codec::ProstCodec::default();
224            let path = http::uri::PathAndQuery::from_static(
225                "/chalk.engine.v1.QueryService/UploadFeaturesBulk",
226            );
227            let mut req = request.into_request();
228            req.extensions_mut()
229                .insert(
230                    GrpcMethod::new("chalk.engine.v1.QueryService", "UploadFeaturesBulk"),
231                );
232            self.inner.unary(req, path, codec).await
233        }
234        pub async fn upload_features(
235            &mut self,
236            request: impl tonic::IntoRequest<
237                super::super::super::common::v1::UploadFeaturesRequest,
238            >,
239        ) -> std::result::Result<
240            tonic::Response<super::super::super::common::v1::UploadFeaturesResponse>,
241            tonic::Status,
242        > {
243            self.inner
244                .ready()
245                .await
246                .map_err(|e| {
247                    tonic::Status::unknown(
248                        format!("Service was not ready: {}", e.into()),
249                    )
250                })?;
251            let codec = tonic::codec::ProstCodec::default();
252            let path = http::uri::PathAndQuery::from_static(
253                "/chalk.engine.v1.QueryService/UploadFeatures",
254            );
255            let mut req = request.into_request();
256            req.extensions_mut()
257                .insert(
258                    GrpcMethod::new("chalk.engine.v1.QueryService", "UploadFeatures"),
259                );
260            self.inner.unary(req, path, codec).await
261        }
262        /// PlanAggregateBackfill determines the estimated resources needed to backfill
263        /// an aggregate.
264        ///
265        /// This method is a duplicate of the PlanAggregateBackfill method
266        /// in the query_server.proto file. We should remove the query_server.proto method
267        /// and move that request to this service instead.
268        /// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
269        pub async fn plan_aggregate_backfill(
270            &mut self,
271            request: impl tonic::IntoRequest<
272                super::super::super::aggregate::v1::PlanAggregateBackfillRequest,
273            >,
274        ) -> std::result::Result<
275            tonic::Response<
276                super::super::super::aggregate::v1::PlanAggregateBackfillResponse,
277            >,
278            tonic::Status,
279        > {
280            self.inner
281                .ready()
282                .await
283                .map_err(|e| {
284                    tonic::Status::unknown(
285                        format!("Service was not ready: {}", e.into()),
286                    )
287                })?;
288            let codec = tonic::codec::ProstCodec::default();
289            let path = http::uri::PathAndQuery::from_static(
290                "/chalk.engine.v1.QueryService/PlanAggregateBackfill",
291            );
292            let mut req = request.into_request();
293            req.extensions_mut()
294                .insert(
295                    GrpcMethod::new(
296                        "chalk.engine.v1.QueryService",
297                        "PlanAggregateBackfill",
298                    ),
299                );
300            self.inner.unary(req, path, codec).await
301        }
302        /// This method is a duplicate of the PlanAggregateBackfill method
303        /// in the query_server.proto file. We should remove the query_server.proto method
304        /// and move that request to this service instead.
305        /// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
306        pub async fn get_aggregates(
307            &mut self,
308            request: impl tonic::IntoRequest<
309                super::super::super::aggregate::v1::GetAggregatesRequest,
310            >,
311        ) -> std::result::Result<
312            tonic::Response<super::super::super::aggregate::v1::GetAggregatesResponse>,
313            tonic::Status,
314        > {
315            self.inner
316                .ready()
317                .await
318                .map_err(|e| {
319                    tonic::Status::unknown(
320                        format!("Service was not ready: {}", e.into()),
321                    )
322                })?;
323            let codec = tonic::codec::ProstCodec::default();
324            let path = http::uri::PathAndQuery::from_static(
325                "/chalk.engine.v1.QueryService/GetAggregates",
326            );
327            let mut req = request.into_request();
328            req.extensions_mut()
329                .insert(
330                    GrpcMethod::new("chalk.engine.v1.QueryService", "GetAggregates"),
331                );
332            self.inner.unary(req, path, codec).await
333        }
334    }
335}