pub struct Socket { /* private fields */ }Expand description
Represents an UDP socket.
Implementations§
Trait Implementations§
Source§impl RW for Socket
impl RW for Socket
Source§fn send_to(&self, buf: &[u8], addr: SocketAddr) -> Result<usize>
fn send_to(&self, buf: &[u8], addr: SocketAddr) -> Result<usize>
Sends data on the socket to the given address.
Source§fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
Receives a single datagram message on the socket.
Source§fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
Sets the read timeout to the timeout specified.
Auto Trait Implementations§
impl Freeze for Socket
impl RefUnwindSafe for Socket
impl Send for Socket
impl Sync for Socket
impl Unpin for Socket
impl UnwindSafe for Socket
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