1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct GetDestination {
4 #[prost(string, tag = "1")]
5 pub scheme: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub path: ::prost::alloc::string::String,
8 #[prost(string, tag = "3")]
15 pub context_token: ::prost::alloc::string::String,
16}
17#[allow(clippy::derive_partial_eq_without_eq)]
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct Update {
20 #[prost(oneof = "update::Update", tags = "1, 2, 3")]
21 pub update: ::core::option::Option<update::Update>,
22}
23pub mod update {
25 #[allow(clippy::derive_partial_eq_without_eq)]
26 #[derive(Clone, PartialEq, ::prost::Oneof)]
27 pub enum Update {
28 #[prost(message, tag = "1")]
31 Add(super::WeightedAddrSet),
32 #[prost(message, tag = "2")]
34 Remove(super::AddrSet),
35 #[prost(message, tag = "3")]
41 NoEndpoints(super::NoEndpoints),
42 }
43}
44#[allow(clippy::derive_partial_eq_without_eq)]
45#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct AddrSet {
47 #[prost(message, repeated, tag = "1")]
48 pub addrs: ::prost::alloc::vec::Vec<super::net::TcpAddress>,
49}
50#[allow(clippy::derive_partial_eq_without_eq)]
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct WeightedAddrSet {
53 #[prost(message, repeated, tag = "1")]
54 pub addrs: ::prost::alloc::vec::Vec<WeightedAddr>,
55 #[prost(map = "string, string", tag = "2")]
56 pub metric_labels: ::std::collections::HashMap<
57 ::prost::alloc::string::String,
58 ::prost::alloc::string::String,
59 >,
60}
61#[allow(clippy::derive_partial_eq_without_eq)]
62#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct WeightedAddr {
64 #[prost(message, optional, tag = "1")]
65 pub addr: ::core::option::Option<super::net::TcpAddress>,
66 #[prost(uint32, tag = "3")]
67 pub weight: u32,
68 #[prost(map = "string, string", tag = "4")]
69 pub metric_labels: ::std::collections::HashMap<
70 ::prost::alloc::string::String,
71 ::prost::alloc::string::String,
72 >,
73 #[prost(message, optional, tag = "5")]
74 pub tls_identity: ::core::option::Option<TlsIdentity>,
75 #[prost(message, optional, tag = "6")]
76 pub protocol_hint: ::core::option::Option<ProtocolHint>,
77 #[prost(message, optional, tag = "7")]
78 pub authority_override: ::core::option::Option<AuthorityOverride>,
79 #[prost(message, optional, tag = "8")]
84 pub http2: ::core::option::Option<Http2ClientParams>,
85 #[prost(message, optional, tag = "9")]
88 pub resource_ref: ::core::option::Option<super::meta::Metadata>,
89}
90#[allow(clippy::derive_partial_eq_without_eq)]
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct TlsIdentity {
93 #[prost(message, optional, tag = "4")]
97 pub server_name: ::core::option::Option<tls_identity::DnsLikeIdentity>,
98 #[prost(oneof = "tls_identity::Strategy", tags = "1, 3")]
99 pub strategy: ::core::option::Option<tls_identity::Strategy>,
100}
101pub mod tls_identity {
103 #[allow(clippy::derive_partial_eq_without_eq)]
105 #[derive(Clone, PartialEq, ::prost::Message)]
106 pub struct DnsLikeIdentity {
107 #[prost(string, tag = "1")]
112 pub name: ::prost::alloc::string::String,
113 }
114 #[allow(clippy::derive_partial_eq_without_eq)]
116 #[derive(Clone, PartialEq, ::prost::Message)]
117 pub struct UriLikeIdentity {
118 #[prost(string, tag = "1")]
123 pub uri: ::prost::alloc::string::String,
124 }
125 #[allow(clippy::derive_partial_eq_without_eq)]
126 #[derive(Clone, PartialEq, ::prost::Oneof)]
127 pub enum Strategy {
128 #[prost(message, tag = "1")]
129 DnsLikeIdentity(DnsLikeIdentity),
130 #[prost(message, tag = "3")]
131 UriLikeIdentity(UriLikeIdentity),
132 }
133}
134#[allow(clippy::derive_partial_eq_without_eq)]
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct AuthorityOverride {
137 #[prost(string, tag = "1")]
138 pub authority_override: ::prost::alloc::string::String,
139}
140#[allow(clippy::derive_partial_eq_without_eq)]
141#[derive(Clone, PartialEq, ::prost::Message)]
142pub struct NoEndpoints {
143 #[prost(bool, tag = "1")]
144 pub exists: bool,
145}
146#[allow(clippy::derive_partial_eq_without_eq)]
149#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct ProtocolHint {
151 #[prost(message, optional, tag = "2")]
154 pub opaque_transport: ::core::option::Option<protocol_hint::OpaqueTransport>,
155 #[prost(oneof = "protocol_hint::Protocol", tags = "1, 3")]
156 pub protocol: ::core::option::Option<protocol_hint::Protocol>,
157}
158pub mod protocol_hint {
160 #[allow(clippy::derive_partial_eq_without_eq)]
161 #[derive(Clone, PartialEq, ::prost::Message)]
162 pub struct H2 {}
163 #[allow(clippy::derive_partial_eq_without_eq)]
164 #[derive(Clone, PartialEq, ::prost::Message)]
165 pub struct Opaque {}
166 #[allow(clippy::derive_partial_eq_without_eq)]
167 #[derive(Clone, PartialEq, ::prost::Message)]
168 pub struct OpaqueTransport {
169 #[prost(uint32, tag = "1")]
171 pub inbound_port: u32,
172 }
173 #[allow(clippy::derive_partial_eq_without_eq)]
174 #[derive(Clone, PartialEq, ::prost::Oneof)]
175 pub enum Protocol {
176 #[prost(message, tag = "1")]
179 H2(H2),
180 #[prost(message, tag = "3")]
184 Opaque(Opaque),
185 }
186}
187#[allow(clippy::derive_partial_eq_without_eq)]
189#[derive(Clone, PartialEq, ::prost::Message)]
190pub struct Http2ClientParams {
191 #[prost(message, optional, tag = "1")]
193 pub flow_control: ::core::option::Option<http2_client_params::FlowControl>,
194 #[prost(message, optional, tag = "2")]
196 pub keep_alive: ::core::option::Option<http2_client_params::KeepAlive>,
197 #[prost(message, optional, tag = "3")]
199 pub internals: ::core::option::Option<http2_client_params::Internals>,
200}
201pub mod http2_client_params {
203 #[allow(clippy::derive_partial_eq_without_eq)]
204 #[derive(Clone, PartialEq, ::prost::Message)]
205 pub struct FlowControl {
206 #[prost(uint32, tag = "1")]
208 pub initial_connection_window_size: u32,
209 #[prost(uint32, tag = "2")]
211 pub initial_stream_window_size: u32,
212 #[prost(bool, tag = "3")]
214 pub adaptive_flow_control: bool,
215 }
216 #[allow(clippy::derive_partial_eq_without_eq)]
217 #[derive(Clone, PartialEq, ::prost::Message)]
218 pub struct KeepAlive {
219 #[prost(message, optional, tag = "1")]
221 pub interval: ::core::option::Option<::prost_types::Duration>,
222 #[prost(message, optional, tag = "2")]
225 pub timeout: ::core::option::Option<::prost_types::Duration>,
226 #[prost(bool, tag = "3")]
228 pub while_idle: bool,
229 }
230 #[allow(clippy::derive_partial_eq_without_eq)]
231 #[derive(Clone, PartialEq, ::prost::Message)]
232 pub struct Internals {
233 #[prost(uint32, tag = "1")]
234 pub max_concurrent_reset_streams: u32,
235 #[prost(uint32, tag = "2")]
236 pub max_frame_size: u32,
237 #[prost(uint32, tag = "3")]
238 pub max_send_buf_size: u32,
239 }
240}
241#[allow(clippy::derive_partial_eq_without_eq)]
242#[derive(Clone, PartialEq, ::prost::Message)]
243pub struct DestinationProfile {
244 #[prost(string, tag = "5")]
257 pub fully_qualified_name: ::prost::alloc::string::String,
258 #[prost(bool, tag = "4")]
262 pub opaque_protocol: bool,
263 #[prost(message, repeated, tag = "1")]
266 pub routes: ::prost::alloc::vec::Vec<Route>,
267 #[prost(message, optional, tag = "2")]
271 pub retry_budget: ::core::option::Option<RetryBudget>,
272 #[prost(message, repeated, tag = "3")]
277 pub dst_overrides: ::prost::alloc::vec::Vec<WeightedDst>,
278 #[prost(message, optional, tag = "6")]
286 pub endpoint: ::core::option::Option<WeightedAddr>,
287 #[prost(message, optional, tag = "7")]
290 pub parent_ref: ::core::option::Option<super::meta::Metadata>,
291 #[prost(message, optional, tag = "8")]
294 pub profile_ref: ::core::option::Option<super::meta::Metadata>,
295}
296#[allow(clippy::derive_partial_eq_without_eq)]
297#[derive(Clone, PartialEq, ::prost::Message)]
298pub struct Route {
299 #[prost(message, optional, tag = "1")]
301 pub condition: ::core::option::Option<RequestMatch>,
302 #[prost(message, repeated, tag = "2")]
306 pub response_classes: ::prost::alloc::vec::Vec<ResponseClass>,
307 #[prost(map = "string, string", tag = "3")]
309 pub metrics_labels: ::std::collections::HashMap<
310 ::prost::alloc::string::String,
311 ::prost::alloc::string::String,
312 >,
313 #[prost(bool, tag = "4")]
316 pub is_retryable: bool,
317 #[prost(message, optional, tag = "5")]
321 pub timeout: ::core::option::Option<::prost_types::Duration>,
322}
323#[allow(clippy::derive_partial_eq_without_eq)]
324#[derive(Clone, PartialEq, ::prost::Message)]
325pub struct RetryBudget {
326 #[prost(float, tag = "1")]
332 pub retry_ratio: f32,
333 #[prost(uint32, tag = "2")]
337 pub min_retries_per_second: u32,
338 #[prost(message, optional, tag = "3")]
342 pub ttl: ::core::option::Option<::prost_types::Duration>,
343}
344#[allow(clippy::derive_partial_eq_without_eq)]
345#[derive(Clone, PartialEq, ::prost::Message)]
346pub struct ResponseClass {
347 #[prost(message, optional, tag = "1")]
349 pub condition: ::core::option::Option<ResponseMatch>,
350 #[prost(bool, tag = "2")]
353 pub is_failure: bool,
354}
355#[allow(clippy::derive_partial_eq_without_eq)]
356#[derive(Clone, PartialEq, ::prost::Message)]
357pub struct RequestMatch {
358 #[prost(oneof = "request_match::Match", tags = "1, 2, 3, 4, 5")]
359 pub r#match: ::core::option::Option<request_match::Match>,
360}
361pub mod request_match {
363 #[allow(clippy::derive_partial_eq_without_eq)]
364 #[derive(Clone, PartialEq, ::prost::Message)]
365 pub struct Seq {
366 #[prost(message, repeated, tag = "1")]
367 pub matches: ::prost::alloc::vec::Vec<super::RequestMatch>,
368 }
369 #[allow(clippy::derive_partial_eq_without_eq)]
370 #[derive(Clone, PartialEq, ::prost::Oneof)]
371 pub enum Match {
372 #[prost(message, tag = "1")]
373 All(Seq),
374 #[prost(message, tag = "2")]
375 Any(Seq),
376 #[prost(message, tag = "3")]
377 Not(::prost::alloc::boxed::Box<super::RequestMatch>),
378 #[prost(message, tag = "4")]
379 Path(super::PathMatch),
380 #[prost(message, tag = "5")]
382 Method(super::super::http_types::HttpMethod),
383 }
384}
385#[allow(clippy::derive_partial_eq_without_eq)]
386#[derive(Clone, PartialEq, ::prost::Message)]
387pub struct PathMatch {
388 #[prost(string, tag = "1")]
390 pub regex: ::prost::alloc::string::String,
391}
392#[allow(clippy::derive_partial_eq_without_eq)]
393#[derive(Clone, PartialEq, ::prost::Message)]
394pub struct ResponseMatch {
395 #[prost(oneof = "response_match::Match", tags = "1, 2, 3, 4")]
396 pub r#match: ::core::option::Option<response_match::Match>,
397}
398pub mod response_match {
400 #[allow(clippy::derive_partial_eq_without_eq)]
401 #[derive(Clone, PartialEq, ::prost::Message)]
402 pub struct Seq {
403 #[prost(message, repeated, tag = "1")]
404 pub matches: ::prost::alloc::vec::Vec<super::ResponseMatch>,
405 }
406 #[allow(clippy::derive_partial_eq_without_eq)]
407 #[derive(Clone, PartialEq, ::prost::Oneof)]
408 pub enum Match {
409 #[prost(message, tag = "1")]
410 All(Seq),
411 #[prost(message, tag = "2")]
412 Any(Seq),
413 #[prost(message, tag = "3")]
414 Not(::prost::alloc::boxed::Box<super::ResponseMatch>),
415 #[prost(message, tag = "4")]
417 Status(super::HttpStatusRange),
418 }
419}
420#[allow(clippy::derive_partial_eq_without_eq)]
423#[derive(Clone, PartialEq, ::prost::Message)]
424pub struct HttpStatusRange {
425 #[prost(uint32, tag = "1")]
427 pub min: u32,
428 #[prost(uint32, tag = "2")]
430 pub max: u32,
431}
432#[allow(clippy::derive_partial_eq_without_eq)]
433#[derive(Clone, PartialEq, ::prost::Message)]
434pub struct WeightedDst {
435 #[prost(string, tag = "1")]
438 pub authority: ::prost::alloc::string::String,
439 #[prost(uint32, tag = "2")]
442 pub weight: u32,
443 #[prost(message, optional, tag = "3")]
445 pub backend_ref: ::core::option::Option<super::meta::Metadata>,
446}
447pub mod destination_client {
449 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
450 use tonic::codegen::*;
451 use tonic::codegen::http::Uri;
452 #[derive(Debug, Clone)]
453 pub struct DestinationClient<T> {
454 inner: tonic::client::Grpc<T>,
455 }
456 impl<T> DestinationClient<T>
457 where
458 T: tonic::client::GrpcService<tonic::body::BoxBody>,
459 T::Error: Into<StdError>,
460 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
461 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
462 {
463 pub fn new(inner: T) -> Self {
464 let inner = tonic::client::Grpc::new(inner);
465 Self { inner }
466 }
467 pub fn with_origin(inner: T, origin: Uri) -> Self {
468 let inner = tonic::client::Grpc::with_origin(inner, origin);
469 Self { inner }
470 }
471 pub fn with_interceptor<F>(
472 inner: T,
473 interceptor: F,
474 ) -> DestinationClient<InterceptedService<T, F>>
475 where
476 F: tonic::service::Interceptor,
477 T::ResponseBody: Default,
478 T: tonic::codegen::Service<
479 http::Request<tonic::body::BoxBody>,
480 Response = http::Response<
481 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
482 >,
483 >,
484 <T as tonic::codegen::Service<
485 http::Request<tonic::body::BoxBody>,
486 >>::Error: Into<StdError> + Send + Sync,
487 {
488 DestinationClient::new(InterceptedService::new(inner, interceptor))
489 }
490 #[must_use]
495 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
496 self.inner = self.inner.send_compressed(encoding);
497 self
498 }
499 #[must_use]
501 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
502 self.inner = self.inner.accept_compressed(encoding);
503 self
504 }
505 #[must_use]
509 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
510 self.inner = self.inner.max_decoding_message_size(limit);
511 self
512 }
513 #[must_use]
517 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
518 self.inner = self.inner.max_encoding_message_size(limit);
519 self
520 }
521 pub async fn get(
524 &mut self,
525 request: impl tonic::IntoRequest<super::GetDestination>,
526 ) -> std::result::Result<
527 tonic::Response<tonic::codec::Streaming<super::Update>>,
528 tonic::Status,
529 > {
530 self.inner
531 .ready()
532 .await
533 .map_err(|e| {
534 tonic::Status::new(
535 tonic::Code::Unknown,
536 format!("Service was not ready: {}", e.into()),
537 )
538 })?;
539 let codec = tonic::codec::ProstCodec::default();
540 let path = http::uri::PathAndQuery::from_static(
541 "/io.linkerd.proxy.destination.Destination/Get",
542 );
543 let mut req = request.into_request();
544 req.extensions_mut()
545 .insert(
546 GrpcMethod::new("io.linkerd.proxy.destination.Destination", "Get"),
547 );
548 self.inner.server_streaming(req, path, codec).await
549 }
550 pub async fn get_profile(
553 &mut self,
554 request: impl tonic::IntoRequest<super::GetDestination>,
555 ) -> std::result::Result<
556 tonic::Response<tonic::codec::Streaming<super::DestinationProfile>>,
557 tonic::Status,
558 > {
559 self.inner
560 .ready()
561 .await
562 .map_err(|e| {
563 tonic::Status::new(
564 tonic::Code::Unknown,
565 format!("Service was not ready: {}", e.into()),
566 )
567 })?;
568 let codec = tonic::codec::ProstCodec::default();
569 let path = http::uri::PathAndQuery::from_static(
570 "/io.linkerd.proxy.destination.Destination/GetProfile",
571 );
572 let mut req = request.into_request();
573 req.extensions_mut()
574 .insert(
575 GrpcMethod::new(
576 "io.linkerd.proxy.destination.Destination",
577 "GetProfile",
578 ),
579 );
580 self.inner.server_streaming(req, path, codec).await
581 }
582 }
583}
584pub mod destination_server {
586 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
587 use tonic::codegen::*;
588 #[async_trait]
590 pub trait Destination: Send + Sync + 'static {
591 type GetStream: tonic::codegen::tokio_stream::Stream<
593 Item = std::result::Result<super::Update, tonic::Status>,
594 >
595 + Send
596 + 'static;
597 async fn get(
600 &self,
601 request: tonic::Request<super::GetDestination>,
602 ) -> std::result::Result<tonic::Response<Self::GetStream>, tonic::Status>;
603 type GetProfileStream: tonic::codegen::tokio_stream::Stream<
605 Item = std::result::Result<super::DestinationProfile, tonic::Status>,
606 >
607 + Send
608 + 'static;
609 async fn get_profile(
612 &self,
613 request: tonic::Request<super::GetDestination>,
614 ) -> std::result::Result<tonic::Response<Self::GetProfileStream>, tonic::Status>;
615 }
616 #[derive(Debug)]
617 pub struct DestinationServer<T: Destination> {
618 inner: _Inner<T>,
619 accept_compression_encodings: EnabledCompressionEncodings,
620 send_compression_encodings: EnabledCompressionEncodings,
621 max_decoding_message_size: Option<usize>,
622 max_encoding_message_size: Option<usize>,
623 }
624 struct _Inner<T>(Arc<T>);
625 impl<T: Destination> DestinationServer<T> {
626 pub fn new(inner: T) -> Self {
627 Self::from_arc(Arc::new(inner))
628 }
629 pub fn from_arc(inner: Arc<T>) -> Self {
630 let inner = _Inner(inner);
631 Self {
632 inner,
633 accept_compression_encodings: Default::default(),
634 send_compression_encodings: Default::default(),
635 max_decoding_message_size: None,
636 max_encoding_message_size: None,
637 }
638 }
639 pub fn with_interceptor<F>(
640 inner: T,
641 interceptor: F,
642 ) -> InterceptedService<Self, F>
643 where
644 F: tonic::service::Interceptor,
645 {
646 InterceptedService::new(Self::new(inner), interceptor)
647 }
648 #[must_use]
650 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
651 self.accept_compression_encodings.enable(encoding);
652 self
653 }
654 #[must_use]
656 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
657 self.send_compression_encodings.enable(encoding);
658 self
659 }
660 #[must_use]
664 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
665 self.max_decoding_message_size = Some(limit);
666 self
667 }
668 #[must_use]
672 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
673 self.max_encoding_message_size = Some(limit);
674 self
675 }
676 }
677 impl<T, B> tonic::codegen::Service<http::Request<B>> for DestinationServer<T>
678 where
679 T: Destination,
680 B: Body + Send + 'static,
681 B::Error: Into<StdError> + Send + 'static,
682 {
683 type Response = http::Response<tonic::body::BoxBody>;
684 type Error = std::convert::Infallible;
685 type Future = BoxFuture<Self::Response, Self::Error>;
686 fn poll_ready(
687 &mut self,
688 _cx: &mut Context<'_>,
689 ) -> Poll<std::result::Result<(), Self::Error>> {
690 Poll::Ready(Ok(()))
691 }
692 fn call(&mut self, req: http::Request<B>) -> Self::Future {
693 let inner = self.inner.clone();
694 match req.uri().path() {
695 "/io.linkerd.proxy.destination.Destination/Get" => {
696 #[allow(non_camel_case_types)]
697 struct GetSvc<T: Destination>(pub Arc<T>);
698 impl<
699 T: Destination,
700 > tonic::server::ServerStreamingService<super::GetDestination>
701 for GetSvc<T> {
702 type Response = super::Update;
703 type ResponseStream = T::GetStream;
704 type Future = BoxFuture<
705 tonic::Response<Self::ResponseStream>,
706 tonic::Status,
707 >;
708 fn call(
709 &mut self,
710 request: tonic::Request<super::GetDestination>,
711 ) -> Self::Future {
712 let inner = Arc::clone(&self.0);
713 let fut = async move {
714 <T as Destination>::get(&inner, request).await
715 };
716 Box::pin(fut)
717 }
718 }
719 let accept_compression_encodings = self.accept_compression_encodings;
720 let send_compression_encodings = self.send_compression_encodings;
721 let max_decoding_message_size = self.max_decoding_message_size;
722 let max_encoding_message_size = self.max_encoding_message_size;
723 let inner = self.inner.clone();
724 let fut = async move {
725 let inner = inner.0;
726 let method = GetSvc(inner);
727 let codec = tonic::codec::ProstCodec::default();
728 let mut grpc = tonic::server::Grpc::new(codec)
729 .apply_compression_config(
730 accept_compression_encodings,
731 send_compression_encodings,
732 )
733 .apply_max_message_size_config(
734 max_decoding_message_size,
735 max_encoding_message_size,
736 );
737 let res = grpc.server_streaming(method, req).await;
738 Ok(res)
739 };
740 Box::pin(fut)
741 }
742 "/io.linkerd.proxy.destination.Destination/GetProfile" => {
743 #[allow(non_camel_case_types)]
744 struct GetProfileSvc<T: Destination>(pub Arc<T>);
745 impl<
746 T: Destination,
747 > tonic::server::ServerStreamingService<super::GetDestination>
748 for GetProfileSvc<T> {
749 type Response = super::DestinationProfile;
750 type ResponseStream = T::GetProfileStream;
751 type Future = BoxFuture<
752 tonic::Response<Self::ResponseStream>,
753 tonic::Status,
754 >;
755 fn call(
756 &mut self,
757 request: tonic::Request<super::GetDestination>,
758 ) -> Self::Future {
759 let inner = Arc::clone(&self.0);
760 let fut = async move {
761 <T as Destination>::get_profile(&inner, request).await
762 };
763 Box::pin(fut)
764 }
765 }
766 let accept_compression_encodings = self.accept_compression_encodings;
767 let send_compression_encodings = self.send_compression_encodings;
768 let max_decoding_message_size = self.max_decoding_message_size;
769 let max_encoding_message_size = self.max_encoding_message_size;
770 let inner = self.inner.clone();
771 let fut = async move {
772 let inner = inner.0;
773 let method = GetProfileSvc(inner);
774 let codec = tonic::codec::ProstCodec::default();
775 let mut grpc = tonic::server::Grpc::new(codec)
776 .apply_compression_config(
777 accept_compression_encodings,
778 send_compression_encodings,
779 )
780 .apply_max_message_size_config(
781 max_decoding_message_size,
782 max_encoding_message_size,
783 );
784 let res = grpc.server_streaming(method, req).await;
785 Ok(res)
786 };
787 Box::pin(fut)
788 }
789 _ => {
790 Box::pin(async move {
791 Ok(
792 http::Response::builder()
793 .status(200)
794 .header("grpc-status", "12")
795 .header("content-type", "application/grpc")
796 .body(empty_body())
797 .unwrap(),
798 )
799 })
800 }
801 }
802 }
803 }
804 impl<T: Destination> Clone for DestinationServer<T> {
805 fn clone(&self) -> Self {
806 let inner = self.inner.clone();
807 Self {
808 inner,
809 accept_compression_encodings: self.accept_compression_encodings,
810 send_compression_encodings: self.send_compression_encodings,
811 max_decoding_message_size: self.max_decoding_message_size,
812 max_encoding_message_size: self.max_encoding_message_size,
813 }
814 }
815 }
816 impl<T: Destination> Clone for _Inner<T> {
817 fn clone(&self) -> Self {
818 Self(Arc::clone(&self.0))
819 }
820 }
821 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
822 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
823 write!(f, "{:?}", self.0)
824 }
825 }
826 impl<T: Destination> tonic::server::NamedService for DestinationServer<T> {
827 const NAME: &'static str = "io.linkerd.proxy.destination.Destination";
828 }
829}