pub trait Read<E> {
// Required methods
fn read(&mut self, buf: &mut [u8]) -> Result<u16, E>;
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error<E>>;
fn done(self) -> Result<(), E>;
}
Expand description
Socket reader trait.
Required Methods§
sourcefn read(&mut self, buf: &mut [u8]) -> Result<u16, E>
fn read(&mut self, buf: &mut [u8]) -> Result<u16, E>
Read data from the UDP socket, and return the number of bytes read.