diff --git a/quinn/src/connection.rs b/quinn/src/connection.rs index 7d5706e24..d21313f9e 100644 --- a/quinn/src/connection.rs +++ b/quinn/src/connection.rs @@ -157,6 +157,14 @@ impl Connecting { inner.inner.local_ip() } + + /// The peer's UDP address. + /// + /// Will panic if called after `poll` has returned `Ready`. + pub fn remote_address(&self) -> SocketAddr { + let conn_ref: &ConnectionRef = self.conn.as_ref().expect("used after yielding Ready"); + conn_ref.state.lock("remote_address").inner.remote_address() + } } impl Future for Connecting { @@ -178,16 +186,6 @@ impl Future for Connecting { } } -impl Connecting { - /// The peer's UDP address. - /// - /// Will panic if called after `poll` has returned `Ready`. - pub fn remote_address(&self) -> SocketAddr { - let conn_ref: &ConnectionRef = self.conn.as_ref().expect("used after yielding Ready"); - conn_ref.state.lock("remote_address").inner.remote_address() - } -} - /// Future that completes when a connection is fully established /// /// For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting