We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a85ac7 commit 67e99b7Copy full SHA for 67e99b7
linkerd/app/core/src/control.rs
@@ -268,7 +268,7 @@ mod balance {
268
269
/// Creates a client suitable for gRPC.
270
mod client {
271
- use crate::transport::{connect, tls};
+ use crate::transport::tls;
272
use crate::{proxy::http, svc};
273
use linkerd2_proxy_http::h2::Settings as H2Settings;
274
use std::{
@@ -295,8 +295,8 @@ mod client {
295
296
// === impl Target ===
297
298
- impl connect::ConnectAddr for Target {
299
- fn connect_addr(&self) -> SocketAddr {
+ impl Into<SocketAddr> for Target {
+ fn into(self) -> SocketAddr {
300
self.addr
301
}
302
linkerd/app/inbound/src/endpoint.rs
@@ -4,7 +4,7 @@ use linkerd2_app_core::{
4
http_request_l5d_override_dst_addr, metric_labels, profiles,
5
proxy::{http, identity, tap},
6
router, stack_tracing,
7
- transport::{connect, listen, tls},
+ transport::{listen, tls},
8
Addr, Conditional, CANONICAL_DST_HEADER, DST_OVERRIDE_HEADER,
9
};
10
use std::fmt;
@@ -41,8 +41,8 @@ pub struct ProfileTarget;
41
42
// === impl HttpEndpoint ===
43
44
-impl connect::ConnectAddr for HttpEndpoint {
45
+impl Into<SocketAddr> for HttpEndpoint {
46
([127, 0, 0, 1], self.port).into()
47
48
@@ -86,8 +86,8 @@ impl From<tls::accept::Meta> for TcpEndpoint {
86
87
88
89
-impl connect::ConnectAddr for TcpEndpoint {
90
+impl Into<SocketAddr> for TcpEndpoint {
91
92
93
linkerd/app/outbound/src/endpoint.rs
@@ -13,7 +13,7 @@ use linkerd2_app_core::{
13
tap,
14
},
15
router,
16
17
Addr, Conditional, L5D_REQUIRE_ID,
18
19
use std::net::SocketAddr;
@@ -144,9 +144,9 @@ impl<T: tap::Inspect> tap::Inspect for Target<T> {
144
145
146
147
-impl<T: connect::ConnectAddr> connect::ConnectAddr for Target<T> {
148
149
- self.inner.connect_addr()
+impl<T: Into<SocketAddr>> Into<SocketAddr> for Target<T> {
+ self.inner.into()
150
151
152
@@ -195,8 +195,8 @@ impl tls::HasPeerIdentity for HttpEndpoint {
195
196
197
198
199
200
201
202
@@ -322,8 +322,8 @@ impl From<listen::Addrs> for TcpEndpoint {
322
323
324
325
326
327
328
329
linkerd/proxy/transport/src/connect.rs
@@ -3,10 +3,6 @@ use std::{future::Future, io, net::SocketAddr, pin::Pin, time::Duration};
3
use tokio::net::TcpStream;
use tracing::debug;
-pub trait ConnectAddr {
- fn connect_addr(&self) -> SocketAddr;
-}
-
#[derive(Copy, Clone, Debug)]
11
pub struct Connect {
12
keepalive: Option<Duration>,
@@ -18,7 +14,7 @@ impl Connect {
20
21
-impl<C: ConnectAddr> tower::Service<C> for Connect {
+impl<T: Into<SocketAddr>> tower::Service<T> for Connect {
22
type Response = TcpStream;
23
type Error = io::Error;
24
type Future =
@@ -28,9 +24,9 @@ impl<C: ConnectAddr> tower::Service<C> for Connect {
28
Poll::Ready(Ok(()))
29
25
30
26
31
- fn call(&mut self, c: C) -> Self::Future {
27
+ fn call(&mut self, t: T) -> Self::Future {
32
let keepalive = self.keepalive;
33
- let addr = c.connect_addr();
+ let addr = t.into();
34
debug!(peer.addr = %addr, "Connecting");
35
Box::pin(async move {
36
let io = TcpStream::connect(&addr).await?;
linkerd/proxy/transport/tests/tls_accept.rs
@@ -303,8 +303,8 @@ struct Target(SocketAddr, Conditional<Name>);
303
#[derive(Clone)]
304
struct ClientTls(CrtKey);
305
306
-impl connect::ConnectAddr for Target {
307
+impl Into<SocketAddr> for Target {
308
self.0
309
310
0 commit comments