pub fn read_payload(&mut self, buf: &mut [u8]) -> Result<u16, Error<E>> {
        self.reader
            .seek(SeekFrom::Start(self.payload_idx))
            .map_err(Error::map_w5500)?;
        let read_len: u16 = min(buf.len().try_into().unwrap_or(u16::MAX), self.payload_len);
        self.reader
            .read_exact(&mut buf[..read_len.into()])
            .map_err(Error::map_w5500)?;
        Ok(read_len)
    }
/// Read the payload into `buf`, and return the number of bytes read.
Read the payload into `buf`, and return the number of bytes read.
Read the payload into ` buf ` and return the number of bytes read .
pub fn read_payload(&mut self, buf: &mut [u8]) -> Result<u16, Error<E>> {
        self.reader
            .seek(SeekFrom::Start(self.payload_idx))
            .map_err(Error::map_w5500)?;
        let read_len: u16 = min(buf.len().try_into().unwrap_or(u16::MAX), self.payload_len);
        self.reader
            .read_exact(&mut buf[..read_len.into()])
            .map_err(Error::map_w5500)?;
        Ok(read_len)
    }
pub fn read_payload ( & mut self , buf : & mut [ u8 ] ) -> Result < u16 , Error < E > > { self . reader . seek ( SeekFrom :: Start ( self . payload_idx ) ) . map_err ( Error :: map_w5500 ) ? ; let read_len : u16 = min ( buf . len ( ) . try_into ( ) . unwrap_or ( u16 :: MAX ) , self . payload_len ) ; self . reader . read_exact ( & mut buf [ .. read_len . into ( ) ] ) . map_err ( Error :: map_w5500 ) ? ; Ok ( read_len ) }
Read the payload into `buf`, and return the number of bytes read.
Read the payload into ` buf ` and return the number of bytes read .
&mut self
buf
&mut [u8]
&mut self
buf
&mut [u8]