pub async fn read_line(&self) -> Result<String> {
        let mut write = self.write.lock().await;

        write.set_position(0);
        let mut line = Vec::new();
        let mut buf = [0_u8; 1]; // speed doesn't matter.

        while !line.ends_with(b"\r\n") {
            write.read_exact(&mut buf).await?;
            line.extend_from_slice(&buf);
        }

        String::from_utf8(line).map_err(|err| Error::new(ErrorKind::Other, err))
    }
/// Read the first line written via an `AsyncWrite`
Read the first line written via an `AsyncWrite`
Read the first line written via an ` AsyncWrite `
pub async fn read_line(&self) -> Result<String> {
        let mut write = self.write.lock().await;
        write.set_position(0);
        let mut line = Vec::new();
        let mut buf = [0_u8; 1]; // speed doesn't matter.
        while !line.ends_with(b"\r\n") {
            write.read_exact(&mut buf).await?;
            line.extend_from_slice(&buf);
        }
        String::from_utf8(line).map_err(|err| Error::new(ErrorKind::Other, err))
    }
pub async fn read_line ( & self ) -> Result < String > { let mut write = self . write . lock ( ) . await ; write . set_position ( 0 ) ; let mut line = Vec :: new ( ) ; let mut buf = [ 0_u8 ; 1 ] ; // speed doesn't matter. while ! line . ends_with ( b" \r \n " ) { write . read_exact ( & mut buf ) . await ? ; line . extend_from_slice ( & buf ) ; } String :: from_utf8 ( line ) . map_err ( | err | Error :: new ( ErrorKind :: Other , err ) ) }
Read the first line written via an `AsyncWrite`
Read the first line written via an ` AsyncWrite `
&self
&self