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::assert_is_empty, // Assert cardinality without requiring equality on fixture elements.
16 clippy::cast_possible_truncation,
17 clippy::default_trait_access,
18 clippy::disallowed_types,
19 clippy::field_reassign_with_default,
20 clippy::items_after_statements,
21 clippy::large_futures,
22 clippy::similar_names,
23 clippy::struct_excessive_bools
24 )
25)]
26
27/// Feature-neutral catalog identity types.
28pub mod catalog;
29
30/// Z-set changelog `__weight` column name, shared between the MV producer and
31/// upsert-sink consumers.
32pub mod changelog;
33/// Distributed checkpoint barrier protocol.
34pub mod checkpoint;
35/// Crash-durable same-directory file publication primitives.
36pub mod durable_fs;
37mod durable_local_store;
38/// Structured error code registry (`LDB-NNNN`) and Ring 0 hot path error type.
39pub mod error_codes;
40/// Refreshable Google workload-identity credentials for pinned object-store clients.
41#[cfg(feature = "gcs")]
42pub mod gcs_credentials;
43/// Lookup table types and predicate pushdown.
44pub mod lookup;
45pub mod mv;
46pub mod operator;
47/// Versioned, immutable connector schema contracts stored with catalog definitions.
48pub mod schema_binding;
49/// Shared Arrow IPC serialization for `RecordBatch` ↔ bytes.
50pub mod serialization;
51/// Cross-instance shuffle: message codec, credit flow, wire protocol.
52pub mod shuffle;
53/// Partition-key encoding and virtual-node routing.
54pub mod state;
55/// Non-secret object-store credential-source classification.
56pub mod storage_auth;
57/// Provider-neutral object-store locations and consumer-specific URL adapters.
58pub mod storage_location;
59pub mod streaming;
60pub mod time;
61
62/// Distributed cluster coordination. Runtime services are gated behind `cluster`; the control
63/// namespace retains feature-neutral checkpoint value types in every build.
64pub mod cluster;
65
66/// Per-epoch checkpoint commit marker store. Used by the checkpoint
67/// coordinator's 2PC to record the commit decision durably before
68/// sinks are told to commit, so recovery can re-establish the verdict
69/// after a crash. Lives outside the cluster gate because
70/// single-instance also needs it.
71pub mod checkpoint_decision;
72
73/// Result type for laminar-core operations
74pub type Result<T> = std::result::Result<T, Error>;
75
76/// Error types for laminar-core
77#[derive(Debug, thiserror::Error)]
78pub enum Error {
79 /// Operator errors
80 #[error("Operator error: {0}")]
81 Operator(#[from] operator::OperatorError),
82
83 /// Time-related errors
84 #[error("Time error: {0}")]
85 Time(#[from] time::TimeError),
86
87 /// Materialized view errors
88 #[error("MV error: {0}")]
89 Mv(#[from] mv::MvError),
90}