RateLimitedStream: implement peer_addr

This commit is contained in:
Dietmar Maurer 2021-11-04 13:16:13 +01:00
parent e0a9982dd1
commit 0c27d5da17

View File

@ -24,6 +24,12 @@ pub struct RateLimitedStream<S> {
stream: S,
}
impl RateLimitedStream<tokio::net::TcpStream> {
pub fn peer_addr(&self) -> std::io::Result<std::net::SocketAddr> {
self.stream.peer_addr()
}
}
impl <S> RateLimitedStream<S> {
/// Creates a new instance with reads and writes limited to the same `rate`.