pub struct UdpSocket { /* private fields */ }
Expand description
UDP socket for sending and receiving datagrams.
Implementations§
Trait Implementations§
Source§impl UdpSocket for UdpSocket
impl UdpSocket for UdpSocket
Source§async fn bind(&mut self, address: SocketAddr) -> Result<(), Error>
async fn bind(&mut self, address: SocketAddr) -> Result<(), Error>
Binds the socket to a local address. Read more
Source§fn local_addr(&self) -> Result<SocketAddr, Error>
fn local_addr(&self) -> Result<SocketAddr, Error>
Returns the local address this socket is bound to.
Source§async fn recv_from(
&self,
buffer: &mut [u8],
) -> Result<(usize, SocketAddr), Error>
async fn recv_from( &self, buffer: &mut [u8], ) -> Result<(usize, SocketAddr), Error>
Receives a datagram. Read more
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