Skip to main content

pooled_read_callback

Function pooled_read_callback 

Source
pub async fn pooled_read_callback<T>(
    rdr: impl AsyncRead,
    limit: usize,
    resolve: impl FnMut(&[u8]) -> T,
) -> Result<Option<T>>
Expand description

Like pooled_read, but instead of allocating, invokes resolve on the freshly read bytes (still backed by the thread-local buffer).

Ok(None) indicates EOF.