1pub mod lp_service_client {
4 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
5 use tonic::codegen::http::Uri;
6 use tonic::codegen::*;
7 #[derive(Debug, Clone)]
8 pub struct LpServiceClient<T> {
9 inner: tonic::client::Grpc<T>,
10 }
11 impl LpServiceClient<tonic::transport::Channel> {
12 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14 where
15 D: TryInto<tonic::transport::Endpoint>,
16 D::Error: Into<StdError>,
17 {
18 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
19 Ok(Self::new(conn))
20 }
21 }
22 impl<T> LpServiceClient<T>
23 where
24 T: tonic::client::GrpcService<tonic::body::BoxBody>,
25 T::Error: Into<StdError>,
26 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
27 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
28 {
29 pub fn new(inner: T) -> Self {
30 let inner = tonic::client::Grpc::new(inner);
31 Self { inner }
32 }
33 pub fn with_origin(inner: T, origin: Uri) -> Self {
34 let inner = tonic::client::Grpc::with_origin(inner, origin);
35 Self { inner }
36 }
37 pub fn with_interceptor<F>(
38 inner: T,
39 interceptor: F,
40 ) -> LpServiceClient<InterceptedService<T, F>>
41 where
42 F: tonic::service::Interceptor,
43 T::ResponseBody: Default,
44 T: tonic::codegen::Service<
45 http::Request<tonic::body::BoxBody>,
46 Response = http::Response<
47 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
48 >,
49 >,
50 <T as tonic::codegen::Service<
51 http::Request<tonic::body::BoxBody>,
52 >>::Error: Into<StdError> + Send + Sync,
53 {
54 LpServiceClient::new(InterceptedService::new(inner, interceptor))
55 }
56 #[must_use]
61 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
62 self.inner = self.inner.send_compressed(encoding);
63 self
64 }
65 #[must_use]
67 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
68 self.inner = self.inner.accept_compressed(encoding);
69 self
70 }
71 #[must_use]
75 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
76 self.inner = self.inner.max_decoding_message_size(limit);
77 self
78 }
79 #[must_use]
83 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
84 self.inner = self.inner.max_encoding_message_size(limit);
85 self
86 }
87 pub async fn get_etf_lp(
88 &mut self,
89 request: impl tonic::IntoRequest<super::GetEtfLpRequest>,
90 ) -> std::result::Result<tonic::Response<super::EtfLp>, tonic::Status> {
91 self.inner
92 .ready()
93 .await
94 .map_err(|e| {
95 tonic::Status::new(
96 tonic::Code::Unknown,
97 format!("Service was not ready: {}", e.into()),
98 )
99 })?;
100 let codec = tonic::codec::ProstCodec::default();
101 let path = http::uri::PathAndQuery::from_static(
102 "/kdo.v1.lp.LpService/GetEtfLp",
103 );
104 let mut req = request.into_request();
105 req.extensions_mut()
106 .insert(GrpcMethod::new("kdo.v1.lp.LpService", "GetEtfLp"));
107 self.inner.unary(req, path, codec).await
108 }
109 pub async fn list_etf_lps(
110 &mut self,
111 request: impl tonic::IntoRequest<super::ListEtfLpsRequest>,
112 ) -> std::result::Result<
113 tonic::Response<super::ListEtfLpsResponse>,
114 tonic::Status,
115 > {
116 self.inner
117 .ready()
118 .await
119 .map_err(|e| {
120 tonic::Status::new(
121 tonic::Code::Unknown,
122 format!("Service was not ready: {}", e.into()),
123 )
124 })?;
125 let codec = tonic::codec::ProstCodec::default();
126 let path = http::uri::PathAndQuery::from_static(
127 "/kdo.v1.lp.LpService/ListEtfLps",
128 );
129 let mut req = request.into_request();
130 req.extensions_mut()
131 .insert(GrpcMethod::new("kdo.v1.lp.LpService", "ListEtfLps"));
132 self.inner.unary(req, path, codec).await
133 }
134 pub async fn update_etf_lp(
135 &mut self,
136 request: impl tonic::IntoRequest<super::UpdateEtfLpRequest>,
137 ) -> std::result::Result<tonic::Response<super::EtfLp>, tonic::Status> {
138 self.inner
139 .ready()
140 .await
141 .map_err(|e| {
142 tonic::Status::new(
143 tonic::Code::Unknown,
144 format!("Service was not ready: {}", e.into()),
145 )
146 })?;
147 let codec = tonic::codec::ProstCodec::default();
148 let path = http::uri::PathAndQuery::from_static(
149 "/kdo.v1.lp.LpService/UpdateEtfLp",
150 );
151 let mut req = request.into_request();
152 req.extensions_mut()
153 .insert(GrpcMethod::new("kdo.v1.lp.LpService", "UpdateEtfLp"));
154 self.inner.unary(req, path, codec).await
155 }
156 pub async fn get_etf_lp_status(
157 &mut self,
158 request: impl tonic::IntoRequest<super::GetEtfLpStatusRequest>,
159 ) -> std::result::Result<tonic::Response<super::EtfLpStatus>, tonic::Status> {
160 self.inner
161 .ready()
162 .await
163 .map_err(|e| {
164 tonic::Status::new(
165 tonic::Code::Unknown,
166 format!("Service was not ready: {}", e.into()),
167 )
168 })?;
169 let codec = tonic::codec::ProstCodec::default();
170 let path = http::uri::PathAndQuery::from_static(
171 "/kdo.v1.lp.LpService/GetEtfLpStatus",
172 );
173 let mut req = request.into_request();
174 req.extensions_mut()
175 .insert(GrpcMethod::new("kdo.v1.lp.LpService", "GetEtfLpStatus"));
176 self.inner.unary(req, path, codec).await
177 }
178 pub async fn stream_etf_lp_status(
179 &mut self,
180 request: impl tonic::IntoRequest<super::StreamEtfLpStatusRequest>,
181 ) -> std::result::Result<
182 tonic::Response<tonic::codec::Streaming<super::EtfLpStatus>>,
183 tonic::Status,
184 > {
185 self.inner
186 .ready()
187 .await
188 .map_err(|e| {
189 tonic::Status::new(
190 tonic::Code::Unknown,
191 format!("Service was not ready: {}", e.into()),
192 )
193 })?;
194 let codec = tonic::codec::ProstCodec::default();
195 let path = http::uri::PathAndQuery::from_static(
196 "/kdo.v1.lp.LpService/StreamEtfLpStatus",
197 );
198 let mut req = request.into_request();
199 req.extensions_mut()
200 .insert(GrpcMethod::new("kdo.v1.lp.LpService", "StreamEtfLpStatus"));
201 self.inner.server_streaming(req, path, codec).await
202 }
203 pub async fn start_etf_lp(
204 &mut self,
205 request: impl tonic::IntoRequest<super::StartEtfLpRequest>,
206 ) -> std::result::Result<
207 tonic::Response<super::StartEtfLpResponse>,
208 tonic::Status,
209 > {
210 self.inner
211 .ready()
212 .await
213 .map_err(|e| {
214 tonic::Status::new(
215 tonic::Code::Unknown,
216 format!("Service was not ready: {}", e.into()),
217 )
218 })?;
219 let codec = tonic::codec::ProstCodec::default();
220 let path = http::uri::PathAndQuery::from_static(
221 "/kdo.v1.lp.LpService/StartEtfLp",
222 );
223 let mut req = request.into_request();
224 req.extensions_mut()
225 .insert(GrpcMethod::new("kdo.v1.lp.LpService", "StartEtfLp"));
226 self.inner.unary(req, path, codec).await
227 }
228 pub async fn stop_etf_lp(
229 &mut self,
230 request: impl tonic::IntoRequest<super::StopEtfLpRequest>,
231 ) -> std::result::Result<
232 tonic::Response<super::StopEtfLpResponse>,
233 tonic::Status,
234 > {
235 self.inner
236 .ready()
237 .await
238 .map_err(|e| {
239 tonic::Status::new(
240 tonic::Code::Unknown,
241 format!("Service was not ready: {}", e.into()),
242 )
243 })?;
244 let codec = tonic::codec::ProstCodec::default();
245 let path = http::uri::PathAndQuery::from_static(
246 "/kdo.v1.lp.LpService/StopEtfLp",
247 );
248 let mut req = request.into_request();
249 req.extensions_mut()
250 .insert(GrpcMethod::new("kdo.v1.lp.LpService", "StopEtfLp"));
251 self.inner.unary(req, path, codec).await
252 }
253 pub async fn stream_lp_events(
254 &mut self,
255 request: impl tonic::IntoRequest<super::StreamLpEventsRequest>,
256 ) -> std::result::Result<
257 tonic::Response<tonic::codec::Streaming<super::EtfLpEvent>>,
258 tonic::Status,
259 > {
260 self.inner
261 .ready()
262 .await
263 .map_err(|e| {
264 tonic::Status::new(
265 tonic::Code::Unknown,
266 format!("Service was not ready: {}", e.into()),
267 )
268 })?;
269 let codec = tonic::codec::ProstCodec::default();
270 let path = http::uri::PathAndQuery::from_static(
271 "/kdo.v1.lp.LpService/StreamLpEvents",
272 );
273 let mut req = request.into_request();
274 req.extensions_mut()
275 .insert(GrpcMethod::new("kdo.v1.lp.LpService", "StreamLpEvents"));
276 self.inner.server_streaming(req, path, codec).await
277 }
278 pub async fn get_user_orderbook(
279 &mut self,
280 request: impl tonic::IntoRequest<super::GetUserOrderBookRequest>,
281 ) -> std::result::Result<
282 tonic::Response<super::UserOrderbookData>,
283 tonic::Status,
284 > {
285 self.inner
286 .ready()
287 .await
288 .map_err(|e| {
289 tonic::Status::new(
290 tonic::Code::Unknown,
291 format!("Service was not ready: {}", e.into()),
292 )
293 })?;
294 let codec = tonic::codec::ProstCodec::default();
295 let path = http::uri::PathAndQuery::from_static(
296 "/kdo.v1.lp.LpService/GetUserOrderbook",
297 );
298 let mut req = request.into_request();
299 req.extensions_mut()
300 .insert(GrpcMethod::new("kdo.v1.lp.LpService", "GetUserOrderbook"));
301 self.inner.unary(req, path, codec).await
302 }
303 pub async fn stream_user_orderbook(
304 &mut self,
305 request: impl tonic::IntoRequest<super::GetUserOrderBookRequest>,
306 ) -> std::result::Result<
307 tonic::Response<tonic::codec::Streaming<super::UserOrderbookData>>,
308 tonic::Status,
309 > {
310 self.inner
311 .ready()
312 .await
313 .map_err(|e| {
314 tonic::Status::new(
315 tonic::Code::Unknown,
316 format!("Service was not ready: {}", e.into()),
317 )
318 })?;
319 let codec = tonic::codec::ProstCodec::default();
320 let path = http::uri::PathAndQuery::from_static(
321 "/kdo.v1.lp.LpService/StreamUserOrderbook",
322 );
323 let mut req = request.into_request();
324 req.extensions_mut()
325 .insert(GrpcMethod::new("kdo.v1.lp.LpService", "StreamUserOrderbook"));
326 self.inner.server_streaming(req, path, codec).await
327 }
328 }
329}
330pub mod lp_service_server {
332 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
333 use tonic::codegen::*;
334 #[async_trait]
336 pub trait LpService: Send + Sync + 'static {
337 async fn get_etf_lp(
338 &self,
339 request: tonic::Request<super::GetEtfLpRequest>,
340 ) -> std::result::Result<tonic::Response<super::EtfLp>, tonic::Status>;
341 async fn list_etf_lps(
342 &self,
343 request: tonic::Request<super::ListEtfLpsRequest>,
344 ) -> std::result::Result<
345 tonic::Response<super::ListEtfLpsResponse>,
346 tonic::Status,
347 >;
348 async fn update_etf_lp(
349 &self,
350 request: tonic::Request<super::UpdateEtfLpRequest>,
351 ) -> std::result::Result<tonic::Response<super::EtfLp>, tonic::Status>;
352 async fn get_etf_lp_status(
353 &self,
354 request: tonic::Request<super::GetEtfLpStatusRequest>,
355 ) -> std::result::Result<tonic::Response<super::EtfLpStatus>, tonic::Status>;
356 type StreamEtfLpStatusStream: tonic::codegen::tokio_stream::Stream<
358 Item = std::result::Result<super::EtfLpStatus, tonic::Status>,
359 >
360 + Send
361 + 'static;
362 async fn stream_etf_lp_status(
363 &self,
364 request: tonic::Request<super::StreamEtfLpStatusRequest>,
365 ) -> std::result::Result<
366 tonic::Response<Self::StreamEtfLpStatusStream>,
367 tonic::Status,
368 >;
369 async fn start_etf_lp(
370 &self,
371 request: tonic::Request<super::StartEtfLpRequest>,
372 ) -> std::result::Result<
373 tonic::Response<super::StartEtfLpResponse>,
374 tonic::Status,
375 >;
376 async fn stop_etf_lp(
377 &self,
378 request: tonic::Request<super::StopEtfLpRequest>,
379 ) -> std::result::Result<
380 tonic::Response<super::StopEtfLpResponse>,
381 tonic::Status,
382 >;
383 type StreamLpEventsStream: tonic::codegen::tokio_stream::Stream<
385 Item = std::result::Result<super::EtfLpEvent, tonic::Status>,
386 >
387 + Send
388 + 'static;
389 async fn stream_lp_events(
390 &self,
391 request: tonic::Request<super::StreamLpEventsRequest>,
392 ) -> std::result::Result<
393 tonic::Response<Self::StreamLpEventsStream>,
394 tonic::Status,
395 >;
396 async fn get_user_orderbook(
397 &self,
398 request: tonic::Request<super::GetUserOrderBookRequest>,
399 ) -> std::result::Result<
400 tonic::Response<super::UserOrderbookData>,
401 tonic::Status,
402 >;
403 type StreamUserOrderbookStream: tonic::codegen::tokio_stream::Stream<
405 Item = std::result::Result<super::UserOrderbookData, tonic::Status>,
406 >
407 + Send
408 + 'static;
409 async fn stream_user_orderbook(
410 &self,
411 request: tonic::Request<super::GetUserOrderBookRequest>,
412 ) -> std::result::Result<
413 tonic::Response<Self::StreamUserOrderbookStream>,
414 tonic::Status,
415 >;
416 }
417 #[derive(Debug)]
418 pub struct LpServiceServer<T: LpService> {
419 inner: Arc<T>,
420 accept_compression_encodings: EnabledCompressionEncodings,
421 send_compression_encodings: EnabledCompressionEncodings,
422 max_decoding_message_size: Option<usize>,
423 max_encoding_message_size: Option<usize>,
424 }
425 impl<T: LpService> LpServiceServer<T> {
426 pub fn new(inner: T) -> Self {
427 Self::from_arc(Arc::new(inner))
428 }
429 pub fn from_arc(inner: Arc<T>) -> Self {
430 Self {
431 inner,
432 accept_compression_encodings: Default::default(),
433 send_compression_encodings: Default::default(),
434 max_decoding_message_size: None,
435 max_encoding_message_size: None,
436 }
437 }
438 pub fn with_interceptor<F>(
439 inner: T,
440 interceptor: F,
441 ) -> InterceptedService<Self, F>
442 where
443 F: tonic::service::Interceptor,
444 {
445 InterceptedService::new(Self::new(inner), interceptor)
446 }
447 #[must_use]
449 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
450 self.accept_compression_encodings.enable(encoding);
451 self
452 }
453 #[must_use]
455 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
456 self.send_compression_encodings.enable(encoding);
457 self
458 }
459 #[must_use]
463 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
464 self.max_decoding_message_size = Some(limit);
465 self
466 }
467 #[must_use]
471 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
472 self.max_encoding_message_size = Some(limit);
473 self
474 }
475 }
476 impl<T, B> tonic::codegen::Service<http::Request<B>> for LpServiceServer<T>
477 where
478 T: LpService,
479 B: Body + Send + 'static,
480 B::Error: Into<StdError> + Send + 'static,
481 {
482 type Response = http::Response<tonic::body::BoxBody>;
483 type Error = std::convert::Infallible;
484 type Future = BoxFuture<Self::Response, Self::Error>;
485 fn poll_ready(
486 &mut self,
487 _cx: &mut Context<'_>,
488 ) -> Poll<std::result::Result<(), Self::Error>> {
489 Poll::Ready(Ok(()))
490 }
491 fn call(&mut self, req: http::Request<B>) -> Self::Future {
492 match req.uri().path() {
493 "/kdo.v1.lp.LpService/GetEtfLp" => {
494 #[allow(non_camel_case_types)]
495 struct GetEtfLpSvc<T: LpService>(pub Arc<T>);
496 impl<
497 T: LpService,
498 > tonic::server::UnaryService<super::GetEtfLpRequest>
499 for GetEtfLpSvc<T> {
500 type Response = super::EtfLp;
501 type Future = BoxFuture<
502 tonic::Response<Self::Response>,
503 tonic::Status,
504 >;
505 fn call(
506 &mut self,
507 request: tonic::Request<super::GetEtfLpRequest>,
508 ) -> Self::Future {
509 let inner = Arc::clone(&self.0);
510 let fut = async move {
511 <T as LpService>::get_etf_lp(&inner, request).await
512 };
513 Box::pin(fut)
514 }
515 }
516 let accept_compression_encodings = self.accept_compression_encodings;
517 let send_compression_encodings = self.send_compression_encodings;
518 let max_decoding_message_size = self.max_decoding_message_size;
519 let max_encoding_message_size = self.max_encoding_message_size;
520 let inner = self.inner.clone();
521 let fut = async move {
522 let method = GetEtfLpSvc(inner);
523 let codec = tonic::codec::ProstCodec::default();
524 let mut grpc = tonic::server::Grpc::new(codec)
525 .apply_compression_config(
526 accept_compression_encodings,
527 send_compression_encodings,
528 )
529 .apply_max_message_size_config(
530 max_decoding_message_size,
531 max_encoding_message_size,
532 );
533 let res = grpc.unary(method, req).await;
534 Ok(res)
535 };
536 Box::pin(fut)
537 }
538 "/kdo.v1.lp.LpService/ListEtfLps" => {
539 #[allow(non_camel_case_types)]
540 struct ListEtfLpsSvc<T: LpService>(pub Arc<T>);
541 impl<
542 T: LpService,
543 > tonic::server::UnaryService<super::ListEtfLpsRequest>
544 for ListEtfLpsSvc<T> {
545 type Response = super::ListEtfLpsResponse;
546 type Future = BoxFuture<
547 tonic::Response<Self::Response>,
548 tonic::Status,
549 >;
550 fn call(
551 &mut self,
552 request: tonic::Request<super::ListEtfLpsRequest>,
553 ) -> Self::Future {
554 let inner = Arc::clone(&self.0);
555 let fut = async move {
556 <T as LpService>::list_etf_lps(&inner, request).await
557 };
558 Box::pin(fut)
559 }
560 }
561 let accept_compression_encodings = self.accept_compression_encodings;
562 let send_compression_encodings = self.send_compression_encodings;
563 let max_decoding_message_size = self.max_decoding_message_size;
564 let max_encoding_message_size = self.max_encoding_message_size;
565 let inner = self.inner.clone();
566 let fut = async move {
567 let method = ListEtfLpsSvc(inner);
568 let codec = tonic::codec::ProstCodec::default();
569 let mut grpc = tonic::server::Grpc::new(codec)
570 .apply_compression_config(
571 accept_compression_encodings,
572 send_compression_encodings,
573 )
574 .apply_max_message_size_config(
575 max_decoding_message_size,
576 max_encoding_message_size,
577 );
578 let res = grpc.unary(method, req).await;
579 Ok(res)
580 };
581 Box::pin(fut)
582 }
583 "/kdo.v1.lp.LpService/UpdateEtfLp" => {
584 #[allow(non_camel_case_types)]
585 struct UpdateEtfLpSvc<T: LpService>(pub Arc<T>);
586 impl<
587 T: LpService,
588 > tonic::server::UnaryService<super::UpdateEtfLpRequest>
589 for UpdateEtfLpSvc<T> {
590 type Response = super::EtfLp;
591 type Future = BoxFuture<
592 tonic::Response<Self::Response>,
593 tonic::Status,
594 >;
595 fn call(
596 &mut self,
597 request: tonic::Request<super::UpdateEtfLpRequest>,
598 ) -> Self::Future {
599 let inner = Arc::clone(&self.0);
600 let fut = async move {
601 <T as LpService>::update_etf_lp(&inner, request).await
602 };
603 Box::pin(fut)
604 }
605 }
606 let accept_compression_encodings = self.accept_compression_encodings;
607 let send_compression_encodings = self.send_compression_encodings;
608 let max_decoding_message_size = self.max_decoding_message_size;
609 let max_encoding_message_size = self.max_encoding_message_size;
610 let inner = self.inner.clone();
611 let fut = async move {
612 let method = UpdateEtfLpSvc(inner);
613 let codec = tonic::codec::ProstCodec::default();
614 let mut grpc = tonic::server::Grpc::new(codec)
615 .apply_compression_config(
616 accept_compression_encodings,
617 send_compression_encodings,
618 )
619 .apply_max_message_size_config(
620 max_decoding_message_size,
621 max_encoding_message_size,
622 );
623 let res = grpc.unary(method, req).await;
624 Ok(res)
625 };
626 Box::pin(fut)
627 }
628 "/kdo.v1.lp.LpService/GetEtfLpStatus" => {
629 #[allow(non_camel_case_types)]
630 struct GetEtfLpStatusSvc<T: LpService>(pub Arc<T>);
631 impl<
632 T: LpService,
633 > tonic::server::UnaryService<super::GetEtfLpStatusRequest>
634 for GetEtfLpStatusSvc<T> {
635 type Response = super::EtfLpStatus;
636 type Future = BoxFuture<
637 tonic::Response<Self::Response>,
638 tonic::Status,
639 >;
640 fn call(
641 &mut self,
642 request: tonic::Request<super::GetEtfLpStatusRequest>,
643 ) -> Self::Future {
644 let inner = Arc::clone(&self.0);
645 let fut = async move {
646 <T as LpService>::get_etf_lp_status(&inner, request).await
647 };
648 Box::pin(fut)
649 }
650 }
651 let accept_compression_encodings = self.accept_compression_encodings;
652 let send_compression_encodings = self.send_compression_encodings;
653 let max_decoding_message_size = self.max_decoding_message_size;
654 let max_encoding_message_size = self.max_encoding_message_size;
655 let inner = self.inner.clone();
656 let fut = async move {
657 let method = GetEtfLpStatusSvc(inner);
658 let codec = tonic::codec::ProstCodec::default();
659 let mut grpc = tonic::server::Grpc::new(codec)
660 .apply_compression_config(
661 accept_compression_encodings,
662 send_compression_encodings,
663 )
664 .apply_max_message_size_config(
665 max_decoding_message_size,
666 max_encoding_message_size,
667 );
668 let res = grpc.unary(method, req).await;
669 Ok(res)
670 };
671 Box::pin(fut)
672 }
673 "/kdo.v1.lp.LpService/StreamEtfLpStatus" => {
674 #[allow(non_camel_case_types)]
675 struct StreamEtfLpStatusSvc<T: LpService>(pub Arc<T>);
676 impl<
677 T: LpService,
678 > tonic::server::ServerStreamingService<
679 super::StreamEtfLpStatusRequest,
680 > for StreamEtfLpStatusSvc<T> {
681 type Response = super::EtfLpStatus;
682 type ResponseStream = T::StreamEtfLpStatusStream;
683 type Future = BoxFuture<
684 tonic::Response<Self::ResponseStream>,
685 tonic::Status,
686 >;
687 fn call(
688 &mut self,
689 request: tonic::Request<super::StreamEtfLpStatusRequest>,
690 ) -> Self::Future {
691 let inner = Arc::clone(&self.0);
692 let fut = async move {
693 <T as LpService>::stream_etf_lp_status(&inner, request)
694 .await
695 };
696 Box::pin(fut)
697 }
698 }
699 let accept_compression_encodings = self.accept_compression_encodings;
700 let send_compression_encodings = self.send_compression_encodings;
701 let max_decoding_message_size = self.max_decoding_message_size;
702 let max_encoding_message_size = self.max_encoding_message_size;
703 let inner = self.inner.clone();
704 let fut = async move {
705 let method = StreamEtfLpStatusSvc(inner);
706 let codec = tonic::codec::ProstCodec::default();
707 let mut grpc = tonic::server::Grpc::new(codec)
708 .apply_compression_config(
709 accept_compression_encodings,
710 send_compression_encodings,
711 )
712 .apply_max_message_size_config(
713 max_decoding_message_size,
714 max_encoding_message_size,
715 );
716 let res = grpc.server_streaming(method, req).await;
717 Ok(res)
718 };
719 Box::pin(fut)
720 }
721 "/kdo.v1.lp.LpService/StartEtfLp" => {
722 #[allow(non_camel_case_types)]
723 struct StartEtfLpSvc<T: LpService>(pub Arc<T>);
724 impl<
725 T: LpService,
726 > tonic::server::UnaryService<super::StartEtfLpRequest>
727 for StartEtfLpSvc<T> {
728 type Response = super::StartEtfLpResponse;
729 type Future = BoxFuture<
730 tonic::Response<Self::Response>,
731 tonic::Status,
732 >;
733 fn call(
734 &mut self,
735 request: tonic::Request<super::StartEtfLpRequest>,
736 ) -> Self::Future {
737 let inner = Arc::clone(&self.0);
738 let fut = async move {
739 <T as LpService>::start_etf_lp(&inner, request).await
740 };
741 Box::pin(fut)
742 }
743 }
744 let accept_compression_encodings = self.accept_compression_encodings;
745 let send_compression_encodings = self.send_compression_encodings;
746 let max_decoding_message_size = self.max_decoding_message_size;
747 let max_encoding_message_size = self.max_encoding_message_size;
748 let inner = self.inner.clone();
749 let fut = async move {
750 let method = StartEtfLpSvc(inner);
751 let codec = tonic::codec::ProstCodec::default();
752 let mut grpc = tonic::server::Grpc::new(codec)
753 .apply_compression_config(
754 accept_compression_encodings,
755 send_compression_encodings,
756 )
757 .apply_max_message_size_config(
758 max_decoding_message_size,
759 max_encoding_message_size,
760 );
761 let res = grpc.unary(method, req).await;
762 Ok(res)
763 };
764 Box::pin(fut)
765 }
766 "/kdo.v1.lp.LpService/StopEtfLp" => {
767 #[allow(non_camel_case_types)]
768 struct StopEtfLpSvc<T: LpService>(pub Arc<T>);
769 impl<
770 T: LpService,
771 > tonic::server::UnaryService<super::StopEtfLpRequest>
772 for StopEtfLpSvc<T> {
773 type Response = super::StopEtfLpResponse;
774 type Future = BoxFuture<
775 tonic::Response<Self::Response>,
776 tonic::Status,
777 >;
778 fn call(
779 &mut self,
780 request: tonic::Request<super::StopEtfLpRequest>,
781 ) -> Self::Future {
782 let inner = Arc::clone(&self.0);
783 let fut = async move {
784 <T as LpService>::stop_etf_lp(&inner, request).await
785 };
786 Box::pin(fut)
787 }
788 }
789 let accept_compression_encodings = self.accept_compression_encodings;
790 let send_compression_encodings = self.send_compression_encodings;
791 let max_decoding_message_size = self.max_decoding_message_size;
792 let max_encoding_message_size = self.max_encoding_message_size;
793 let inner = self.inner.clone();
794 let fut = async move {
795 let method = StopEtfLpSvc(inner);
796 let codec = tonic::codec::ProstCodec::default();
797 let mut grpc = tonic::server::Grpc::new(codec)
798 .apply_compression_config(
799 accept_compression_encodings,
800 send_compression_encodings,
801 )
802 .apply_max_message_size_config(
803 max_decoding_message_size,
804 max_encoding_message_size,
805 );
806 let res = grpc.unary(method, req).await;
807 Ok(res)
808 };
809 Box::pin(fut)
810 }
811 "/kdo.v1.lp.LpService/StreamLpEvents" => {
812 #[allow(non_camel_case_types)]
813 struct StreamLpEventsSvc<T: LpService>(pub Arc<T>);
814 impl<
815 T: LpService,
816 > tonic::server::ServerStreamingService<super::StreamLpEventsRequest>
817 for StreamLpEventsSvc<T> {
818 type Response = super::EtfLpEvent;
819 type ResponseStream = T::StreamLpEventsStream;
820 type Future = BoxFuture<
821 tonic::Response<Self::ResponseStream>,
822 tonic::Status,
823 >;
824 fn call(
825 &mut self,
826 request: tonic::Request<super::StreamLpEventsRequest>,
827 ) -> Self::Future {
828 let inner = Arc::clone(&self.0);
829 let fut = async move {
830 <T as LpService>::stream_lp_events(&inner, request).await
831 };
832 Box::pin(fut)
833 }
834 }
835 let accept_compression_encodings = self.accept_compression_encodings;
836 let send_compression_encodings = self.send_compression_encodings;
837 let max_decoding_message_size = self.max_decoding_message_size;
838 let max_encoding_message_size = self.max_encoding_message_size;
839 let inner = self.inner.clone();
840 let fut = async move {
841 let method = StreamLpEventsSvc(inner);
842 let codec = tonic::codec::ProstCodec::default();
843 let mut grpc = tonic::server::Grpc::new(codec)
844 .apply_compression_config(
845 accept_compression_encodings,
846 send_compression_encodings,
847 )
848 .apply_max_message_size_config(
849 max_decoding_message_size,
850 max_encoding_message_size,
851 );
852 let res = grpc.server_streaming(method, req).await;
853 Ok(res)
854 };
855 Box::pin(fut)
856 }
857 "/kdo.v1.lp.LpService/GetUserOrderbook" => {
858 #[allow(non_camel_case_types)]
859 struct GetUserOrderbookSvc<T: LpService>(pub Arc<T>);
860 impl<
861 T: LpService,
862 > tonic::server::UnaryService<super::GetUserOrderBookRequest>
863 for GetUserOrderbookSvc<T> {
864 type Response = super::UserOrderbookData;
865 type Future = BoxFuture<
866 tonic::Response<Self::Response>,
867 tonic::Status,
868 >;
869 fn call(
870 &mut self,
871 request: tonic::Request<super::GetUserOrderBookRequest>,
872 ) -> Self::Future {
873 let inner = Arc::clone(&self.0);
874 let fut = async move {
875 <T as LpService>::get_user_orderbook(&inner, request).await
876 };
877 Box::pin(fut)
878 }
879 }
880 let accept_compression_encodings = self.accept_compression_encodings;
881 let send_compression_encodings = self.send_compression_encodings;
882 let max_decoding_message_size = self.max_decoding_message_size;
883 let max_encoding_message_size = self.max_encoding_message_size;
884 let inner = self.inner.clone();
885 let fut = async move {
886 let method = GetUserOrderbookSvc(inner);
887 let codec = tonic::codec::ProstCodec::default();
888 let mut grpc = tonic::server::Grpc::new(codec)
889 .apply_compression_config(
890 accept_compression_encodings,
891 send_compression_encodings,
892 )
893 .apply_max_message_size_config(
894 max_decoding_message_size,
895 max_encoding_message_size,
896 );
897 let res = grpc.unary(method, req).await;
898 Ok(res)
899 };
900 Box::pin(fut)
901 }
902 "/kdo.v1.lp.LpService/StreamUserOrderbook" => {
903 #[allow(non_camel_case_types)]
904 struct StreamUserOrderbookSvc<T: LpService>(pub Arc<T>);
905 impl<
906 T: LpService,
907 > tonic::server::ServerStreamingService<
908 super::GetUserOrderBookRequest,
909 > for StreamUserOrderbookSvc<T> {
910 type Response = super::UserOrderbookData;
911 type ResponseStream = T::StreamUserOrderbookStream;
912 type Future = BoxFuture<
913 tonic::Response<Self::ResponseStream>,
914 tonic::Status,
915 >;
916 fn call(
917 &mut self,
918 request: tonic::Request<super::GetUserOrderBookRequest>,
919 ) -> Self::Future {
920 let inner = Arc::clone(&self.0);
921 let fut = async move {
922 <T as LpService>::stream_user_orderbook(&inner, request)
923 .await
924 };
925 Box::pin(fut)
926 }
927 }
928 let accept_compression_encodings = self.accept_compression_encodings;
929 let send_compression_encodings = self.send_compression_encodings;
930 let max_decoding_message_size = self.max_decoding_message_size;
931 let max_encoding_message_size = self.max_encoding_message_size;
932 let inner = self.inner.clone();
933 let fut = async move {
934 let method = StreamUserOrderbookSvc(inner);
935 let codec = tonic::codec::ProstCodec::default();
936 let mut grpc = tonic::server::Grpc::new(codec)
937 .apply_compression_config(
938 accept_compression_encodings,
939 send_compression_encodings,
940 )
941 .apply_max_message_size_config(
942 max_decoding_message_size,
943 max_encoding_message_size,
944 );
945 let res = grpc.server_streaming(method, req).await;
946 Ok(res)
947 };
948 Box::pin(fut)
949 }
950 _ => {
951 Box::pin(async move {
952 Ok(
953 http::Response::builder()
954 .status(200)
955 .header("grpc-status", tonic::Code::Unimplemented as i32)
956 .header(
957 http::header::CONTENT_TYPE,
958 tonic::metadata::GRPC_CONTENT_TYPE,
959 )
960 .body(empty_body())
961 .unwrap(),
962 )
963 })
964 }
965 }
966 }
967 }
968 impl<T: LpService> Clone for LpServiceServer<T> {
969 fn clone(&self) -> Self {
970 let inner = self.inner.clone();
971 Self {
972 inner,
973 accept_compression_encodings: self.accept_compression_encodings,
974 send_compression_encodings: self.send_compression_encodings,
975 max_decoding_message_size: self.max_decoding_message_size,
976 max_encoding_message_size: self.max_encoding_message_size,
977 }
978 }
979 }
980 impl<T: LpService> tonic::server::NamedService for LpServiceServer<T> {
981 const NAME: &'static str = "kdo.v1.lp.LpService";
982 }
983}