pub fn read(&mut self, mut buf: &mut [u8]) -> Result<usize, Error<TcpStack::Error>> {
        // Atomically access the socket.
        let socket = self.socket.as_mut().ok_or(Error::NotReady)?;
        let result = self.network_stack.receive(socket, &mut buf);

        result.or_else(|err| match err {
            nb::Error::WouldBlock => Ok(0),
            nb::Error::Other(err) => Err(Error::Network(err)),
        })
    }
/// Read data from the TCP interface.
///
/// # Args
/// * `buf` - A location to store read data into.
///
/// # Returns
/// The number of bytes successfully read.
Read data from the TCP interface.
Read data from the TCP interface .
pub fn read(&mut self, mut buf: &mut [u8]) -> Result<usize, Error<TcpStack::Error>> {
        // Atomically access the socket.
        let socket = self.socket.as_mut().ok_or(Error::NotReady)?;
        let result = self.network_stack.receive(socket, &mut buf);
        result.or_else(|err| match err {
            nb::Error::WouldBlock => Ok(0),
            nb::Error::Other(err) => Err(Error::Network(err)),
        })
    }
pub fn read ( & mut self , mut buf : & mut [ u8 ] ) -> Result < usize , Error < TcpStack :: Error > > { // Atomically access the socket. let socket = self . socket . as_mut ( ) . ok_or ( Error :: NotReady ) ? ; let result = self . network_stack . receive ( socket , & mut buf ) ; result . or_else ( | err | match err { nb :: Error :: WouldBlock => Ok ( 0 ) , nb :: Error :: Other ( err ) => Err ( Error :: Network ( err ) ) , } ) }
Read data from the TCP interface.
Read data from the TCP interface .
The number of bytes successfully read.
The number of bytes successfully read .
&mut self
buf
&mut [u8]
args
`buf` - A location to store read data into.
` buf ` - A location to store read data into .