Available on crate feature
alloc only.Expand description
Streaming serialization support for oxicode.
This module provides incremental encoding and decoding for large data sets that don’t fit in memory all at once.
§Features
- Chunked Encoding: Encode large collections in chunks
- Incremental Decoding: Decode items one at a time
- Backpressure: Control memory usage during streaming
- Progress Callbacks: Monitor long operations
§Example
ⓘ
use oxicode::streaming::{StreamingEncoder, StreamingDecoder};
// Stream encode a large dataset
let mut encoder = StreamingEncoder::new(writer);
for item in large_dataset {
encoder.write_item(&item)?;
}
encoder.finish()?;
// Stream decode
let mut decoder = StreamingDecoder::new(reader);
while let Some(item) = decoder.read_item::<MyType>()? {
process(item);
}Structs§
- Async
Streaming Decoder async-tokio - An async streaming decoder for reading items incrementally.
- Async
Streaming Encoder async-tokio - An async streaming encoder for writing items incrementally.
- Buffer
Streaming Decoder - Streaming decoder for in-memory buffers (no std required).
- Buffer
Streaming Encoder - Streaming encoder for in-memory buffers (no std required).
- Cancellable
Async Decoder async-tokio - An async streaming decoder with cancellation support.
- Cancellable
Async Encoder async-tokio - An async streaming encoder with cancellation support.
- Cancellation
Token async-tokio - A cancellation token for async streaming operations.
- Chunk
Header - Header for each chunk in the stream.
- Streaming
Config - Streaming configuration.
- Streaming
Decoder std - A streaming decoder for reading items incrementally.
- Streaming
Encoder std - A streaming encoder for writing items incrementally.
- Streaming
Progress - Progress information for streaming operations.
Constants§
- CHUNK_
MAGIC - Magic bytes for chunk header: “OXIS” (OXIcode Stream)
- DEFAULT_
CHUNK_ SIZE - Default chunk size for streaming operations (64KB).
- MAX_
CHUNK_ SIZE - Maximum chunk size allowed (16MB).
Type Aliases§
- Async
Decoder async-tokio - Short alias for
AsyncStreamingDecoder— available when theasync-tokiofeature is enabled. - Async
Encoder async-tokio - Short alias for
AsyncStreamingEncoder— available when theasync-tokiofeature is enabled. - Progress
Callback - Callback type for progress updates.