pub async fn read_string<R: AsyncRead + Unpin>(reader: &mut R, length: usize) -> Result<String> {
    let mut buffer = String::with_capacity(length);
    reader.take(length as u64).read_to_string(&mut buffer).await?;

    Ok(buffer)
}
/// Read and return a dynamic length string from a reader which impls AsyncRead.
Read and return a dynamic length string from a reader which impls AsyncRead.
Read and return a dynamic length string from a reader which impls AsyncRead .
pub async fn read_string<R: AsyncRead + Unpin>(reader: &mut R, length: usize) -> Result<String> {
    let mut buffer = String::with_capacity(length);
    reader.take(length as u64).read_to_string(&mut buffer).await?;
    Ok(buffer)
}
pub async fn read_string < R : AsyncRead + Unpin > ( reader : & mut R , length : usize ) -> Result < String > { let mut buffer = String :: with_capacity ( length ) ; reader . take ( length as u64 ) . read_to_string ( & mut buffer ) . await ? ; Ok ( buffer ) }
Read and return a dynamic length string from a reader which impls AsyncRead.
Read and return a dynamic length string from a reader which impls AsyncRead .
reader
&mut R
length
usize
reader
&mut R
length
usize