Trait async_transport::AsyncUdpSocket
source · pub trait AsyncUdpSocket: Send + Debug + 'static {
// Required methods
fn poll_send(
&self,
cx: &mut Context<'_>,
capabilities: &Capabilities,
transmits: &[Transmit]
) -> Poll<Result<usize, Error>>;
fn poll_recv(
&self,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>],
meta: &mut [RecvMeta]
) -> Poll<Result<usize>>;
fn local_addr(&self) -> Result<SocketAddr>;
fn peer_addr(&self) -> Result<SocketAddr>;
}Expand description
Abstract implementation of a UDP socket for runtime independence
Required Methods§
sourcefn poll_send(
&self,
cx: &mut Context<'_>,
capabilities: &Capabilities,
transmits: &[Transmit]
) -> Poll<Result<usize, Error>>
fn poll_send( &self, cx: &mut Context<'_>, capabilities: &Capabilities, transmits: &[Transmit] ) -> Poll<Result<usize, Error>>
Send UDP datagrams from transmits, or register to be woken if sending may succeed in the
future
sourcefn poll_recv(
&self,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>],
meta: &mut [RecvMeta]
) -> Poll<Result<usize>>
fn poll_recv( &self, cx: &mut Context<'_>, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta] ) -> Poll<Result<usize>>
Receive UDP datagrams, or register to be woken if receiving may succeed in the future
sourcefn local_addr(&self) -> Result<SocketAddr>
fn local_addr(&self) -> Result<SocketAddr>
Look up the local IP address and port used by this socket
sourcefn peer_addr(&self) -> Result<SocketAddr>
fn peer_addr(&self) -> Result<SocketAddr>
Look up the peer IP address and port used by this socket