Trait rama::net::stream::Socket

pub trait Socket:
    Send
    + Sync
    + 'static {
    // Required methods
    fn local_addr(&self) -> Result<SocketAddr, Error>;
    fn peer_addr(&self) -> Result<SocketAddr, Error>;
}
Expand description

Common information exposed by a Socket-like construct.

For now this is implemented for TCP and UDP, as these are the types that are relevant to Rama.

Required Methods§

fn local_addr(&self) -> Result<SocketAddr, Error>

Try to get the local address of the socket.

fn peer_addr(&self) -> Result<SocketAddr, Error>

Try to get the remote address of the socket.

Implementations on Foreign Types§

§

impl Socket for TcpStream

§

impl Socket for UdpSocket

§

impl Socket for TcpStream

§

impl Socket for UdpSocket

Implementors§