pub trait RawReceive: ErrorType {
// Required method
async fn receive(
&mut self,
buffer: &mut [u8],
) -> Result<(usize, [u8; 6]), Self::Error>;
}Expand description
Re-export the edge-nal crate
This trait is implemented by raw sockets and models their datagram receiving functionality.
Required Methods§
Sourceasync fn receive(
&mut self,
buffer: &mut [u8],
) -> Result<(usize, [u8; 6]), Self::Error>
async fn receive( &mut self, buffer: &mut [u8], ) -> Result<(usize, [u8; 6]), Self::Error>
Receive a datagram into the provided buffer.
If the received datagram exceeds the buffer’s length, it is received regardless, and the remaining bytes are discarded. The full datagram size is still indicated in the result, allowing the recipient to detect that truncation.
The remote Mac address is given in the result along with the number of bytes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".