1#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct KnowledgeEntry {
5 #[prost(string, tag = "1")]
6 pub id: ::prost::alloc::string::String,
7 #[prost(string, tag = "2")]
8 pub title: ::prost::alloc::string::String,
9 #[prost(string, tag = "3")]
10 pub content: ::prost::alloc::string::String,
11 #[prost(string, optional, tag = "4")]
12 pub category: ::core::option::Option<::prost::alloc::string::String>,
13 #[prost(string, repeated, tag = "5")]
14 pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
15 #[prost(string, optional, tag = "6")]
16 pub source: ::core::option::Option<::prost::alloc::string::String>,
17 #[prost(map = "string, string", tag = "7")]
18 pub metadata: ::std::collections::HashMap<
19 ::prost::alloc::string::String,
20 ::prost::alloc::string::String,
21 >,
22 #[prost(string, tag = "8")]
23 pub created_at: ::prost::alloc::string::String,
24 #[prost(string, tag = "9")]
25 pub updated_at: ::prost::alloc::string::String,
26 #[prost(uint64, tag = "10")]
27 pub access_count: u64,
28 #[prost(float, tag = "11")]
29 pub learned_relevance: f32,
30 #[prost(string, repeated, tag = "12")]
31 pub related_entries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
32}
33#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct AddEntryRequest {
36 #[prost(string, tag = "1")]
37 pub title: ::prost::alloc::string::String,
38 #[prost(string, tag = "2")]
39 pub content: ::prost::alloc::string::String,
40 #[prost(string, optional, tag = "3")]
41 pub category: ::core::option::Option<::prost::alloc::string::String>,
42 #[prost(string, repeated, tag = "4")]
43 pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
44 #[prost(string, optional, tag = "5")]
45 pub source: ::core::option::Option<::prost::alloc::string::String>,
46 #[prost(map = "string, string", tag = "6")]
47 pub metadata: ::std::collections::HashMap<
48 ::prost::alloc::string::String,
49 ::prost::alloc::string::String,
50 >,
51}
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct AddEntryResponse {
54 #[prost(string, tag = "1")]
55 pub id: ::prost::alloc::string::String,
56 #[prost(bool, tag = "2")]
57 pub success: bool,
58 #[prost(string, optional, tag = "3")]
59 pub error: ::core::option::Option<::prost::alloc::string::String>,
60}
61#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct AddEntriesRequest {
64 #[prost(message, repeated, tag = "1")]
65 pub entries: ::prost::alloc::vec::Vec<AddEntryRequest>,
66}
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct AddEntriesResponse {
69 #[prost(string, repeated, tag = "1")]
70 pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
71 #[prost(bool, tag = "2")]
72 pub success: bool,
73 #[prost(string, optional, tag = "3")]
74 pub error: ::core::option::Option<::prost::alloc::string::String>,
75}
76#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct GetEntryRequest {
79 #[prost(string, tag = "1")]
80 pub id: ::prost::alloc::string::String,
81}
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct GetEntryResponse {
84 #[prost(message, optional, tag = "1")]
85 pub entry: ::core::option::Option<KnowledgeEntry>,
86 #[prost(bool, tag = "2")]
87 pub found: bool,
88}
89#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct UpdateEntryRequest {
92 #[prost(string, tag = "1")]
93 pub id: ::prost::alloc::string::String,
94 #[prost(string, optional, tag = "2")]
95 pub title: ::core::option::Option<::prost::alloc::string::String>,
96 #[prost(string, optional, tag = "3")]
97 pub content: ::core::option::Option<::prost::alloc::string::String>,
98 #[prost(string, optional, tag = "4")]
99 pub category: ::core::option::Option<::prost::alloc::string::String>,
100 #[prost(string, repeated, tag = "5")]
101 pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
102 #[prost(string, optional, tag = "6")]
103 pub source: ::core::option::Option<::prost::alloc::string::String>,
104 #[prost(map = "string, string", tag = "7")]
105 pub metadata: ::std::collections::HashMap<
106 ::prost::alloc::string::String,
107 ::prost::alloc::string::String,
108 >,
109}
110#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct UpdateEntryResponse {
112 #[prost(bool, tag = "1")]
113 pub success: bool,
114 #[prost(string, optional, tag = "2")]
115 pub error: ::core::option::Option<::prost::alloc::string::String>,
116}
117#[derive(Clone, PartialEq, ::prost::Message)]
119pub struct DeleteEntryRequest {
120 #[prost(string, tag = "1")]
121 pub id: ::prost::alloc::string::String,
122}
123#[derive(Clone, PartialEq, ::prost::Message)]
124pub struct DeleteEntryResponse {
125 #[prost(bool, tag = "1")]
126 pub success: bool,
127 #[prost(string, optional, tag = "2")]
128 pub error: ::core::option::Option<::prost::alloc::string::String>,
129}
130#[derive(Clone, PartialEq, ::prost::Message)]
132pub struct SearchRequest {
133 #[prost(string, tag = "1")]
134 pub query: ::prost::alloc::string::String,
135 #[prost(uint32, tag = "2")]
136 pub limit: u32,
137 #[prost(float, tag = "3")]
138 pub min_similarity: f32,
139 #[prost(string, optional, tag = "4")]
140 pub category: ::core::option::Option<::prost::alloc::string::String>,
141 #[prost(string, repeated, tag = "5")]
142 pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
143 #[prost(bool, tag = "6")]
144 pub use_learning: bool,
145 #[prost(bool, tag = "7")]
146 pub include_related: bool,
147 #[prost(float, tag = "8")]
148 pub diversity: f32,
149 #[prost(bool, tag = "9")]
150 pub hybrid: bool,
151 #[prost(float, tag = "10")]
152 pub keyword_weight: f32,
153}
154#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct SearchResult {
157 #[prost(message, optional, tag = "1")]
158 pub entry: ::core::option::Option<KnowledgeEntry>,
159 #[prost(float, tag = "2")]
160 pub similarity: f32,
161 #[prost(float, tag = "3")]
162 pub relevance_boost: f32,
163 #[prost(float, tag = "4")]
164 pub score: f32,
165 #[prost(float, tag = "5")]
166 pub distance: f32,
167}
168#[derive(Clone, PartialEq, ::prost::Message)]
169pub struct SearchResponse {
170 #[prost(message, repeated, tag = "1")]
171 pub results: ::prost::alloc::vec::Vec<SearchResult>,
172 #[prost(uint32, tag = "2")]
173 pub total_results: u32,
174 #[prost(float, tag = "3")]
175 pub search_time_ms: f32,
176}
177#[derive(Clone, PartialEq, ::prost::Message)]
179pub struct FeedbackRequest {
180 #[prost(string, tag = "1")]
181 pub entry_id: ::prost::alloc::string::String,
182 #[prost(bool, tag = "2")]
183 pub positive: bool,
184 #[prost(string, optional, tag = "3")]
185 pub query_context: ::core::option::Option<::prost::alloc::string::String>,
186}
187#[derive(Clone, Copy, PartialEq, ::prost::Message)]
188pub struct FeedbackResponse {
189 #[prost(bool, tag = "1")]
190 pub success: bool,
191}
192#[derive(Clone, PartialEq, ::prost::Message)]
194pub struct GetRelatedRequest {
195 #[prost(string, tag = "1")]
196 pub id: ::prost::alloc::string::String,
197 #[prost(uint32, tag = "2")]
198 pub limit: u32,
199}
200#[derive(Clone, PartialEq, ::prost::Message)]
201pub struct GetRelatedResponse {
202 #[prost(message, repeated, tag = "1")]
203 pub entries: ::prost::alloc::vec::Vec<KnowledgeEntry>,
204}
205#[derive(Clone, PartialEq, ::prost::Message)]
207pub struct LinkEntriesRequest {
208 #[prost(string, tag = "1")]
209 pub id1: ::prost::alloc::string::String,
210 #[prost(string, tag = "2")]
211 pub id2: ::prost::alloc::string::String,
212}
213#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct LinkEntriesResponse {
215 #[prost(bool, tag = "1")]
216 pub success: bool,
217 #[prost(string, optional, tag = "2")]
218 pub error: ::core::option::Option<::prost::alloc::string::String>,
219}
220#[derive(Clone, Copy, PartialEq, ::prost::Message)]
222pub struct GetStatsRequest {}
223#[derive(Clone, Copy, PartialEq, ::prost::Message)]
224pub struct GetStatsResponse {
225 #[prost(uint64, tag = "1")]
226 pub total_entries: u64,
227 #[prost(uint64, tag = "2")]
228 pub unique_categories: u64,
229 #[prost(uint64, tag = "3")]
230 pub unique_tags: u64,
231 #[prost(uint64, tag = "4")]
232 pub total_access_count: u64,
233 #[prost(uint32, tag = "5")]
234 pub dimensions: u32,
235 #[prost(bool, tag = "6")]
236 pub learning_enabled: bool,
237 #[prost(message, optional, tag = "7")]
238 pub learning_stats: ::core::option::Option<LearningStats>,
239}
240#[derive(Clone, Copy, PartialEq, ::prost::Message)]
241pub struct LearningStats {
242 #[prost(uint64, tag = "1")]
243 pub query_count: u64,
244 #[prost(uint64, tag = "2")]
245 pub replay_buffer_size: u64,
246 #[prost(uint64, tag = "3")]
247 pub learned_entries: u64,
248 #[prost(float, tag = "4")]
249 pub avg_relevance_weight: f32,
250 #[prost(float, tag = "5")]
251 pub weight_variance: f32,
252}
253#[derive(Clone, Copy, PartialEq, ::prost::Message)]
255pub struct HealthRequest {}
256#[derive(Clone, PartialEq, ::prost::Message)]
257pub struct HealthResponse {
258 #[prost(bool, tag = "1")]
259 pub healthy: bool,
260 #[prost(string, tag = "2")]
261 pub version: ::prost::alloc::string::String,
262 #[prost(uint64, tag = "3")]
263 pub uptime_seconds: u64,
264}
265pub mod knowledge_service_client {
267 #![allow(
268 unused_variables,
269 dead_code,
270 missing_docs,
271 clippy::wildcard_imports,
272 clippy::let_unit_value,
273 )]
274 use tonic::codegen::*;
275 use tonic::codegen::http::Uri;
276 #[derive(Debug, Clone)]
279 pub struct KnowledgeServiceClient<T> {
280 inner: tonic::client::Grpc<T>,
281 }
282 impl KnowledgeServiceClient<tonic::transport::Channel> {
283 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
285 where
286 D: TryInto<tonic::transport::Endpoint>,
287 D::Error: Into<StdError>,
288 {
289 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
290 Ok(Self::new(conn))
291 }
292 }
293 impl<T> KnowledgeServiceClient<T>
294 where
295 T: tonic::client::GrpcService<tonic::body::BoxBody>,
296 T::Error: Into<StdError>,
297 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
298 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
299 {
300 pub fn new(inner: T) -> Self {
301 let inner = tonic::client::Grpc::new(inner);
302 Self { inner }
303 }
304 pub fn with_origin(inner: T, origin: Uri) -> Self {
305 let inner = tonic::client::Grpc::with_origin(inner, origin);
306 Self { inner }
307 }
308 pub fn with_interceptor<F>(
309 inner: T,
310 interceptor: F,
311 ) -> KnowledgeServiceClient<InterceptedService<T, F>>
312 where
313 F: tonic::service::Interceptor,
314 T::ResponseBody: Default,
315 T: tonic::codegen::Service<
316 http::Request<tonic::body::BoxBody>,
317 Response = http::Response<
318 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
319 >,
320 >,
321 <T as tonic::codegen::Service<
322 http::Request<tonic::body::BoxBody>,
323 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
324 {
325 KnowledgeServiceClient::new(InterceptedService::new(inner, interceptor))
326 }
327 #[must_use]
332 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
333 self.inner = self.inner.send_compressed(encoding);
334 self
335 }
336 #[must_use]
338 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
339 self.inner = self.inner.accept_compressed(encoding);
340 self
341 }
342 #[must_use]
346 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
347 self.inner = self.inner.max_decoding_message_size(limit);
348 self
349 }
350 #[must_use]
354 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
355 self.inner = self.inner.max_encoding_message_size(limit);
356 self
357 }
358 pub async fn add_entry(
360 &mut self,
361 request: impl tonic::IntoRequest<super::AddEntryRequest>,
362 ) -> std::result::Result<
363 tonic::Response<super::AddEntryResponse>,
364 tonic::Status,
365 > {
366 self.inner
367 .ready()
368 .await
369 .map_err(|e| {
370 tonic::Status::unknown(
371 format!("Service was not ready: {}", e.into()),
372 )
373 })?;
374 let codec = tonic::codec::ProstCodec::default();
375 let path = http::uri::PathAndQuery::from_static(
376 "/converge.knowledge.v1.KnowledgeService/AddEntry",
377 );
378 let mut req = request.into_request();
379 req.extensions_mut()
380 .insert(
381 GrpcMethod::new("converge.knowledge.v1.KnowledgeService", "AddEntry"),
382 );
383 self.inner.unary(req, path, codec).await
384 }
385 pub async fn add_entries(
387 &mut self,
388 request: impl tonic::IntoRequest<super::AddEntriesRequest>,
389 ) -> std::result::Result<
390 tonic::Response<super::AddEntriesResponse>,
391 tonic::Status,
392 > {
393 self.inner
394 .ready()
395 .await
396 .map_err(|e| {
397 tonic::Status::unknown(
398 format!("Service was not ready: {}", e.into()),
399 )
400 })?;
401 let codec = tonic::codec::ProstCodec::default();
402 let path = http::uri::PathAndQuery::from_static(
403 "/converge.knowledge.v1.KnowledgeService/AddEntries",
404 );
405 let mut req = request.into_request();
406 req.extensions_mut()
407 .insert(
408 GrpcMethod::new(
409 "converge.knowledge.v1.KnowledgeService",
410 "AddEntries",
411 ),
412 );
413 self.inner.unary(req, path, codec).await
414 }
415 pub async fn get_entry(
417 &mut self,
418 request: impl tonic::IntoRequest<super::GetEntryRequest>,
419 ) -> std::result::Result<
420 tonic::Response<super::GetEntryResponse>,
421 tonic::Status,
422 > {
423 self.inner
424 .ready()
425 .await
426 .map_err(|e| {
427 tonic::Status::unknown(
428 format!("Service was not ready: {}", e.into()),
429 )
430 })?;
431 let codec = tonic::codec::ProstCodec::default();
432 let path = http::uri::PathAndQuery::from_static(
433 "/converge.knowledge.v1.KnowledgeService/GetEntry",
434 );
435 let mut req = request.into_request();
436 req.extensions_mut()
437 .insert(
438 GrpcMethod::new("converge.knowledge.v1.KnowledgeService", "GetEntry"),
439 );
440 self.inner.unary(req, path, codec).await
441 }
442 pub async fn update_entry(
444 &mut self,
445 request: impl tonic::IntoRequest<super::UpdateEntryRequest>,
446 ) -> std::result::Result<
447 tonic::Response<super::UpdateEntryResponse>,
448 tonic::Status,
449 > {
450 self.inner
451 .ready()
452 .await
453 .map_err(|e| {
454 tonic::Status::unknown(
455 format!("Service was not ready: {}", e.into()),
456 )
457 })?;
458 let codec = tonic::codec::ProstCodec::default();
459 let path = http::uri::PathAndQuery::from_static(
460 "/converge.knowledge.v1.KnowledgeService/UpdateEntry",
461 );
462 let mut req = request.into_request();
463 req.extensions_mut()
464 .insert(
465 GrpcMethod::new(
466 "converge.knowledge.v1.KnowledgeService",
467 "UpdateEntry",
468 ),
469 );
470 self.inner.unary(req, path, codec).await
471 }
472 pub async fn delete_entry(
474 &mut self,
475 request: impl tonic::IntoRequest<super::DeleteEntryRequest>,
476 ) -> std::result::Result<
477 tonic::Response<super::DeleteEntryResponse>,
478 tonic::Status,
479 > {
480 self.inner
481 .ready()
482 .await
483 .map_err(|e| {
484 tonic::Status::unknown(
485 format!("Service was not ready: {}", e.into()),
486 )
487 })?;
488 let codec = tonic::codec::ProstCodec::default();
489 let path = http::uri::PathAndQuery::from_static(
490 "/converge.knowledge.v1.KnowledgeService/DeleteEntry",
491 );
492 let mut req = request.into_request();
493 req.extensions_mut()
494 .insert(
495 GrpcMethod::new(
496 "converge.knowledge.v1.KnowledgeService",
497 "DeleteEntry",
498 ),
499 );
500 self.inner.unary(req, path, codec).await
501 }
502 pub async fn search(
504 &mut self,
505 request: impl tonic::IntoRequest<super::SearchRequest>,
506 ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status> {
507 self.inner
508 .ready()
509 .await
510 .map_err(|e| {
511 tonic::Status::unknown(
512 format!("Service was not ready: {}", e.into()),
513 )
514 })?;
515 let codec = tonic::codec::ProstCodec::default();
516 let path = http::uri::PathAndQuery::from_static(
517 "/converge.knowledge.v1.KnowledgeService/Search",
518 );
519 let mut req = request.into_request();
520 req.extensions_mut()
521 .insert(
522 GrpcMethod::new("converge.knowledge.v1.KnowledgeService", "Search"),
523 );
524 self.inner.unary(req, path, codec).await
525 }
526 pub async fn search_stream(
528 &mut self,
529 request: impl tonic::IntoRequest<super::SearchRequest>,
530 ) -> std::result::Result<
531 tonic::Response<tonic::codec::Streaming<super::SearchResult>>,
532 tonic::Status,
533 > {
534 self.inner
535 .ready()
536 .await
537 .map_err(|e| {
538 tonic::Status::unknown(
539 format!("Service was not ready: {}", e.into()),
540 )
541 })?;
542 let codec = tonic::codec::ProstCodec::default();
543 let path = http::uri::PathAndQuery::from_static(
544 "/converge.knowledge.v1.KnowledgeService/SearchStream",
545 );
546 let mut req = request.into_request();
547 req.extensions_mut()
548 .insert(
549 GrpcMethod::new(
550 "converge.knowledge.v1.KnowledgeService",
551 "SearchStream",
552 ),
553 );
554 self.inner.server_streaming(req, path, codec).await
555 }
556 pub async fn record_feedback(
558 &mut self,
559 request: impl tonic::IntoRequest<super::FeedbackRequest>,
560 ) -> std::result::Result<
561 tonic::Response<super::FeedbackResponse>,
562 tonic::Status,
563 > {
564 self.inner
565 .ready()
566 .await
567 .map_err(|e| {
568 tonic::Status::unknown(
569 format!("Service was not ready: {}", e.into()),
570 )
571 })?;
572 let codec = tonic::codec::ProstCodec::default();
573 let path = http::uri::PathAndQuery::from_static(
574 "/converge.knowledge.v1.KnowledgeService/RecordFeedback",
575 );
576 let mut req = request.into_request();
577 req.extensions_mut()
578 .insert(
579 GrpcMethod::new(
580 "converge.knowledge.v1.KnowledgeService",
581 "RecordFeedback",
582 ),
583 );
584 self.inner.unary(req, path, codec).await
585 }
586 pub async fn get_related(
588 &mut self,
589 request: impl tonic::IntoRequest<super::GetRelatedRequest>,
590 ) -> std::result::Result<
591 tonic::Response<super::GetRelatedResponse>,
592 tonic::Status,
593 > {
594 self.inner
595 .ready()
596 .await
597 .map_err(|e| {
598 tonic::Status::unknown(
599 format!("Service was not ready: {}", e.into()),
600 )
601 })?;
602 let codec = tonic::codec::ProstCodec::default();
603 let path = http::uri::PathAndQuery::from_static(
604 "/converge.knowledge.v1.KnowledgeService/GetRelated",
605 );
606 let mut req = request.into_request();
607 req.extensions_mut()
608 .insert(
609 GrpcMethod::new(
610 "converge.knowledge.v1.KnowledgeService",
611 "GetRelated",
612 ),
613 );
614 self.inner.unary(req, path, codec).await
615 }
616 pub async fn link_entries(
618 &mut self,
619 request: impl tonic::IntoRequest<super::LinkEntriesRequest>,
620 ) -> std::result::Result<
621 tonic::Response<super::LinkEntriesResponse>,
622 tonic::Status,
623 > {
624 self.inner
625 .ready()
626 .await
627 .map_err(|e| {
628 tonic::Status::unknown(
629 format!("Service was not ready: {}", e.into()),
630 )
631 })?;
632 let codec = tonic::codec::ProstCodec::default();
633 let path = http::uri::PathAndQuery::from_static(
634 "/converge.knowledge.v1.KnowledgeService/LinkEntries",
635 );
636 let mut req = request.into_request();
637 req.extensions_mut()
638 .insert(
639 GrpcMethod::new(
640 "converge.knowledge.v1.KnowledgeService",
641 "LinkEntries",
642 ),
643 );
644 self.inner.unary(req, path, codec).await
645 }
646 pub async fn get_stats(
648 &mut self,
649 request: impl tonic::IntoRequest<super::GetStatsRequest>,
650 ) -> std::result::Result<
651 tonic::Response<super::GetStatsResponse>,
652 tonic::Status,
653 > {
654 self.inner
655 .ready()
656 .await
657 .map_err(|e| {
658 tonic::Status::unknown(
659 format!("Service was not ready: {}", e.into()),
660 )
661 })?;
662 let codec = tonic::codec::ProstCodec::default();
663 let path = http::uri::PathAndQuery::from_static(
664 "/converge.knowledge.v1.KnowledgeService/GetStats",
665 );
666 let mut req = request.into_request();
667 req.extensions_mut()
668 .insert(
669 GrpcMethod::new("converge.knowledge.v1.KnowledgeService", "GetStats"),
670 );
671 self.inner.unary(req, path, codec).await
672 }
673 pub async fn health(
675 &mut self,
676 request: impl tonic::IntoRequest<super::HealthRequest>,
677 ) -> std::result::Result<tonic::Response<super::HealthResponse>, tonic::Status> {
678 self.inner
679 .ready()
680 .await
681 .map_err(|e| {
682 tonic::Status::unknown(
683 format!("Service was not ready: {}", e.into()),
684 )
685 })?;
686 let codec = tonic::codec::ProstCodec::default();
687 let path = http::uri::PathAndQuery::from_static(
688 "/converge.knowledge.v1.KnowledgeService/Health",
689 );
690 let mut req = request.into_request();
691 req.extensions_mut()
692 .insert(
693 GrpcMethod::new("converge.knowledge.v1.KnowledgeService", "Health"),
694 );
695 self.inner.unary(req, path, codec).await
696 }
697 }
698}
699pub mod knowledge_service_server {
701 #![allow(
702 unused_variables,
703 dead_code,
704 missing_docs,
705 clippy::wildcard_imports,
706 clippy::let_unit_value,
707 )]
708 use tonic::codegen::*;
709 #[async_trait]
711 pub trait KnowledgeService: std::marker::Send + std::marker::Sync + 'static {
712 async fn add_entry(
714 &self,
715 request: tonic::Request<super::AddEntryRequest>,
716 ) -> std::result::Result<
717 tonic::Response<super::AddEntryResponse>,
718 tonic::Status,
719 >;
720 async fn add_entries(
722 &self,
723 request: tonic::Request<super::AddEntriesRequest>,
724 ) -> std::result::Result<
725 tonic::Response<super::AddEntriesResponse>,
726 tonic::Status,
727 >;
728 async fn get_entry(
730 &self,
731 request: tonic::Request<super::GetEntryRequest>,
732 ) -> std::result::Result<
733 tonic::Response<super::GetEntryResponse>,
734 tonic::Status,
735 >;
736 async fn update_entry(
738 &self,
739 request: tonic::Request<super::UpdateEntryRequest>,
740 ) -> std::result::Result<
741 tonic::Response<super::UpdateEntryResponse>,
742 tonic::Status,
743 >;
744 async fn delete_entry(
746 &self,
747 request: tonic::Request<super::DeleteEntryRequest>,
748 ) -> std::result::Result<
749 tonic::Response<super::DeleteEntryResponse>,
750 tonic::Status,
751 >;
752 async fn search(
754 &self,
755 request: tonic::Request<super::SearchRequest>,
756 ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status>;
757 type SearchStreamStream: tonic::codegen::tokio_stream::Stream<
759 Item = std::result::Result<super::SearchResult, tonic::Status>,
760 >
761 + std::marker::Send
762 + 'static;
763 async fn search_stream(
765 &self,
766 request: tonic::Request<super::SearchRequest>,
767 ) -> std::result::Result<
768 tonic::Response<Self::SearchStreamStream>,
769 tonic::Status,
770 >;
771 async fn record_feedback(
773 &self,
774 request: tonic::Request<super::FeedbackRequest>,
775 ) -> std::result::Result<
776 tonic::Response<super::FeedbackResponse>,
777 tonic::Status,
778 >;
779 async fn get_related(
781 &self,
782 request: tonic::Request<super::GetRelatedRequest>,
783 ) -> std::result::Result<
784 tonic::Response<super::GetRelatedResponse>,
785 tonic::Status,
786 >;
787 async fn link_entries(
789 &self,
790 request: tonic::Request<super::LinkEntriesRequest>,
791 ) -> std::result::Result<
792 tonic::Response<super::LinkEntriesResponse>,
793 tonic::Status,
794 >;
795 async fn get_stats(
797 &self,
798 request: tonic::Request<super::GetStatsRequest>,
799 ) -> std::result::Result<
800 tonic::Response<super::GetStatsResponse>,
801 tonic::Status,
802 >;
803 async fn health(
805 &self,
806 request: tonic::Request<super::HealthRequest>,
807 ) -> std::result::Result<tonic::Response<super::HealthResponse>, tonic::Status>;
808 }
809 #[derive(Debug)]
812 pub struct KnowledgeServiceServer<T> {
813 inner: Arc<T>,
814 accept_compression_encodings: EnabledCompressionEncodings,
815 send_compression_encodings: EnabledCompressionEncodings,
816 max_decoding_message_size: Option<usize>,
817 max_encoding_message_size: Option<usize>,
818 }
819 impl<T> KnowledgeServiceServer<T> {
820 pub fn new(inner: T) -> Self {
821 Self::from_arc(Arc::new(inner))
822 }
823 pub fn from_arc(inner: Arc<T>) -> Self {
824 Self {
825 inner,
826 accept_compression_encodings: Default::default(),
827 send_compression_encodings: Default::default(),
828 max_decoding_message_size: None,
829 max_encoding_message_size: None,
830 }
831 }
832 pub fn with_interceptor<F>(
833 inner: T,
834 interceptor: F,
835 ) -> InterceptedService<Self, F>
836 where
837 F: tonic::service::Interceptor,
838 {
839 InterceptedService::new(Self::new(inner), interceptor)
840 }
841 #[must_use]
843 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
844 self.accept_compression_encodings.enable(encoding);
845 self
846 }
847 #[must_use]
849 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
850 self.send_compression_encodings.enable(encoding);
851 self
852 }
853 #[must_use]
857 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
858 self.max_decoding_message_size = Some(limit);
859 self
860 }
861 #[must_use]
865 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
866 self.max_encoding_message_size = Some(limit);
867 self
868 }
869 }
870 impl<T, B> tonic::codegen::Service<http::Request<B>> for KnowledgeServiceServer<T>
871 where
872 T: KnowledgeService,
873 B: Body + std::marker::Send + 'static,
874 B::Error: Into<StdError> + std::marker::Send + 'static,
875 {
876 type Response = http::Response<tonic::body::BoxBody>;
877 type Error = std::convert::Infallible;
878 type Future = BoxFuture<Self::Response, Self::Error>;
879 fn poll_ready(
880 &mut self,
881 _cx: &mut Context<'_>,
882 ) -> Poll<std::result::Result<(), Self::Error>> {
883 Poll::Ready(Ok(()))
884 }
885 fn call(&mut self, req: http::Request<B>) -> Self::Future {
886 match req.uri().path() {
887 "/converge.knowledge.v1.KnowledgeService/AddEntry" => {
888 #[allow(non_camel_case_types)]
889 struct AddEntrySvc<T: KnowledgeService>(pub Arc<T>);
890 impl<
891 T: KnowledgeService,
892 > tonic::server::UnaryService<super::AddEntryRequest>
893 for AddEntrySvc<T> {
894 type Response = super::AddEntryResponse;
895 type Future = BoxFuture<
896 tonic::Response<Self::Response>,
897 tonic::Status,
898 >;
899 fn call(
900 &mut self,
901 request: tonic::Request<super::AddEntryRequest>,
902 ) -> Self::Future {
903 let inner = Arc::clone(&self.0);
904 let fut = async move {
905 <T as KnowledgeService>::add_entry(&inner, request).await
906 };
907 Box::pin(fut)
908 }
909 }
910 let accept_compression_encodings = self.accept_compression_encodings;
911 let send_compression_encodings = self.send_compression_encodings;
912 let max_decoding_message_size = self.max_decoding_message_size;
913 let max_encoding_message_size = self.max_encoding_message_size;
914 let inner = self.inner.clone();
915 let fut = async move {
916 let method = AddEntrySvc(inner);
917 let codec = tonic::codec::ProstCodec::default();
918 let mut grpc = tonic::server::Grpc::new(codec)
919 .apply_compression_config(
920 accept_compression_encodings,
921 send_compression_encodings,
922 )
923 .apply_max_message_size_config(
924 max_decoding_message_size,
925 max_encoding_message_size,
926 );
927 let res = grpc.unary(method, req).await;
928 Ok(res)
929 };
930 Box::pin(fut)
931 }
932 "/converge.knowledge.v1.KnowledgeService/AddEntries" => {
933 #[allow(non_camel_case_types)]
934 struct AddEntriesSvc<T: KnowledgeService>(pub Arc<T>);
935 impl<
936 T: KnowledgeService,
937 > tonic::server::UnaryService<super::AddEntriesRequest>
938 for AddEntriesSvc<T> {
939 type Response = super::AddEntriesResponse;
940 type Future = BoxFuture<
941 tonic::Response<Self::Response>,
942 tonic::Status,
943 >;
944 fn call(
945 &mut self,
946 request: tonic::Request<super::AddEntriesRequest>,
947 ) -> Self::Future {
948 let inner = Arc::clone(&self.0);
949 let fut = async move {
950 <T as KnowledgeService>::add_entries(&inner, request).await
951 };
952 Box::pin(fut)
953 }
954 }
955 let accept_compression_encodings = self.accept_compression_encodings;
956 let send_compression_encodings = self.send_compression_encodings;
957 let max_decoding_message_size = self.max_decoding_message_size;
958 let max_encoding_message_size = self.max_encoding_message_size;
959 let inner = self.inner.clone();
960 let fut = async move {
961 let method = AddEntriesSvc(inner);
962 let codec = tonic::codec::ProstCodec::default();
963 let mut grpc = tonic::server::Grpc::new(codec)
964 .apply_compression_config(
965 accept_compression_encodings,
966 send_compression_encodings,
967 )
968 .apply_max_message_size_config(
969 max_decoding_message_size,
970 max_encoding_message_size,
971 );
972 let res = grpc.unary(method, req).await;
973 Ok(res)
974 };
975 Box::pin(fut)
976 }
977 "/converge.knowledge.v1.KnowledgeService/GetEntry" => {
978 #[allow(non_camel_case_types)]
979 struct GetEntrySvc<T: KnowledgeService>(pub Arc<T>);
980 impl<
981 T: KnowledgeService,
982 > tonic::server::UnaryService<super::GetEntryRequest>
983 for GetEntrySvc<T> {
984 type Response = super::GetEntryResponse;
985 type Future = BoxFuture<
986 tonic::Response<Self::Response>,
987 tonic::Status,
988 >;
989 fn call(
990 &mut self,
991 request: tonic::Request<super::GetEntryRequest>,
992 ) -> Self::Future {
993 let inner = Arc::clone(&self.0);
994 let fut = async move {
995 <T as KnowledgeService>::get_entry(&inner, request).await
996 };
997 Box::pin(fut)
998 }
999 }
1000 let accept_compression_encodings = self.accept_compression_encodings;
1001 let send_compression_encodings = self.send_compression_encodings;
1002 let max_decoding_message_size = self.max_decoding_message_size;
1003 let max_encoding_message_size = self.max_encoding_message_size;
1004 let inner = self.inner.clone();
1005 let fut = async move {
1006 let method = GetEntrySvc(inner);
1007 let codec = tonic::codec::ProstCodec::default();
1008 let mut grpc = tonic::server::Grpc::new(codec)
1009 .apply_compression_config(
1010 accept_compression_encodings,
1011 send_compression_encodings,
1012 )
1013 .apply_max_message_size_config(
1014 max_decoding_message_size,
1015 max_encoding_message_size,
1016 );
1017 let res = grpc.unary(method, req).await;
1018 Ok(res)
1019 };
1020 Box::pin(fut)
1021 }
1022 "/converge.knowledge.v1.KnowledgeService/UpdateEntry" => {
1023 #[allow(non_camel_case_types)]
1024 struct UpdateEntrySvc<T: KnowledgeService>(pub Arc<T>);
1025 impl<
1026 T: KnowledgeService,
1027 > tonic::server::UnaryService<super::UpdateEntryRequest>
1028 for UpdateEntrySvc<T> {
1029 type Response = super::UpdateEntryResponse;
1030 type Future = BoxFuture<
1031 tonic::Response<Self::Response>,
1032 tonic::Status,
1033 >;
1034 fn call(
1035 &mut self,
1036 request: tonic::Request<super::UpdateEntryRequest>,
1037 ) -> Self::Future {
1038 let inner = Arc::clone(&self.0);
1039 let fut = async move {
1040 <T as KnowledgeService>::update_entry(&inner, request).await
1041 };
1042 Box::pin(fut)
1043 }
1044 }
1045 let accept_compression_encodings = self.accept_compression_encodings;
1046 let send_compression_encodings = self.send_compression_encodings;
1047 let max_decoding_message_size = self.max_decoding_message_size;
1048 let max_encoding_message_size = self.max_encoding_message_size;
1049 let inner = self.inner.clone();
1050 let fut = async move {
1051 let method = UpdateEntrySvc(inner);
1052 let codec = tonic::codec::ProstCodec::default();
1053 let mut grpc = tonic::server::Grpc::new(codec)
1054 .apply_compression_config(
1055 accept_compression_encodings,
1056 send_compression_encodings,
1057 )
1058 .apply_max_message_size_config(
1059 max_decoding_message_size,
1060 max_encoding_message_size,
1061 );
1062 let res = grpc.unary(method, req).await;
1063 Ok(res)
1064 };
1065 Box::pin(fut)
1066 }
1067 "/converge.knowledge.v1.KnowledgeService/DeleteEntry" => {
1068 #[allow(non_camel_case_types)]
1069 struct DeleteEntrySvc<T: KnowledgeService>(pub Arc<T>);
1070 impl<
1071 T: KnowledgeService,
1072 > tonic::server::UnaryService<super::DeleteEntryRequest>
1073 for DeleteEntrySvc<T> {
1074 type Response = super::DeleteEntryResponse;
1075 type Future = BoxFuture<
1076 tonic::Response<Self::Response>,
1077 tonic::Status,
1078 >;
1079 fn call(
1080 &mut self,
1081 request: tonic::Request<super::DeleteEntryRequest>,
1082 ) -> Self::Future {
1083 let inner = Arc::clone(&self.0);
1084 let fut = async move {
1085 <T as KnowledgeService>::delete_entry(&inner, request).await
1086 };
1087 Box::pin(fut)
1088 }
1089 }
1090 let accept_compression_encodings = self.accept_compression_encodings;
1091 let send_compression_encodings = self.send_compression_encodings;
1092 let max_decoding_message_size = self.max_decoding_message_size;
1093 let max_encoding_message_size = self.max_encoding_message_size;
1094 let inner = self.inner.clone();
1095 let fut = async move {
1096 let method = DeleteEntrySvc(inner);
1097 let codec = tonic::codec::ProstCodec::default();
1098 let mut grpc = tonic::server::Grpc::new(codec)
1099 .apply_compression_config(
1100 accept_compression_encodings,
1101 send_compression_encodings,
1102 )
1103 .apply_max_message_size_config(
1104 max_decoding_message_size,
1105 max_encoding_message_size,
1106 );
1107 let res = grpc.unary(method, req).await;
1108 Ok(res)
1109 };
1110 Box::pin(fut)
1111 }
1112 "/converge.knowledge.v1.KnowledgeService/Search" => {
1113 #[allow(non_camel_case_types)]
1114 struct SearchSvc<T: KnowledgeService>(pub Arc<T>);
1115 impl<
1116 T: KnowledgeService,
1117 > tonic::server::UnaryService<super::SearchRequest>
1118 for SearchSvc<T> {
1119 type Response = super::SearchResponse;
1120 type Future = BoxFuture<
1121 tonic::Response<Self::Response>,
1122 tonic::Status,
1123 >;
1124 fn call(
1125 &mut self,
1126 request: tonic::Request<super::SearchRequest>,
1127 ) -> Self::Future {
1128 let inner = Arc::clone(&self.0);
1129 let fut = async move {
1130 <T as KnowledgeService>::search(&inner, request).await
1131 };
1132 Box::pin(fut)
1133 }
1134 }
1135 let accept_compression_encodings = self.accept_compression_encodings;
1136 let send_compression_encodings = self.send_compression_encodings;
1137 let max_decoding_message_size = self.max_decoding_message_size;
1138 let max_encoding_message_size = self.max_encoding_message_size;
1139 let inner = self.inner.clone();
1140 let fut = async move {
1141 let method = SearchSvc(inner);
1142 let codec = tonic::codec::ProstCodec::default();
1143 let mut grpc = tonic::server::Grpc::new(codec)
1144 .apply_compression_config(
1145 accept_compression_encodings,
1146 send_compression_encodings,
1147 )
1148 .apply_max_message_size_config(
1149 max_decoding_message_size,
1150 max_encoding_message_size,
1151 );
1152 let res = grpc.unary(method, req).await;
1153 Ok(res)
1154 };
1155 Box::pin(fut)
1156 }
1157 "/converge.knowledge.v1.KnowledgeService/SearchStream" => {
1158 #[allow(non_camel_case_types)]
1159 struct SearchStreamSvc<T: KnowledgeService>(pub Arc<T>);
1160 impl<
1161 T: KnowledgeService,
1162 > tonic::server::ServerStreamingService<super::SearchRequest>
1163 for SearchStreamSvc<T> {
1164 type Response = super::SearchResult;
1165 type ResponseStream = T::SearchStreamStream;
1166 type Future = BoxFuture<
1167 tonic::Response<Self::ResponseStream>,
1168 tonic::Status,
1169 >;
1170 fn call(
1171 &mut self,
1172 request: tonic::Request<super::SearchRequest>,
1173 ) -> Self::Future {
1174 let inner = Arc::clone(&self.0);
1175 let fut = async move {
1176 <T as KnowledgeService>::search_stream(&inner, request)
1177 .await
1178 };
1179 Box::pin(fut)
1180 }
1181 }
1182 let accept_compression_encodings = self.accept_compression_encodings;
1183 let send_compression_encodings = self.send_compression_encodings;
1184 let max_decoding_message_size = self.max_decoding_message_size;
1185 let max_encoding_message_size = self.max_encoding_message_size;
1186 let inner = self.inner.clone();
1187 let fut = async move {
1188 let method = SearchStreamSvc(inner);
1189 let codec = tonic::codec::ProstCodec::default();
1190 let mut grpc = tonic::server::Grpc::new(codec)
1191 .apply_compression_config(
1192 accept_compression_encodings,
1193 send_compression_encodings,
1194 )
1195 .apply_max_message_size_config(
1196 max_decoding_message_size,
1197 max_encoding_message_size,
1198 );
1199 let res = grpc.server_streaming(method, req).await;
1200 Ok(res)
1201 };
1202 Box::pin(fut)
1203 }
1204 "/converge.knowledge.v1.KnowledgeService/RecordFeedback" => {
1205 #[allow(non_camel_case_types)]
1206 struct RecordFeedbackSvc<T: KnowledgeService>(pub Arc<T>);
1207 impl<
1208 T: KnowledgeService,
1209 > tonic::server::UnaryService<super::FeedbackRequest>
1210 for RecordFeedbackSvc<T> {
1211 type Response = super::FeedbackResponse;
1212 type Future = BoxFuture<
1213 tonic::Response<Self::Response>,
1214 tonic::Status,
1215 >;
1216 fn call(
1217 &mut self,
1218 request: tonic::Request<super::FeedbackRequest>,
1219 ) -> Self::Future {
1220 let inner = Arc::clone(&self.0);
1221 let fut = async move {
1222 <T as KnowledgeService>::record_feedback(&inner, request)
1223 .await
1224 };
1225 Box::pin(fut)
1226 }
1227 }
1228 let accept_compression_encodings = self.accept_compression_encodings;
1229 let send_compression_encodings = self.send_compression_encodings;
1230 let max_decoding_message_size = self.max_decoding_message_size;
1231 let max_encoding_message_size = self.max_encoding_message_size;
1232 let inner = self.inner.clone();
1233 let fut = async move {
1234 let method = RecordFeedbackSvc(inner);
1235 let codec = tonic::codec::ProstCodec::default();
1236 let mut grpc = tonic::server::Grpc::new(codec)
1237 .apply_compression_config(
1238 accept_compression_encodings,
1239 send_compression_encodings,
1240 )
1241 .apply_max_message_size_config(
1242 max_decoding_message_size,
1243 max_encoding_message_size,
1244 );
1245 let res = grpc.unary(method, req).await;
1246 Ok(res)
1247 };
1248 Box::pin(fut)
1249 }
1250 "/converge.knowledge.v1.KnowledgeService/GetRelated" => {
1251 #[allow(non_camel_case_types)]
1252 struct GetRelatedSvc<T: KnowledgeService>(pub Arc<T>);
1253 impl<
1254 T: KnowledgeService,
1255 > tonic::server::UnaryService<super::GetRelatedRequest>
1256 for GetRelatedSvc<T> {
1257 type Response = super::GetRelatedResponse;
1258 type Future = BoxFuture<
1259 tonic::Response<Self::Response>,
1260 tonic::Status,
1261 >;
1262 fn call(
1263 &mut self,
1264 request: tonic::Request<super::GetRelatedRequest>,
1265 ) -> Self::Future {
1266 let inner = Arc::clone(&self.0);
1267 let fut = async move {
1268 <T as KnowledgeService>::get_related(&inner, request).await
1269 };
1270 Box::pin(fut)
1271 }
1272 }
1273 let accept_compression_encodings = self.accept_compression_encodings;
1274 let send_compression_encodings = self.send_compression_encodings;
1275 let max_decoding_message_size = self.max_decoding_message_size;
1276 let max_encoding_message_size = self.max_encoding_message_size;
1277 let inner = self.inner.clone();
1278 let fut = async move {
1279 let method = GetRelatedSvc(inner);
1280 let codec = tonic::codec::ProstCodec::default();
1281 let mut grpc = tonic::server::Grpc::new(codec)
1282 .apply_compression_config(
1283 accept_compression_encodings,
1284 send_compression_encodings,
1285 )
1286 .apply_max_message_size_config(
1287 max_decoding_message_size,
1288 max_encoding_message_size,
1289 );
1290 let res = grpc.unary(method, req).await;
1291 Ok(res)
1292 };
1293 Box::pin(fut)
1294 }
1295 "/converge.knowledge.v1.KnowledgeService/LinkEntries" => {
1296 #[allow(non_camel_case_types)]
1297 struct LinkEntriesSvc<T: KnowledgeService>(pub Arc<T>);
1298 impl<
1299 T: KnowledgeService,
1300 > tonic::server::UnaryService<super::LinkEntriesRequest>
1301 for LinkEntriesSvc<T> {
1302 type Response = super::LinkEntriesResponse;
1303 type Future = BoxFuture<
1304 tonic::Response<Self::Response>,
1305 tonic::Status,
1306 >;
1307 fn call(
1308 &mut self,
1309 request: tonic::Request<super::LinkEntriesRequest>,
1310 ) -> Self::Future {
1311 let inner = Arc::clone(&self.0);
1312 let fut = async move {
1313 <T as KnowledgeService>::link_entries(&inner, request).await
1314 };
1315 Box::pin(fut)
1316 }
1317 }
1318 let accept_compression_encodings = self.accept_compression_encodings;
1319 let send_compression_encodings = self.send_compression_encodings;
1320 let max_decoding_message_size = self.max_decoding_message_size;
1321 let max_encoding_message_size = self.max_encoding_message_size;
1322 let inner = self.inner.clone();
1323 let fut = async move {
1324 let method = LinkEntriesSvc(inner);
1325 let codec = tonic::codec::ProstCodec::default();
1326 let mut grpc = tonic::server::Grpc::new(codec)
1327 .apply_compression_config(
1328 accept_compression_encodings,
1329 send_compression_encodings,
1330 )
1331 .apply_max_message_size_config(
1332 max_decoding_message_size,
1333 max_encoding_message_size,
1334 );
1335 let res = grpc.unary(method, req).await;
1336 Ok(res)
1337 };
1338 Box::pin(fut)
1339 }
1340 "/converge.knowledge.v1.KnowledgeService/GetStats" => {
1341 #[allow(non_camel_case_types)]
1342 struct GetStatsSvc<T: KnowledgeService>(pub Arc<T>);
1343 impl<
1344 T: KnowledgeService,
1345 > tonic::server::UnaryService<super::GetStatsRequest>
1346 for GetStatsSvc<T> {
1347 type Response = super::GetStatsResponse;
1348 type Future = BoxFuture<
1349 tonic::Response<Self::Response>,
1350 tonic::Status,
1351 >;
1352 fn call(
1353 &mut self,
1354 request: tonic::Request<super::GetStatsRequest>,
1355 ) -> Self::Future {
1356 let inner = Arc::clone(&self.0);
1357 let fut = async move {
1358 <T as KnowledgeService>::get_stats(&inner, request).await
1359 };
1360 Box::pin(fut)
1361 }
1362 }
1363 let accept_compression_encodings = self.accept_compression_encodings;
1364 let send_compression_encodings = self.send_compression_encodings;
1365 let max_decoding_message_size = self.max_decoding_message_size;
1366 let max_encoding_message_size = self.max_encoding_message_size;
1367 let inner = self.inner.clone();
1368 let fut = async move {
1369 let method = GetStatsSvc(inner);
1370 let codec = tonic::codec::ProstCodec::default();
1371 let mut grpc = tonic::server::Grpc::new(codec)
1372 .apply_compression_config(
1373 accept_compression_encodings,
1374 send_compression_encodings,
1375 )
1376 .apply_max_message_size_config(
1377 max_decoding_message_size,
1378 max_encoding_message_size,
1379 );
1380 let res = grpc.unary(method, req).await;
1381 Ok(res)
1382 };
1383 Box::pin(fut)
1384 }
1385 "/converge.knowledge.v1.KnowledgeService/Health" => {
1386 #[allow(non_camel_case_types)]
1387 struct HealthSvc<T: KnowledgeService>(pub Arc<T>);
1388 impl<
1389 T: KnowledgeService,
1390 > tonic::server::UnaryService<super::HealthRequest>
1391 for HealthSvc<T> {
1392 type Response = super::HealthResponse;
1393 type Future = BoxFuture<
1394 tonic::Response<Self::Response>,
1395 tonic::Status,
1396 >;
1397 fn call(
1398 &mut self,
1399 request: tonic::Request<super::HealthRequest>,
1400 ) -> Self::Future {
1401 let inner = Arc::clone(&self.0);
1402 let fut = async move {
1403 <T as KnowledgeService>::health(&inner, request).await
1404 };
1405 Box::pin(fut)
1406 }
1407 }
1408 let accept_compression_encodings = self.accept_compression_encodings;
1409 let send_compression_encodings = self.send_compression_encodings;
1410 let max_decoding_message_size = self.max_decoding_message_size;
1411 let max_encoding_message_size = self.max_encoding_message_size;
1412 let inner = self.inner.clone();
1413 let fut = async move {
1414 let method = HealthSvc(inner);
1415 let codec = tonic::codec::ProstCodec::default();
1416 let mut grpc = tonic::server::Grpc::new(codec)
1417 .apply_compression_config(
1418 accept_compression_encodings,
1419 send_compression_encodings,
1420 )
1421 .apply_max_message_size_config(
1422 max_decoding_message_size,
1423 max_encoding_message_size,
1424 );
1425 let res = grpc.unary(method, req).await;
1426 Ok(res)
1427 };
1428 Box::pin(fut)
1429 }
1430 _ => {
1431 Box::pin(async move {
1432 let mut response = http::Response::new(empty_body());
1433 let headers = response.headers_mut();
1434 headers
1435 .insert(
1436 tonic::Status::GRPC_STATUS,
1437 (tonic::Code::Unimplemented as i32).into(),
1438 );
1439 headers
1440 .insert(
1441 http::header::CONTENT_TYPE,
1442 tonic::metadata::GRPC_CONTENT_TYPE,
1443 );
1444 Ok(response)
1445 })
1446 }
1447 }
1448 }
1449 }
1450 impl<T> Clone for KnowledgeServiceServer<T> {
1451 fn clone(&self) -> Self {
1452 let inner = self.inner.clone();
1453 Self {
1454 inner,
1455 accept_compression_encodings: self.accept_compression_encodings,
1456 send_compression_encodings: self.send_compression_encodings,
1457 max_decoding_message_size: self.max_decoding_message_size,
1458 max_encoding_message_size: self.max_encoding_message_size,
1459 }
1460 }
1461 }
1462 pub const SERVICE_NAME: &str = "converge.knowledge.v1.KnowledgeService";
1464 impl<T> tonic::server::NamedService for KnowledgeServiceServer<T> {
1465 const NAME: &'static str = SERVICE_NAME;
1466 }
1467}