Trait Socket

Source
pub trait Socket:
    Send
    + Sync
    + 'static {
    // Required methods
    fn local_addr(&self) -> Result<SocketAddr>;
    fn peer_addr(&self) -> Result<SocketAddr>;
}
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§

Source

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

Try to get the local address of the socket.

Source

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

Try to get the remote address of the socket.

Implementations on Foreign Types§

Source§

impl Socket for TcpStream

Source§

impl Socket for UdpSocket

Source§

impl Socket for TcpStream

Source§

impl Socket for UdpSocket

Implementors§

Source§

impl<C, ID> Socket for LeasedConnection<C, ID>
where ID: Send + Sync + 'static, C: Socket,