1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! # Lightstream Protocol
//!
//! Multiplexes typed messages and Arrow tables over a single async stream.
//!
//! Both sides register named types in the same order, assigning sequential
//! `u8` tags. The outer framing is TLV — `[tag][length][payload]` — but
//! table payloads use the real Arrow IPC streaming protocol internally, not
//! per-table TLV overhead. The first table for a given type sends the full
//! IPC stream header with schema and dictionaries; subsequent tables send
//! only the record batch, as per a native Arrow IPC stream.
//!
//! ## Wire format
//!
//! ```text
//! [type_tag: u8][payload_len: u32 LE][payload: N bytes]
//! ```
//!
//! - **Message payloads** are opaque bytes. The protocol does not prescribe
//! a serialisation format.
//! - **Table payloads** contain Arrow IPC frames. Schema and dictionary
//! state is persistent per type, so only the first table carries the full
//! IPC header.
//!
//! ## Protobuf support
//!
//! Enable the `protobuf` feature to get typed send/receive methods backed
//! by [prost](https://docs.rs/prost). Define your message structs with
//! `#[derive(prost::Message)]` as usual, then:
//!
//! ```rust,ignore
//! // Send a typed protobuf message
//! conn.send_proto("Trade", &trade_event).await?;
//!
//! // Receive and decode
//! let msg = conn.recv().await.unwrap()?;
//! let trade: TradeEvent = msg.decode_payload()?;
//! ```
//!
//! Without the feature, messages are sent as raw `&[u8]` via [`send`] and
//! you handle serialisation yourself.
//!
//! [`send`]: LightstreamWriter::send
//!
//! ## Components
//!
//! - [`LightstreamMessage`] — decoded frame: message or table
//! - [`LightstreamCodec`] — unified type registry, Arrow IPC encode/decode
//! - [`LightstreamWriter`] — async writer over any `AsyncWrite`
//! - [`LightstreamReader`] — async reader implementing `Stream`
//! - [`LightstreamConnection`] — bidirectional wrapper with transport constructors
/// Unified type registry with encode and decode.
/// Bidirectional connection with transport-specific constructors.
pub use LightstreamCodec;
pub use LightstreamConnection;
pub use crate;
pub use crateLightstreamReader;
pub use crateLightstreamWriter;