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>
fn local_addr(&self) -> Result<SocketAddr, Error>
Try to get the local address of the socket.
fn peer_addr(&self) -> Result<SocketAddr, Error>
fn peer_addr(&self) -> Result<SocketAddr, Error>
Try to get the remote address of the socket.