Expand description
Streaming utilities for large content transfers.
This module provides efficient streaming capabilities for transferring large content without loading everything into memory at once.
§Features
- Chunk-based streaming with configurable buffer sizes
- Async I/O support with backpressure handling
- Progress tracking and bandwidth estimation
- Automatic retry on transient failures
- Memory-efficient design for large files
§Example
use chie_core::streaming::{ContentStream, StreamConfig};
use std::path::PathBuf;
let config = StreamConfig::default();
let mut stream = ContentStream::from_file(PathBuf::from("large_file.bin"), config).await?;
while let Some(chunk) = stream.next_chunk().await? {
println!("Received {} bytes, progress: {:.1}%",
chunk.len(), stream.progress() * 100.0);
// Process chunk...
}Structs§
- Chunk
Writer - Chunk writer for streaming writes.
- Content
Stream - Content stream for efficient data transfer.
- Stream
Config - Configuration for content streaming.
Enums§
- Stream
Error - Streaming error types.
Functions§
- stream_
copy - Stream content from source to destination.