Skip to main content

range_reader

Function range_reader 

pub async fn range_reader(
    reader: Pin<Box<dyn AsyncRead + Send>>,
    range: Option<Range<u64>>,
) -> Result<Pin<Box<dyn AsyncRead + Send>>, Box<dyn Error + Send + Sync>>
Available on crate feature inspect only.
Expand description

Select a range from a streaming reader without buffering its contents. A non-zero start consumes the prefix; seekable backends should address it directly. Bounds beyond EOF clamp to the content length; errors while reading the prefix still propagate, including errors from an authenticating storage layer.