Struct UdpSocket
pub struct UdpSocket<'a> { /* private fields */ }
Expand description
UDP socket for sending and receiving datagrams.
Implementations§
Trait Implementations§
§impl<'a> UdpSocket for UdpSocket<'a>
impl<'a> UdpSocket for UdpSocket<'a>
§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
§fn local_addr(&self) -> Result<SocketAddr, Error>
fn local_addr(&self) -> Result<SocketAddr, Error>
Returns the local address this socket is bound to.
§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<'a> Freeze for UdpSocket<'a>
impl<'a> !RefUnwindSafe for UdpSocket<'a>
impl<'a> !Send for UdpSocket<'a>
impl<'a> !Sync for UdpSocket<'a>
impl<'a> Unpin for UdpSocket<'a>
impl<'a> !UnwindSafe for UdpSocket<'a>
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