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§
- Range
Request - A parsed byte range request.
Enums§
- Range
Handling - 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.