ruststream_sea_file/lib.rs
1//! File and stdio stream implementation of the `RustStream` broker contract, built on
2//! `sea-streamer`.
3//!
4//! The gap this crate fills: running a service against a persistent stream without an
5//! external broker. Two transports in one crate, over
6//! [`sea-streamer-file`](https://docs.rs/sea-streamer-file) and
7//! [`sea-streamer-stdio`](https://docs.rs/sea-streamer-stdio):
8//!
9//! - [`FileBroker`] - a persistent, replayable stream on disk: survives restarts, records
10//! and replays, and repositioning is first-class - [`FileSubscriber`] implements the
11//! framework's `Seekable` capability with pinned captured positions (a sequence rewind is
12//! inclusive) plus beginning/end/timestamp forms.
13//! - [`StdioBroker`] - standard input and output as one stream, so a service becomes a stage
14//! of a shell pipeline; something no network broker can offer.
15//!
16//! Honest scope: the client keeps no consumer positions (its resumable mode is
17//! unimplemented upstream), so acknowledgement reports
18//! [`AckError::Unsupported`](ruststream::AckError::Unsupported) on both transports - resume
19//! explicitly via the descriptor's start position or a captured [`FilePosition`]. Payloads
20//! are plain bytes with no header space, so user headers travel in a text-safe envelope
21//! applied only when headers are present - a file written without headers stays readable as
22//! a plain payload stream by other tools. The file transport does not build on Windows (an
23//! upstream constraint).
24
25#![forbid(unsafe_code)]
26
27mod error;
28mod file;
29mod message;
30mod stdio;
31mod stream;
32mod subscriber;
33#[cfg(feature = "testing")]
34pub mod testing;
35mod wire;
36
37pub use error::SeaFileError;
38pub use file::{ConnectedFileBroker, FileBroker, FilePublish, FilePublisher};
39pub use message::{FilePosition, SEQUENCE_HEADER, SeaMessage};
40pub use stdio::{ConnectedStdioBroker, StdioBroker, StdioPublish, StdioPublisher, StdioSubscriber};
41pub use stream::FileStream;
42pub use subscriber::{FileSeeker, FileSubscriber};