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#![allow(clippy::too_many_arguments, clippy::too_many_lines)]
8// Protocol state machines remain contiguous and keep authority inputs explicit.
9#![allow(clippy::enum_variant_names, clippy::trivially_copy_pass_by_ref)]
10// Generated protobuf APIs retain schema-defined names and callback signatures.
11// Protocol fixtures use explicit boundary values and full state construction.
12#![cfg_attr(
13 test,
14 allow(
15 clippy::cast_possible_truncation,
16 clippy::default_trait_access,
17 clippy::disallowed_types,
18 clippy::field_reassign_with_default,
19 clippy::items_after_statements,
20 clippy::large_futures,
21 clippy::similar_names,
22 clippy::struct_excessive_bools
23 )
24)]
25
26/// Feature-neutral catalog identity types.
27pub mod catalog;
28/// Z-set changelog `__weight` column name, shared between the MV producer and
29/// upsert-sink consumers.
30pub mod changelog;
31/// Distributed checkpoint barrier protocol.
32pub mod checkpoint;
33/// Crash-durable same-directory file publication primitives.
34pub mod durable_fs;
35mod durable_local_store;
36/// Compatibility alias for checkpoint storage
37pub use checkpoint as storage;
38/// Structured error code registry (`LDB-NNNN`) and Ring 0 hot path error type.
39pub mod error_codes;
40/// Lookup table types and predicate pushdown.
41pub mod lookup;
42pub mod mv;
43pub mod operator;
44/// Shared Arrow IPC serialization for `RecordBatch` ↔ bytes.
45pub mod serialization;
46/// Cross-instance shuffle: message codec, credit flow, wire protocol.
47pub mod shuffle;
48/// Pluggable state backend (`StateBackend` trait + impls).
49pub mod state;
50pub mod streaming;
51pub mod time;
52
53/// Distributed cluster coordination. Runtime services are gated behind `cluster`; the control
54/// namespace retains feature-neutral checkpoint value types in every build.
55pub mod cluster;
56
57/// Per-epoch checkpoint commit marker store. Used by the checkpoint
58/// coordinator's 2PC to record the commit decision durably before
59/// sinks are told to commit, so recovery can re-establish the verdict
60/// after a crash. Lives outside the cluster gate because
61/// single-instance also needs it.
62pub mod checkpoint_decision;
63
64/// Result type for laminar-core operations
65pub type Result<T> = std::result::Result<T, Error>;
66
67/// Error types for laminar-core
68#[derive(Debug, thiserror::Error)]
69pub enum Error {
70 /// Operator errors
71 #[error("Operator error: {0}")]
72 Operator(#[from] operator::OperatorError),
73
74 /// Time-related errors
75 #[error("Time error: {0}")]
76 Time(#[from] time::TimeError),
77
78 /// Materialized view errors
79 #[error("MV error: {0}")]
80 Mv(#[from] mv::MvError),
81}