Skip to main content

datum/io/
mod.rs

1//! Streaming I/O — file and TCP sources/sinks, byte framing, compression, and `std::io` bridges.
2//!
3//! All operators here speak `Vec<u8>` chunks and compose with the linear `Source`/`Flow`/`Sink`
4//! DSL. The surface is:
5//!
6//! - **File I/O** — synchronous [`FileIO`] (on the Datum thread pool) and Tokio-backed
7//!   [`TokioFileIO`]; optional io_uring-backed `UringFileIO` behind the `io-uring-file` feature.
8//! - **TCP** — [`TokioTcp`] server ([`TokioTcp::bind`]) and client
9//!   ([`TokioTcp::outgoing_connection`]) byte streams. TLS, UDP, and QUIC live in `datum-net`.
10//! - **Framing** — [`Framing`]: delimiter, length-field, and JSON-object framing.
11//! - **Compression** — [`Compression`]: gzip/gunzip and deflate/inflate, in-process via `flate2`.
12//! - **`std::io` bridges** — [`StreamConverters`] adapts blocking `std::io::Read`/`Write` to/from
13//!   Datum streams, and materializes blocking [`InputStreamHandle`]/[`OutputStreamHandle`] handles.
14//!
15//! See `io/AGENTS.md` for invariants, hot paths, and the Akka mapping.
16
17mod adapters;
18mod compression;
19mod framing;
20mod tokio_io;
21
22pub use adapters::{FileIO, InputStreamHandle, OutputStreamHandle, StreamConverters};
23pub use compression::Compression;
24pub use framing::{Framing, FramingByteOrder};
25#[cfg(feature = "io-uring-file")]
26pub use tokio_io::UringFileIO;
27pub use tokio_io::{
28    IoResult, TcpBinding, TcpConnection, TcpIncomingConnection, TokioByteSink, TokioByteSource,
29    TokioFileIO, TokioTcp,
30};