Skip to main content

read_with_timeout

Function read_with_timeout 

Source
pub async fn read_with_timeout(
    reader: &mut (impl AsyncRead + Unpin),
    timeout: Duration,
) -> Vec<u8> 
Expand description

Read all available data from an AsyncRead within a timeout.

Reads chunks until the timeout expires or the remote closes. Returns the accumulated bytes.