Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Lightstream
Zero-copy Arrow streaming over any transport.
Lightstream gives you Arrow IPC streaming with SIMD-aligned buffers across TCP, QUIC, WebSocket, Unix sockets, and stdio. No FlightRPC overhead, no Protobuf copies, no heavy infrastructure. Plug into Tokio, stream tables, stay zero-copy from wire to SIMD kernel.
Why Lightstream?
The problem: Arrow has great in-memory format, but getting data in and out efficiently is painful. DIY Protobuf copies everything. FlightRPC is heavyweight. Most solutions break SIMD alignment somewhere in the pipeline.
The solution: Lightstream maintains 64-byte alignment from source to sink. Memory-mapped reads hit 100M rows in ~4.5ms. Async streams integrate with Tokio. Pick your transport, pick your format, keep your alignment.
Transports
| Transport | Feature Flag | Description |
|---|---|---|
| TCP | tcp |
Raw TCP sockets |
| WebSocket | websocket |
Browser-compatible streaming |
| QUIC | quic |
Modern UDP-based, multiplexed connections |
| Unix Domain Socket | uds |
Fast local IPC |
| Stdio | stdio |
Pipe-based communication |
| WebTransport | webtransport |
Modern WebTransport support via wtransport crate |
All transports use the same codec layer. Switch transports without changing your framing logic.
Formats
| Format | Description |
|---|---|
| Arrow IPC | SIMD-aligned File and Stream protocols with schema + dictionaries |
| TLV | Minimal type-length-value for lightweight transport |
| CSV | Streaming readers/writers with null handling |
| Parquet | Columnar with Zstd/Snappy compression (feature-gated) |
| Memory Maps | Zero-copy ingestion, millions of rows in microseconds |
Lightstream Protocol
Need more than raw tables? The optional protocol layer multiplexes typed messages and Arrow tables on a single connection. Register named types on both sides, then send and receive freely - raw bytes, Protobuf, MessagePack, or Arrow tables, all interleaved on one stream.
- TLV wire format -
[tag: u8][len: u32 LE][payload], 5-byte header per frame - Persistent Arrow state - first table send carries schema and dictionaries; subsequent sends carry only record batches
- Format-agnostic payloads - raw
&[u8], Protobuf viaprost, or MessagePack viarmp-serde - Works on every transport - same API across TCP, WebSocket, QUIC, UDS, WebTransport, and stdio
use TcpLightstreamConnection;
use LightstreamMessage;
let mut conn = from_tcp;
// Both sides register types in the same order
conn.register_message; // tag 0: opaque byte payloads
conn.register_message; // tag 1: msgpack-encoded structs
conn.register_table; // Arrow table channel
// Send a mix of message types on one connection
conn.send.await?;
conn.send_msgpack.await?;
conn.send_table.await?;
conn.flush.await?;
// Receive and dispatch
while let Some = conn.recv.await
Enable with the protocol feature flag, plus msgpack or protobuf if you want typed serialisation.
Quick Start
Stream Tables over TCP
use StreamExt;
use TcpTableReader;
let mut reader = connect.await?;
while let Some = reader.next.await
Write Arrow Files
use ;
use TableWriter;
use IPCMessageProtocol;
use File;
let table = new;
let file = create.await?;
let schema: = table.schema.iter.map.collect;
let mut writer = new?;
writer.write_table.await?;
writer.finish.await?;
Custom Protocol
use FrameDecoder;
use DecodeResult;
use FramedByteStream;
;
let framed = new;
Architecture
Lightstream is layered and composable. Swap any layer without rewriting the stack:
| Layer | Implementation | Replaceable |
|---|---|---|
| Transport | TCP, QUIC, WebSocket, UDS, WebTransport, Stdio | Yes |
| Protocol | LightstreamConnection - typed multiplexing |
Optional |
| Framing | TlvFrame, IpcMessage |
Yes |
| Buffering | StreamBuffer |
Yes |
| Encoding | FrameEncoder, FrameDecoder |
Yes |
| Formats | IPC, Parquet, CSV, TLV | Yes |
Design Principles
- Zero-copy - 64-byte aligned buffers via
Vec64, no reallocation to fix alignment - Composable - Layered codecs, mix and match transports and formats
- Async-native - Built for Tokio and futures with backpressure-aware sinks
- Minimal - Fast compile times, few dependencies
Feature Flags
| Feature | Description |
|---|---|
tcp |
TCP transport |
websocket |
WebSocket transport |
quic |
QUIC transport |
uds |
Unix domain socket transport |
stdio |
Stdin/stdout transport |
mmap |
Memory-mapped file reads |
parquet |
Parquet writer |
zstd |
Zstd compression |
snappy |
Snappy compression |
webtransport |
WebTransport support |
protocol |
Lightstream protocol multiplexing |
protobuf |
Protobuf message encoding via prost (implies protocol) |
msgpack |
MessagePack encoding via rmp-serde (implies protocol) |
Performance
Memory-mapped reads: ~4.5ms for 100M rows × 4 columns on a consumer laptop.
The only Arrow-compatible Rust crate providing 64-byte SIMD-aligned readers/writers.
License
Copyright Peter Garfield Bower 2025-2026.
Released under MIT. See LICENSE for details, and THIRD_PARTY_LICENSES for Apache-licensed dependencies.
Affiliation Notice
Lightstream is not affiliated with Apache Arrow or the Apache Software Foundation. It serialises the public Arrow format via Minarrow, using Flatbuffers schemas from Arrow-RS for schema type generation (see THIRD_PARTY_LICENSES).