Expand description
Partial chunk support for range requests.
This module provides functionality for serving partial content requests, enabling efficient byte-range retrieval for streaming scenarios.
§Features
- HTTP-style range request support (bytes=0-1023)
- Multi-range requests
- Chunk-aligned range calculations
- Efficient partial reads without loading full chunks
- Content-Length and Content-Range header generation
§Example
use chie_core::partial_chunk::{RangeRequest, RangeHandler};
// Parse a range request
let range = RangeRequest::parse("bytes=0-1023")?;
// Create a range handler for content
let handler = RangeHandler::new(1_000_000, 262_144); // 1MB total, 256KB chunks
// Get the chunks needed for this range
let chunks = handler.get_required_chunks(&range)?;
println!("Need chunks: {:?}", chunks);Structs§
- Byte
Range - Represents a byte range request
- Chunk
Range - Information about a chunk that needs to be read for a range
- Partial
Response - Response for a partial content request
- Range
Handler - Handles range requests for chunked content
- Range
Request - A range request (may contain multiple ranges)
Enums§
- Range
Error - Errors that can occur during range request processing