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/// Structured error code registry (`LDB-NNNN`) and Ring 0 hot path error type.
37pub mod error_codes;
38/// Refreshable Google workload-identity credentials for pinned object-store clients.
39#[cfg(feature = "gcs")]
40pub mod gcs_credentials;
41/// Lookup table types and predicate pushdown.
42pub mod lookup;
43pub mod mv;
44pub mod operator;
45/// Shared Arrow IPC serialization for `RecordBatch` ↔ bytes.
46pub mod serialization;
47/// Cross-instance shuffle: message codec, credit flow, wire protocol.
48pub mod shuffle;
49/// Partition-key encoding and virtual-node routing.
50pub mod state;
51/// Non-secret object-store credential-source classification.
52pub mod storage_auth;
53/// Provider-neutral object-store locations and consumer-specific URL adapters.
54pub mod storage_location;
55pub mod streaming;
56pub mod time;
57
58/// Distributed cluster coordination. Runtime services are gated behind `cluster`; the control
59/// namespace retains feature-neutral checkpoint value types in every build.
60pub mod cluster;
61
62/// Per-epoch checkpoint commit marker store. Used by the checkpoint
63/// coordinator's 2PC to record the commit decision durably before
64/// sinks are told to commit, so recovery can re-establish the verdict
65/// after a crash. Lives outside the cluster gate because
66/// single-instance also needs it.
67pub mod checkpoint_decision;
68
69/// Result type for laminar-core operations
70pub type Result<T> = std::result::Result<T, Error>;
71
72/// Error types for laminar-core
73#[derive(Debug, thiserror::Error)]
74pub enum Error {
75 /// Operator errors
76 #[error("Operator error: {0}")]
77 Operator(#[from] operator::OperatorError),
78
79 /// Time-related errors
80 #[error("Time error: {0}")]
81 Time(#[from] time::TimeError),
82
83 /// Materialized view errors
84 #[error("MV error: {0}")]
85 Mv(#[from] mv::MvError),
86}