Skip to main content

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;
32pub mod clock;
33// Resolves the reserved `chunk:` block into `ops::ChunkConfig`, so it follows
34// `ops` out of loom model builds (nothing loom-modelled reads config).
35#[cfg(not(loom))]
36pub mod config;
37// References `source` types, so it shares the source module's loom gate.
38#[cfg(not(loom))]
39pub mod coordination;
40pub mod deser;
41pub mod error;
42pub mod framing;
43pub mod metrics;
44#[cfg(not(loom))]
45pub mod ops;
46#[cfg(not(loom))]
47pub mod pipeline;
48pub mod record;
49#[cfg(not(loom))]
50pub mod sink;
51#[cfg(not(loom))]
52pub mod source;
53pub mod telemetry;
54
55pub use error::{DeserError, ErrorClass, ErrorPolicy, FatalError, SinkError, SourceError};
56pub use framing::FramingContract;
57pub use record::{Flow, PartitionId, RawPayload, Record, RecordMeta};