forked from proxmox-mirrors/proxmox
RateLimitedStream: implement peer_addr
This commit is contained in:
parent
e0a9982dd1
commit
0c27d5da17
@ -24,6 +24,12 @@ pub struct RateLimitedStream<S> {
|
|||||||
stream: 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> {
|
impl <S> RateLimitedStream<S> {
|
||||||
|
|
||||||
/// Creates a new instance with reads and writes limited to the same `rate`.
|
/// Creates a new instance with reads and writes limited to the same `rate`.
|
||||||
|
Loading…
Reference in New Issue
Block a user