Skip to main content

Module streaming

Module streaming 

Source
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§

AsyncStreamingDecoderasync-tokio
An async streaming decoder for reading items incrementally.
AsyncStreamingEncoderasync-tokio
An async streaming encoder for writing items incrementally.
BufferStreamingDecoder
Streaming decoder for in-memory buffers (no std required).
BufferStreamingEncoder
Streaming encoder for in-memory buffers (no std required).
CancellableAsyncDecoderasync-tokio
An async streaming decoder with cancellation support.
CancellableAsyncEncoderasync-tokio
An async streaming encoder with cancellation support.
CancellationTokenasync-tokio
A cancellation token for async streaming operations.
ChunkHeader
Header for each chunk in the stream.
StreamingConfig
Streaming configuration.
StreamingDecoderstd
A streaming decoder for reading items incrementally.
StreamingEncoderstd
A streaming encoder for writing items incrementally.
StreamingProgress
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§

AsyncDecoderasync-tokio
Short alias for AsyncStreamingDecoder — available when the async-tokio feature is enabled.
AsyncEncoderasync-tokio
Short alias for AsyncStreamingEncoder — available when the async-tokio feature is enabled.
ProgressCallback
Callback type for progress updates.