Skip to main content

PeerAddr

Trait PeerAddr 

Source
pub trait PeerAddr {
    // Required method
    fn peer_addr(&self) -> Option<SocketAddr>;

    // Provided method
    fn local_addr(&self) -> Option<SocketAddr> { ... }
}
Expand description

A stream that can name the remote address it is connected to.

accept uses it to record where a refused peer came from. A stream without an address, or one that is not TCP, is accepted wrapped in an Addressed.

Required Methods§

Source

fn peer_addr(&self) -> Option<SocketAddr>

The remote address, when known.

Provided Methods§

Source

fn local_addr(&self) -> Option<SocketAddr>

The local address the connection arrived at, when known: a policy’s access control list reads it for rules that name a destination or a port. None unless implemented.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PeerAddr for TcpStream

Source§

impl PeerAddr for TcpStream

Implementors§