fn tcp_reader(&mut self, sn: Sn) -> Result<TcpReader<Self>, Error<Self::Error>>
    where
        Self: Sized,
    {
        debug_assert!(!matches!(
            self.sn_sr(sn)?,
            Ok(SocketStatus::Udp) | Ok(SocketStatus::Init) | Ok(SocketStatus::Macraw)
        ));

        let sn_rx_rsr: u16 = self.sn_rx_rsr(sn)?;
        if sn_rx_rsr == 0 {
            return Err(Error::WouldBlock);
        }

        let sn_rx_rd: u16 = self.sn_rx_rd(sn)?;

        Ok(TcpReader {
            w5500: self,
            sn,
            head_ptr: sn_rx_rd,
            tail_ptr: sn_rx_rd.wrapping_add(sn_rx_rsr),
            ptr: sn_rx_rd,
        })
    }
/// Create a TCP reader.
///
/// This returns a [`TcpReader`] structure, which contains functions to
/// stream data from the W5500 socket buffers incrementally.
///
/// This will return [`Error::WouldBlock`] if there is no data to read.
///
/// # Errors
///
/// This method can only return:
///
/// * [`Error::Other`]
/// * [`Error::WouldBlock`]
///
/// # Example
///
/// See [`TcpReader`].
Create a TCP reader.
This returns a [`TcpReader`] structure, which contains functions to
stream data from the W5500 socket buffers incrementally.

This will return [`Error::WouldBlock`] if there is no data to read.
Create a TCP reader . This returns a [ ` TcpReader ` ] structure which contains functions to stream data from the W5500 socket buffers incrementally . This will return [ ` Error :: WouldBlock ` ] if there is no data to read .
fn tcp_reader(&mut self, sn: Sn) -> Result<TcpReader<Self>, Error<Self::Error>>
    where
        Self: Sized,
    {
        debug_assert!(!matches!(
            self.sn_sr(sn)?,
            Ok(SocketStatus::Udp) | Ok(SocketStatus::Init) | Ok(SocketStatus::Macraw)
        ));
        let sn_rx_rsr: u16 = self.sn_rx_rsr(sn)?;
        if sn_rx_rsr == 0 {
            return Err(Error::WouldBlock);
        }
        let sn_rx_rd: u16 = self.sn_rx_rd(sn)?;
        Ok(TcpReader {
            w5500: self,
            sn,
            head_ptr: sn_rx_rd,
            tail_ptr: sn_rx_rd.wrapping_add(sn_rx_rsr),
            ptr: sn_rx_rd,
        })
    }
fn tcp_reader ( & mut self , sn : Sn ) -> Result < TcpReader < Self > , Error < Self :: Error > > where Self : Sized , { debug_assert ! ( matches ( self sn_sr ( sn ) Ok ( SocketStatus Udp ) Ok ( SocketStatus Init ) Ok ( SocketStatus Macraw ) ) ) ; let sn_rx_rsr : u16 = self . sn_rx_rsr ( sn ) ? ; if sn_rx_rsr == 0 { return Err ( Error :: WouldBlock ) ; } let sn_rx_rd : u16 = self . sn_rx_rd ( sn ) ? ; Ok ( TcpReader { w5500 : self , sn , head_ptr : sn_rx_rd , tail_ptr : sn_rx_rd . wrapping_add ( sn_rx_rsr ) , ptr : sn_rx_rd , } ) }
Create a TCP reader.
Create a TCP reader .
&mut self
sn
Sn
&mut self
sn
Sn
errors
This method can only return.

[`Error::Other`]
[`Error::WouldBlock`]
This method can only return . [ ` Error :: Other ` ] [ ` Error :: WouldBlock ` ]
example
None