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
Auto Trait Implementations§
impl !Freeze for UdpSocket
impl RefUnwindSafe for UdpSocket
impl Send for UdpSocket
impl Sync for UdpSocket
impl Unpin for UdpSocket
impl UnwindSafe for UdpSocket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more