Struct async_transport::UdpSocket
source · pub struct UdpSocket { /* private fields */ }Implementations§
source§impl UdpSocket
impl UdpSocket
pub async fn bind<A: AsyncToSocketAddrs>(addr: A) -> Result<Self>
pub async fn connect<A: AsyncToSocketAddrs>(&self, addr: A) -> Result<()>
pub async fn send_to<A: AsyncToSocketAddrs>( &self, buf: &[u8], addr: A ) -> Result<usize>
pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub async fn send( &self, capabilities: &Capabilities, transmits: &[Transmit] ) -> Result<usize>
pub async fn recv( &self, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta] ) -> Result<usize>
Trait Implementations§
source§impl AsyncUdpSocket for UdpSocket
impl AsyncUdpSocket for UdpSocket
source§fn poll_send(
&self,
cx: &mut Context<'_>,
capabilities: &Capabilities,
transmits: &[Transmit]
) -> Poll<Result<usize>>
fn poll_send( &self, cx: &mut Context<'_>, capabilities: &Capabilities, transmits: &[Transmit] ) -> Poll<Result<usize>>
Send UDP datagrams from
transmits, or register to be woken if sending may succeed in the
futuresource§fn 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
source§fn local_addr(&self) -> Result<SocketAddr>
fn local_addr(&self) -> Result<SocketAddr>
Look up the local IP address and port used by this socket
source§fn peer_addr(&self) -> Result<SocketAddr>
fn peer_addr(&self) -> Result<SocketAddr>
Look up the peer IP address and port used by this socket