laminar_core/lib.rs
1//! Core streaming engine for `LaminarDB`.
2
3#![deny(missing_docs)]
4#![warn(clippy::all, clippy::pedantic)]
5#![allow(clippy::duration_suboptimal_units)] // MSRV 1.85; from_mins/from_hours are 1.91+
6#![allow(clippy::module_name_repetitions)]
7
8/// Z-set changelog `__weight` column name, shared between the MV producer and
9/// upsert-sink consumers.
10pub mod changelog;
11/// Distributed checkpoint barrier protocol.
12pub mod checkpoint;
13/// Compatibility alias for checkpoint storage
14pub use checkpoint as storage;
15/// Structured error code registry (`LDB-NNNN`) and Ring 0 hot path error type.
16pub mod error_codes;
17/// Lookup table types and predicate pushdown.
18pub mod lookup;
19pub mod mv;
20pub mod operator;
21/// Shared Arrow IPC serialization for `RecordBatch` ↔ bytes.
22pub mod serialization;
23/// Cross-instance shuffle: message codec, credit flow, wire protocol.
24pub mod shuffle;
25/// Pluggable state backend (`StateBackend` trait + impls).
26pub mod state;
27pub mod streaming;
28pub mod time;
29
30/// Distributed cluster coordination. Unstable: gated behind `cluster`.
31#[cfg(feature = "cluster")]
32pub mod cluster;
33
34/// Per-epoch checkpoint commit marker store. Used by the checkpoint
35/// coordinator's 2PC to record the commit decision durably before
36/// sinks are told to commit, so recovery can re-establish the verdict
37/// after a crash. Lives outside the cluster gate because
38/// single-instance also needs it.
39pub mod checkpoint_decision;
40
41/// Result type for laminar-core operations
42pub type Result<T> = std::result::Result<T, Error>;
43
44/// Error types for laminar-core
45#[derive(Debug, thiserror::Error)]
46pub enum Error {
47 /// Operator errors
48 #[error("Operator error: {0}")]
49 Operator(#[from] operator::OperatorError),
50
51 /// Time-related errors
52 #[error("Time error: {0}")]
53 Time(#[from] time::TimeError),
54
55 /// Materialized view errors
56 #[error("MV error: {0}")]
57 Mv(#[from] mv::MvError),
58}