Module range

Module range 

Source
Expand description

HTTP Range request parsing and handling.

This module provides utilities for working with HTTP Range requests (RFC 7233), which allow clients to request specific byte ranges of a resource. This is commonly used for video streaming, large file downloads, and resume capabilities.

§Example

use tower_http_cache::range::parse_range_header;
use http::HeaderMap;

let mut headers = HeaderMap::new();
headers.insert("range", "bytes=0-1023".parse().unwrap());

if let Some(range) = parse_range_header(&headers) {
    println!("Requested bytes {}-{:?}", range.start, range.end);
}

Structs§

RangeRequest
A parsed byte range request.

Enums§

RangeHandling
Policy for handling range requests in the cache.

Functions§

build_content_range_header
Builds a Content-Range header value.
is_partial_content
Checks if a response status code indicates a partial content response.
parse_content_range_header
Parses a Content-Range header from a response.
parse_range_header
Parses a Range header value.