spate_core/lib.rs
1//! The engine of the Spate framework.
2//!
3//! `spate-core` contains the pipeline runtime and every technology-neutral
4//! abstraction: records and their checkpoint tokens, the operator chain,
5//! the source and sink traits, checkpointing, backpressure, configuration
6//! loading, metrics, and the admin server.
7//!
8//! Applications should depend on the [`spate`](https://crates.io/crates/spate)
9//! facade crate rather than on `spate-core` directly.
10//!
11//! The properties the engine is arranged around are published as
12//! [Invariants], the decisions behind them as [Decisions], and the metric
13//! taxonomy as [Metrics]. Module documentation below cites the first two by
14//! identifier alone (`INV-2`, `ADR-0013`).
15//!
16//! [Invariants]: https://spate.kainth.dev/docs/INVARIANTS
17//! [Decisions]: https://spate.kainth.dev/docs/adr/
18//! [Metrics]: https://spate.kainth.dev/docs/METRICS
19
20// tokio's own sources change shape under `--cfg loom` (net disappears), so
21// anything touching tokio::net is compiled out of loom model builds.
22#[cfg(not(loom))]
23pub mod admin;
24/// Re-export of the [`bytes`] crate: [`RowEncoder`](sink::RowEncoder)
25/// signatures take [`bytes::BytesMut`], so connector authors can use this
26/// re-export instead of declaring their own `bytes` dependency (declaring
27/// one is also fine; versions are compatible per the workspace pin).
28pub use bytes;
29
30pub mod backpressure;
31pub mod checkpoint;
32// Resolves the reserved `chunk:` block into `ops::ChunkConfig`, so it follows
33// `ops` out of loom model builds (nothing loom-modelled reads config).
34#[cfg(not(loom))]
35pub mod config;
36// References `source` types, so it shares the source module's loom gate.
37#[cfg(not(loom))]
38pub mod coordination;
39pub mod deser;
40pub mod error;
41pub mod framing;
42pub mod metrics;
43#[cfg(not(loom))]
44pub mod ops;
45#[cfg(not(loom))]
46pub mod pipeline;
47pub mod record;
48#[cfg(not(loom))]
49pub mod sink;
50#[cfg(not(loom))]
51pub mod source;
52pub mod telemetry;
53
54pub use error::{DeserError, ErrorClass, ErrorPolicy, FatalError, SinkError, SourceError};
55pub use framing::FramingContract;
56pub use record::{Flow, PartitionId, RawPayload, Record, RecordMeta};