Trait w5500_hl::io::Read

source ·
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§

source

fn read(&mut self, buf: &mut [u8]) -> Result<u16, E>

Read data from the UDP socket, and return the number of bytes read.

source

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error<E>>

Read the exact number of bytes required to fill buf.

This function reads as many bytes as necessary to completely fill the specified buffer buf.

Errors

This method can only return:

source

fn done(self) -> Result<(), E>

Mark the data as read, removing the data from the queue.

For a TCP reader this removes all data up to the current pointer position from the queue.

For a UDP reader this removes the UDP datagram from the queue.

Implementors§

source§

impl<'a, W5500: Registers> Read<<W5500 as Registers>::Error> for TcpReader<'a, W5500>

source§

impl<'w, W5500: Registers> Read<<W5500 as Registers>::Error> for UdpReader<'w, W5500>