Trait laminar::DatagramSocket [−][src]
pub trait DatagramSocket: Debug { fn send_packet(
&mut self,
addr: &SocketAddr,
payload: &[u8]
) -> Result<usize>; fn receive_packet<'a>(
&mut self,
buffer: &'a mut [u8]
) -> Result<(&'a [u8], SocketAddr)>; fn local_addr(&self) -> Result<SocketAddr>; fn is_blocking_mode(&self) -> bool; }
A datagram socket is a type of network socket which provides a connectionless point for sending or receiving data packets.
Required methods
fn send_packet(&mut self, addr: &SocketAddr, payload: &[u8]) -> Result<usize>
[src]
Sends a single packet to the socket.
fn receive_packet<'a>(
&mut self,
buffer: &'a mut [u8]
) -> Result<(&'a [u8], SocketAddr)>
[src]
&mut self,
buffer: &'a mut [u8]
) -> Result<(&'a [u8], SocketAddr)>
Receives a single packet from the socket.
fn local_addr(&self) -> Result<SocketAddr>
[src]
Returns the socket address that this socket was created from.
fn is_blocking_mode(&self) -> bool
[src]
Returns whether socket operates in blocking or non-blocking mode.